// also set query_string and server_name
This commit is contained in:
@@ -2217,6 +2217,7 @@ exit;
|
|||||||
if (!is_array($args) || !count($args))
|
if (!is_array($args) || !count($args))
|
||||||
return;
|
return;
|
||||||
$_GET = array_merge($args, $_GET);
|
$_GET = array_merge($args, $_GET);
|
||||||
|
$_SERVER['QUERY_STRING'] = $argv[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+11
-3
@@ -356,12 +356,20 @@ class ShopCore extends ObjectModel
|
|||||||
$id_shop = (int)Configuration::get('PS_SHOP_DEFAULT');
|
$id_shop = (int)Configuration::get('PS_SHOP_DEFAULT');
|
||||||
|
|
||||||
$shop = new Shop((int)$id_shop);
|
$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->physical_uri = preg_replace('#/+#', '/', str_replace('\\', '/', dirname(dirname($_SERVER['SCRIPT_NAME']))).'/');
|
||||||
$shop->virtual_uri = '';
|
$shop->virtual_uri = '';
|
||||||
|
|
||||||
// Define HTTP_HOST if PHP is launched with php-cli
|
// Define some $_SERVER variables like HTTP_HOST if PHP is launched with php-cli
|
||||||
if (Tools::isPHPCLI() && !isset($_SERVER['HTTP_HOST']) || empty($_SERVER['HTTP_HOST']))
|
if (Tools::isPHPCLI())
|
||||||
$_SERVER['HTTP_HOST'] = $shop->domain;
|
{
|
||||||
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user