diff options
author | diosmosis <benaka@piwik.pro> | 2015-04-18 11:55:47 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-04-18 12:08:36 +0300 |
commit | 1760412a370823f96eeed21d730acf8f4038c843 (patch) | |
tree | 76b4c6ca0a2f9678b34d247e09e609b9ff7fc108 /core/CliMulti | |
parent | 5d57e10591a9e7e394f649cc67ea93ed14c47292 (diff) | |
parent | 898afb809d54553dea34e4d101e66b37f50f0334 (diff) |
Merge branch 'master' into config_step_2
Conflicts:
config/global.php
core/CliMulti/RequestCommand.php
core/Config.php
core/Config/IniFileChain.php
tests/PHPUnit/System/BlobReportLimitingTest.php
tests/PHPUnit/TestingEnvironment.php
tests/PHPUnit/Unit/Config/IniFileChainTest.php
tests/PHPUnit/Unit/ConfigTest.php
Diffstat (limited to 'core/CliMulti')
-rw-r--r-- | core/CliMulti/CliPhp.php | 4 | ||||
-rw-r--r-- | core/CliMulti/Process.php | 20 |
2 files changed, 21 insertions, 3 deletions
diff --git a/core/CliMulti/CliPhp.php b/core/CliMulti/CliPhp.php index 9ee5b191b1..3bf7b3888e 100644 --- a/core/CliMulti/CliPhp.php +++ b/core/CliMulti/CliPhp.php @@ -9,7 +9,6 @@ namespace Piwik\CliMulti; use Piwik\CliMulti; use Piwik\Common; -use Piwik\Plugins\Installation\SystemCheck; class CliPhp { @@ -67,8 +66,9 @@ class CliPhp private function isValidPhpVersion($bin) { + global $piwik_minimumPHPVersion; $cliVersion = $this->getPhpVersion($bin); - $isCliVersionValid = SystemCheck::isPhpVersionValid($cliVersion); + $isCliVersionValid = version_compare($piwik_minimumPHPVersion, $cliVersion) <= 0; return $isCliVersionValid; } diff --git a/core/CliMulti/Process.php b/core/CliMulti/Process.php index c63dd5a946..bae7e316d6 100644 --- a/core/CliMulti/Process.php +++ b/core/CliMulti/Process.php @@ -144,7 +144,7 @@ class Process } $lockedPID = trim($content); - $runningPIDs = explode("\n", trim( `ps ex | awk '{print $1}'` )); + $runningPIDs = self::getRunningProcesses(); return !empty($lockedPID) && in_array($lockedPID, $runningPIDs); } @@ -173,6 +173,10 @@ class Process return false; } + if (count(self::getRunningProcesses()) > 0) { + return true; + } + if (!self::isProcFSMounted()) { return false; } @@ -236,4 +240,18 @@ class Process return strpos($type, 'proc') === 0; } + /** + * @return int[] The ids of the currently running processes + */ + static function getRunningProcesses() + { + $ids = explode("\n", trim(`ps ex 2>/dev/null | awk '{print $1}' 2>/dev/null`)); + + $ids = array_map('intval', $ids); + $ids = array_filter($ids, function ($id) { + return $id > 0; + }); + + return $ids; + } } |