From f983d9a496fc56807de00e5b2d6c18ddb52266d1 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Tue, 22 Nov 2016 09:43:08 +0900 Subject: [PATCH] Treat IP as 127.0.0.1 when called on the CLI --- common/constants.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/constants.php b/common/constants.php index 3d2ab7631..7b51010e0 100644 --- a/common/constants.php +++ b/common/constants.php @@ -66,6 +66,11 @@ elseif (isset($_SERVER['REMOTE_ADDR']) && @inet_pton($_SERVER['REMOTE_ADDR']) != define('RX_CLIENT_IP_VERSION', 6); define('RX_CLIENT_IP', $_SERVER['REMOTE_ADDR']); } +elseif (PHP_SAPI === 'cli') +{ + define('RX_CLIENT_IP_VERSION', 4); + define('RX_CLIENT_IP', '127.0.0.1'); +} else { define('RX_CLIENT_IP_VERSION', 4);