redis-cmd.php 431 B

12345678910111213141516171819
  1. <?php
  2. define('CONFIG_FILE', __DIR__ . '/config.php');
  3. include __DIR__ . '/functions.php';
  4. include __DIR__ . '/class.async.php';
  5. $cfg = [];
  6. load_config();
  7. if ($argc < 2) {
  8. die("Usage: {$argv[0]} cmd arg...\n");
  9. }
  10. $args = $argv;
  11. array_shift($args);
  12. $method = array_shift($args);
  13. $async = new Async($cfg['redis_host'], $cfg['redis_port'], $cfg['worker_num']);
  14. $ret = $async->$method($args);
  15. echo $ret ? "success\n" : "FAILED\n";