/** * Sets the view object and adds the available languages * * @param \Aimeos\MW\View\Iface $view The view object which generates the admin output * @return \Aimeos\Admin\JQAdm\Iface Reference to this object for fluent calls */ public function setView(\Aimeos\MW\View\Iface $view) { $extdir = dirname(dirname(dirname(dirname(dirname(dirname(dirname(dirname(__DIR__)))))))); $aimeos = new \Aimeos\Bootstrap(array($extdir)); $view->languagesList = $aimeos->getI18nList('admin'); $this->getClient()->setView($view); return $this; }
/** * Executes the command * * @param array $argv Associative array from $_SERVER['argv'] */ public static function run(array $argv) { array_shift($argv); $options = self::getOptions($argv); $sites = array_shift($argv); $extdirs = isset($options['extdir']) ? (array) $options['extdir'] : array(); $aimeos = new \Aimeos\Bootstrap($extdirs); $ctx = self::getContext($aimeos->getConfigPaths(), $options); $siteItems = self::getSiteItems($ctx, $sites); self::clear($ctx, $siteItems); }
/** * Configures the command name and description. */ protected function configure() { $names = ''; $aimeos = new \Aimeos\Bootstrap(array()); $cntlPaths = $aimeos->getCustomPaths('controller/jobs'); $controllers = \Aimeos\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); }
/** * Sets the view object and adds the available sites and languages * * @param \Aimeos\MW\View\Iface $view The view object which generates the admin output * @return \Aimeos\Admin\JQAdm\Iface Reference to this object for fluent calls */ public function setView(\Aimeos\MW\View\Iface $view) { $sites = array(); $aimeos = new \Aimeos\Bootstrap(); $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'locale/site'); $search = $manager->createSearch(); $search->setSortations(array($search->sort('+', 'locale.site.label'))); foreach ($manager->searchItems($search) as $siteItem) { $sites[$siteItem->getCode()] = $siteItem->getLabel(); } $view->pageSites = $sites; $view->pageLanguages = $aimeos->getI18nList('admin'); $this->getClient()->setView($view); return $this; }
} 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'; $aimeos = new \Aimeos\Bootstrap(isset($options['extdir']) ? (array) $options['extdir'] : array()); $taskPaths = $aimeos->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 \Aimeos\MShop\Context\Item\Standard(); $confPaths = $aimeos->getConfigPaths('mysql'); if (isset($options['config'])) { $confPaths = array_merge($confPaths, (array) $options['config']); } $conf = new \Aimeos\MW\Config\PHPArray(array(), $confPaths); $conf = new \Aimeos\MW\Config\Decorator\Memory($conf); $ctx->setConfig($conf); $conf->set('setup/site', $site);
exit(1); } $exectimeStart = microtime(true); try { $params = $_SERVER['argv']; array_shift($params); $options = getOptions($params); if (($site = array_shift($params)) === null) { $site = 'default'; } if (($tplsite = array_shift($params)) === null) { $tplsite = 'default'; } spl_autoload_register('setupAutoload'); require 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'; $aimeos = new \Aimeos\Bootstrap(isset($options['extdir']) ? (array) $options['extdir'] : array()); $taskPaths = $aimeos->getSetupPaths($tplsite); setIncludePaths($taskPaths); $conf = getConfig($aimeos->getConfigPaths(), $options); $conf->set('setup/site', $site); $dbconfig = getDbConfig($conf); $ctx = getContext($conf); $dbm = $ctx->getDatabaseManager(); $manager = new \Aimeos\MW\Setup\Manager\Multiple($dbm, $dbconfig, $taskPaths, $ctx); $action = isset($options['action']) ? $options['action'] : 'migrate'; $task = isset($options['task']) ? $options['task'] : null; switch ($action) { case 'clean': $manager->clean($task); break; case 'migrate':
unset($params[$key]); } else { printf("Invalid option \"%1\$s\"\n", $option); usage(); } } } if (($site = array_shift($params)) === null) { $site = 'default'; } if (($tplsite = array_shift($params)) === null) { $parent = 'default'; } spl_autoload_register('setup_autoload'); require 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'; $aimeos = new \Aimeos\Bootstrap(isset($options['extdir']) ? (array) $options['extdir'] : array()); $taskPaths = $aimeos->getSetupPaths($tplsite); $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 \Aimeos\MShop\Context\Item\Standard(); $confPaths = $aimeos->getConfigPaths(); if (isset($options['config'])) { $confPaths = array_merge($confPaths, (array) $options['config']); } $conf = new \Aimeos\MW\Config\PHPArray(array(), $confPaths); $conf = new \Aimeos\MW\Config\Decorator\Memory($conf); $ctx->setConfig($conf); $conf->set('setup/site', $site);