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); if (isset($options['option'])) {
} $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': $manager->migrate($task);