Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@googlemail.com>2014-02-06 01:07:25 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-02-06 01:07:25 +0400
commit238e71a2bb514e851ba4b1129ffe4339f9689ab0 (patch)
tree84989d93c1603830922f1e94ef67adf4d9069e71 /core/Common.php
parentb1118efc1ed53dbabfe7aac93038ba08400beb57 (diff)
refs #4610 trigger archiving using cli instead of http
Diffstat (limited to 'core/Common.php')
-rw-r--r--core/Common.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/Common.php b/core/Common.php
index 53337dd79f..670c25174f 100644
--- a/core/Common.php
+++ b/core/Common.php
@@ -29,6 +29,8 @@ class Common
// Flag used with htmlspecialchar. See php.net/htmlspecialchars.
const HTML_ENCODING_QUOTE_STYLE = ENT_QUOTES;
+ public static $isCliMode = null;
+
/*
* Database
@@ -117,6 +119,10 @@ class Common
*/
public static function isPhpCliMode()
{
+ if (is_bool(self::$isCliMode)) {
+ return self::$isCliMode;
+ }
+
$remoteAddr = @$_SERVER['REMOTE_ADDR'];
return PHP_SAPI == 'cli' ||
(!strncmp(PHP_SAPI, 'cgi', 3) && empty($remoteAddr));