18 require(dirname(__FILE__) .
'/bootstrap.inc.php');
31 parent::__construct(
$argv);
32 $this->command = array_shift($this->argv);
40 echo
"Command-line tool for import/export tasks\n"
42 .
"\t{$this->scriptName} list: List available plugins\n"
43 .
"\t{$this->scriptName} [pluginName] usage: Display usage information for a plugin\n"
44 .
"\t{$this->scriptName} [pluginName] [params...]: Invoke a plugin\n";
52 if ($this->command ===
'list') {
53 echo
"Available plugins:\n";
54 if (empty($plugins)) echo
"\t(None)\n";
55 else foreach ($plugins as
$plugin) {
56 echo
"\t" .
$plugin->getName() .
"\n";
60 if ($this->command ==
'usage' || $this->command ==
'help' || $this->command ==
'' || (
$plugin =
PluginRegistry::getPlugin(
'importexport', $this->command))===
null) {
65 return $plugin->executeCLI($this->scriptName, $this->parameters);