/** @var Shopware_Components_Config $config */
$config =
$container->
get(Shopware_Components_Config::
class);
// Register the shop (we're too soon)
$config->
setShop($shop);
$context =
$router->
getContext();
$newContext = Context::
createFromShop($shop,
$config);
// Reuse the host
if ($newContext->
getHost() === null
) { $newContext->
setHost($context->
getHost());
$newContext->
setBaseUrl($context->
getBaseUrl());
$newContext->
setSecure($context->
isSecure());
} // Reuse the global params like controller and action
$globalParams =
$context->
getGlobalParams();
$newContext->
setGlobalParams($globalParams);
$router->
setContext($newContext);
} public function onPreDispatch(Enlight_Controller_EventArgs
$args) { /** @var Enlight_Controller_Front $front */
$front =
$args->
getSubject();