/** * @param string $site */ private static function createContext($site) { $ctx = new \Aimeos\MShop\Context\Item\Standard(); $aimeos = self::getAimeos(); $paths = $aimeos->getConfigPaths('mysql'); $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; $file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser'; $local = array('resource' => array('fs' => array('adapter' => 'Standard', 'basedir' => __DIR__ . '/tmp'))); $conf = new \Aimeos\MW\Config\PHPArray($local, $paths); $conf = new \Aimeos\MW\Config\Decorator\Memory($conf); $conf = new \Aimeos\MW\Config\Decorator\Documentor($conf, $file); $ctx->setConfig($conf); $logger = new \Aimeos\MW\Logger\File($site . '.log', \Aimeos\MW\Logger\Base::DEBUG); $ctx->setLogger($logger); $dbm = new \Aimeos\MW\DB\Manager\PDO($conf); $ctx->setDatabaseManager($dbm); $fs = new \Aimeos\MW\Filesystem\Manager\Standard($conf); $ctx->setFilesystemManager($fs); $mq = new \Aimeos\MW\MQueue\Manager\Standard($conf); $ctx->setMessageQueueManager($mq); $cache = new \Aimeos\MW\Cache\None(); $ctx->setCache($cache); $i18n = new \Aimeos\MW\Translation\None('de'); $ctx->setI18n(array('de' => $i18n)); $session = new \Aimeos\MW\Session\None(); $ctx->setSession($session); $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx); $locale = $localeManager->bootstrap($site, '', '', false); $ctx->setLocale($locale); $ctx->setEditor('core:client/html'); return $ctx; }