// also set query_string and server_name

This commit is contained in:
Rémi Gaillard
2013-05-15 16:46:48 +02:00
parent a0423d6226
commit ee8da0499b
2 changed files with 12 additions and 3 deletions
+1
View File
@@ -2217,6 +2217,7 @@ exit;
if (!is_array($args) || !count($args))
return;
$_GET = array_merge($args, $_GET);
$_SERVER['QUERY_STRING'] = $argv[1];
}
/**
+11 -3
View File
@@ -356,12 +356,20 @@ class ShopCore extends ObjectModel
$id_shop = (int)Configuration::get('PS_SHOP_DEFAULT');
$shop = new Shop((int)$id_shop);
if (!Validate::isLoadedObject($shop))
$shop = new Shop((int)Configuration::get('PS_SHOP_DEFAULT'));
$shop->physical_uri = preg_replace('#/+#', '/', str_replace('\\', '/', dirname(dirname($_SERVER['SCRIPT_NAME']))).'/');
$shop->virtual_uri = '';
// Define HTTP_HOST if PHP is launched with php-cli
if (Tools::isPHPCLI() && !isset($_SERVER['HTTP_HOST']) || empty($_SERVER['HTTP_HOST']))
$_SERVER['HTTP_HOST'] = $shop->domain;
// Define some $_SERVER variables like HTTP_HOST if PHP is launched with php-cli
if (Tools::isPHPCLI())
{
if(!isset($_SERVER['HTTP_HOST']) || empty($_SERVER['HTTP_HOST']))
$_SERVER['HTTP_HOST'] = $shop->domain;
if(!isset($_SERVER['SERVER_NAME']) || empty($_SERVER['SERVER_NAME']))
$_SERVER['SERVER_NAME'] = $shop->domain;
}
}
else
{