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:
authormattab <matthieu.aubry@gmail.com>2014-06-20 07:27:30 +0400
committermattab <matthieu.aubry@gmail.com>2014-06-20 07:27:30 +0400
commit5e8b3b76f34604921ba521723b9c3da026abf896 (patch)
treefe6bf8d177797063e8f20fa5237323967375ad41 /core/Common.php
parentd7b2e4aa4cf702a7afba404de0e5cfd77661b300 (diff)
Fixes #5306 Make sure console command works as expected when `php console core:update` is used instead of `./console core:update`
Diffstat (limited to 'core/Common.php')
-rw-r--r--core/Common.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/Common.php b/core/Common.php
index cfcf6dad34..64bf6926a1 100644
--- a/core/Common.php
+++ b/core/Common.php
@@ -146,15 +146,19 @@ class Common
}
/**
- * Returns true if the current request is a console command, eg. ./console xx:yy
+ * Returns true if the current request is a console command, eg.
+ * ./console xx:yy
+ * or
+ * php console xx:yy
+ *
* @return bool
*/
public static function isRunningConsoleCommand()
{
- $searched = '/console';
+ $searched = 'console';
$consolePos = strpos($_SERVER['SCRIPT_NAME'], $searched);
$expectedConsolePos = strlen($_SERVER['SCRIPT_NAME']) - strlen($searched);
- $isScriptIsConsole = $consolePos == $expectedConsolePos;
+ $isScriptIsConsole = ($consolePos === $expectedConsolePos);
return self::isPhpCliMode() && $isScriptIsConsole;
}