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:
Diffstat (limited to 'core/CliMulti/CliPhp.php')
-rw-r--r--core/CliMulti/CliPhp.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/core/CliMulti/CliPhp.php b/core/CliMulti/CliPhp.php
index 3b1661510e..25c9206ebc 100644
--- a/core/CliMulti/CliPhp.php
+++ b/core/CliMulti/CliPhp.php
@@ -8,12 +8,18 @@
namespace Piwik\CliMulti;
use Piwik\Common;
+use Piwik\Config;
class CliPhp
{
public function findPhpBinary()
{
+ $general = Config::getInstance()->General;
+ if (!empty($general['php_binary_path']) && file_exists($general['php_binary_path'])) {
+ return $general['php_binary_path'];
+ }
+
if (defined('PHP_BINARY')) {
if ($this->isHhvmBinary(PHP_BINARY)) {
return PHP_BINARY . ' --php';
@@ -77,8 +83,12 @@ class CliPhp
private function isValidPhpType($path)
{
- return !empty($path)
- && false === strpos($path, 'fpm')
+ if (empty($path)) {
+ return false;
+ }
+ $path = basename($path);
+
+ return false === strpos($path, 'fpm')
&& false === strpos($path, 'cgi')
&& false === strpos($path, 'phpunit')
&& false === strpos($path, 'lsphp');