Пример #1
0
 public function run($argv, $additional)
 {
     $command = @$argv[2];
     $param1 = @$argv[3];
     $param2 = @$argv[4];
     global $eepPath;
     $eepCache = eepCache::getInstance();
     $availableModules = $eepCache->readFromCache(eepCache::misc_key_availablemodules);
     if (!in_array($command, $availableModules)) {
         throw new Exception("Command '" . $command . "' not recognized.");
     }
     switch ($command) {
         case "help":
             sort($availableModules);
             echo "\nAvailable modules: " . implode($availableModules, ", ") . "\n";
             echo "\nModules path: " . $eepPath . "/modules/\n";
             echo "\n" . $this->help . "\n";
             $aliases = eep::getListOfAliases();
             $table = array();
             $table[] = array("Alias", "Command or Module");
             foreach ($aliases as $alias => $full) {
                 $table[] = array($alias, $full);
             }
             eep::printTable($table, "Available shortcuts");
             break;
         default:
             // this is an infamous hack; redirect the request to a different
             // module, and the help function there
             global $argv;
             global $argc;
             $argv[1] = $command;
             // the module, not actually used
             $argv[2] = "help";
             // the command, which is help
             global $eepPath;
             require_once $eepPath . "/modules/" . $command . "/index.php";
             break;
     }
 }
Пример #2
0
 static function expandAliases($alias)
 {
     $aliases = eep::getListOfAliases();
     if (isset($aliases[$alias])) {
         return $aliases[$alias];
     } else {
         return $alias;
     }
 }