[*] Core: you can now pass a query string with php-cli which will merged with for cronjobs and other things

This commit is contained in:
Rémi Gaillard
2013-05-15 14:46:40 +02:00
parent 35463be99a
commit 2c10ba5359
3 changed files with 30 additions and 2 deletions
+6 -2
View File
@@ -349,12 +349,16 @@ class ShopCore extends ObjectModel
}
}
if (!$id_shop && defined('_PS_ADMIN_DIR_'))
if ((!$id_shop && defined('_PS_ADMIN_DIR_')) || Tools::isPHPCLI())
{
// If in admin, we can access to the shop without right URL
$shop = new Shop(Configuration::get('PS_SHOP_DEFAULT'));
$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;
}
else
{