/** * @param string $site */ private static function _createContext($site) { $ctx = new MShop_Context_Item_Default(); $arcavias = self::getArcavias(); $paths = $arcavias->getConfigPaths('mysql'); $paths[] = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'config'; $file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser'; $conf = new MW_Config_Array(array(), $paths); $conf = new MW_Config_Decorator_Memory($conf); $conf = new MW_Config_Decorator_Documentor($conf, $file); $ctx->setConfig($conf); $dbm = new MW_DB_Manager_PDO($conf); $ctx->setDatabaseManager($dbm); $logger = new MW_Logger_File($site . '.log', MW_Logger_Abstract::DEBUG); $ctx->setLogger($logger); $session = new MW_Session_None(); $ctx->setSession($session); $i18n = new MW_Translation_None('de'); $ctx->setI18n(array('de' => $i18n)); $localeManager = MShop_Locale_Manager_Factory::createManager($ctx); $locale = $localeManager->bootstrap($site, 'de', '', false); $ctx->setLocale($locale); $view = self::_createView($conf); $ctx->setView($view); $ctx->setEditor('core:controller/jobs'); return $ctx; }
/** * Creates a new context item. * * @param string $site Unique site code * @return \MShop_Context_Item_Interface Context object */ private static function _createContext($site) { $ctx = new MShop_Context_Item_Default(); $mshop = self::_getAimeos(); $paths = $mshop->getConfigPaths('mysql'); $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; $conf = new MW_Config_Array(array(), $paths); $ctx->setConfig($conf); $dbm = new MW_DB_Manager_PDO($conf); $ctx->setDatabaseManager($dbm); $logger = new MW_Logger_File($site . '.log', MW_Logger_Abstract::DEBUG); $ctx->setLogger($logger); $session = new MW_Session_None(); $ctx->setSession($session); $localeManager = MShop_Locale_Manager_Factory::createManager($ctx); $localeItem = $localeManager->bootstrap($site, '', '', false); $ctx->setLocale($localeItem); $ctx->setEditor('ai-symfony:unittest'); return $ctx; }
private static function _createContext($site) { $ctx = new MShop_Context_Item_Default(); $arcavias = self::_getArcavias(); $paths = $arcavias->getConfigPaths('mysql'); $paths[] = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'config'; $conf = new MW_Config_Array(array(), $paths); $conf = new MW_Config_Decorator_Memory($conf); $ctx->setConfig($conf); $dbm = new MW_DB_Manager_PDO($conf); $ctx->setDatabaseManager($dbm); $logger = new MW_Logger_File($site . '.log', MW_Logger_Abstract::DEBUG); $ctx->setLogger($logger); $session = new MW_Session_None(); $ctx->setSession($session); $localeManager = MShop_Locale_Manager_Factory::createManager($ctx); $locale = $localeManager->bootstrap($site, '', '', false); $ctx->setLocale($locale); $ctx->setEditor('<extname>:controller/frontend'); return $ctx; }
/** * @param string $site */ private static function _createContext($site) { $ctx = new MShop_Context_Item_Default(); $aimeos = self::_getAimeos(); $paths = $aimeos->getConfigPaths('mysql'); $paths[] = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'config'; $conf = new MW_Config_Array(array(), $paths); $ctx->setConfig($conf); $dbm = new MW_DB_Manager_PDO($conf); $ctx->setDatabaseManager($dbm); $logger = new MW_Logger_File($site . '.log', MW_Logger_Abstract::DEBUG); $ctx->setLogger($logger); $i18n = new MW_Translation_None('de'); $ctx->setI18n(array('de' => $i18n)); $session = new MW_Session_None(); $ctx->setSession($session); $localeManager = MShop_Locale_Manager_Factory::createManager($ctx); $localeItem = $localeManager->bootstrap($site, '', '', false); $ctx->setLocale($localeItem); $ctx->setEditor('ai-swiftmailer:lib/custom'); return $ctx; }
/** * Returns a new context object. * * @return MShop_Context_Item_Interface Context object */ protected static function getContext() { $ctx = new \MShop_Context_Item_Default(); $conf = \Aimeos\Aimeos\Base::getConfig(); $ctx->setConfig($conf); $dbm = new \MW_DB_Manager_PDO($conf); $ctx->setDatabaseManager($dbm); $logger = new \MW_Logger_Errorlog(\MW_Logger_ABSTRACT::INFO); $ctx->setLogger($logger); $session = new \MW_Session_None(); $ctx->setSession($session); $cache = new \MW_Cache_None(); $ctx->setCache($cache); return $ctx; }
} $conf->set($parts[0], $parts[1]); } } $dbconfig = $conf->get('resource', array()); foreach ($dbconfig as $rname => $dbconf) { if (strncmp($rname, 'db', 2) !== 0) { unset($dbconfig[$rname]); } else { $conf->set("resource/{$rname}/limit", 2); } } $dbm = new MW_DB_Manager_PDO($conf); $ctx->setDatabaseManager($dbm); $logger = new MW_Logger_Errorlog(MW_Logger_ABSTRACT::INFO); $ctx->setLogger($logger); $session = new MW_Session_None(); $ctx->setSession($session); $manager = new MW_Setup_Manager_Multiple($dbm, $dbconfig, $taskPaths, $ctx); $manager->run('mysql'); } catch (Exception $e) { echo "\n\nCaught exception while processing setup"; echo "\n\nMessage:\n"; echo $e->getMessage(); echo "\n\nStack trace:\n"; echo $e->getTraceAsString(); echo "\n\n"; exit(1); } $exectimeStop = microtime(true); printf("Setup process took %1\$f sec\n\n", $exectimeStop - $exectimeStart);