/** * Configures the command name and description. */ protected function configure() { $names = ''; $aimeos = new \Arcavias(array()); $cntlPaths = $aimeos->getCustomPaths('controller/jobs'); $controllers = \Controller_Jobs_Factory::getControllers($this->getBareContext(), $aimeos, $cntlPaths); foreach ($controllers as $key => $controller) { $names .= str_pad($key, 30) . $controller->getName() . PHP_EOL; } $this->setName('aimeos:jobs'); $this->setDescription('Executes the job controllers'); $this->addArgument('jobs', InputArgument::REQUIRED, 'One or more job controller names like "admin/job customer/email/watch"'); $this->addArgument('site', InputArgument::OPTIONAL, 'Site codes to execute the jobs for like "default unittest" (none for all)'); $this->setHelp("Available jobs are:\n" . $names); }
$options[$name] = substr($option, $pos + 1); } unset($params[$key]); } else { printf("Invalid option \"%1\$s\"\n", $option); usage(); } } } $site = 'default'; if (count($params) > 0 && ($site = end($params)) === false) { usage(); } spl_autoload_register('setup_autoload'); require 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'; $arcavias = new Arcavias(isset($options['extdir']) ? (array) $options['extdir'] : array()); $taskPaths = $arcavias->getSetupPaths($site); $includePaths = $taskPaths; $includePaths[] = get_include_path(); if (set_include_path(implode(PATH_SEPARATOR, $includePaths)) === false) { throw new Exception('Unable to extend include path'); } $ctx = new MShop_Context_Item_Default(); $confPaths = $arcavias->getConfigPaths('mysql'); if (isset($options['config'])) { $confPaths = array_merge($confPaths, (array) $options['config']); } $conf = new MW_Config_Array(array(), $confPaths); $conf = new MW_Config_Decorator_Memory($conf); $ctx->setConfig($conf); $conf->set('setup/site', $site);
/** * Registers the Arcavias autoloader. */ protected function _registerAutoloader() { if (self::$_autoloader === false) { spl_autoload_register(array($this, 'autoload'), true, false); self::$_autoloader = true; } }
} else { printf("Invalid option \"%1\$s\"\n", $option); usage(); } } } $site = $parent = 'default'; if (($site = array_shift($params)) === null) { $site = 'default'; } if (($parent = array_shift($params)) === null) { $parent = $site; } spl_autoload_register('setup_autoload'); require 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'; $arcavias = new Arcavias(isset($options['extdir']) ? (array) $options['extdir'] : array()); $taskPaths = $arcavias->getSetupPaths($parent); $includePaths = $taskPaths; $includePaths[] = get_include_path(); if (set_include_path(implode(PATH_SEPARATOR, $includePaths)) === false) { throw new Exception('Unable to extend include path'); } $ctx = new MShop_Context_Item_Default(); $confPaths = $arcavias->getConfigPaths('mysql'); if (isset($options['config'])) { $confPaths = array_merge($confPaths, (array) $options['config']); } $conf = new MW_Config_Array(array(), $confPaths); $conf = new MW_Config_Decorator_Memory($conf); $ctx->setConfig($conf); $conf->set('setup/site', $site);