[-] Core: Set a remote addr with php-cli #PSCFV-10372

This commit is contained in:
Rémi Gaillard committed 2013-09-11 16:40:33 +02:00
1 parent a4d131eac9
commit f4f3084c35
1 file changed
+4 -2
+4 -2
View File
@@ -363,10 +363,12 @@ class ShopCore extends ObjectModel
// Define some $_SERVER variables like 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()) if (Tools::isPHPCLI())
{ {
if(!isset($_SERVER['HTTP_HOST']) || empty($_SERVER['HTTP_HOST'])) if (!isset($_SERVER['HTTP_HOST']) || empty($_SERVER['HTTP_HOST']))
$_SERVER['HTTP_HOST'] = $shop->domain; $_SERVER['HTTP_HOST'] = $shop->domain;
if(!isset($_SERVER['SERVER_NAME']) || empty($_SERVER['SERVER_NAME'])) if (!isset($_SERVER['SERVER_NAME']) || empty($_SERVER['SERVER_NAME']))
$_SERVER['SERVER_NAME'] = $shop->domain; $_SERVER['SERVER_NAME'] = $shop->domain;
if (!isset($_SERVER['REMOTE_ADDR']) || empty($_SERVER['REMOTE_ADDR']))
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
} }
} }
else else