diff options
-rw-r--r-- | core/Composer/ScriptHandler.php | 15 | ||||
-rw-r--r-- | core/Db/BatchInsert.php | 3 | ||||
-rwxr-xr-x | misc/composer/build-xhprof.sh | 2 | ||||
-rw-r--r-- | plugins/Diagnostics/Diagnostic/PhpSettingsCheck.php | 17 | ||||
-rw-r--r-- | plugins/Insights/tests/Unit/FilterOrderByTest.php | 6 | ||||
-rw-r--r-- | tests/PHPUnit/Framework/TestCase/SystemTestCase.php | 10 | ||||
-rw-r--r-- | tests/PHPUnit/Integration/PiwikTest.php | 5 | ||||
-rw-r--r-- | tests/PHPUnit/Unit/FilesystemTest.php | 4 |
8 files changed, 6 insertions, 56 deletions
diff --git a/core/Composer/ScriptHandler.php b/core/Composer/ScriptHandler.php index d457030a14..085a4aa6fc 100644 --- a/core/Composer/ScriptHandler.php +++ b/core/Composer/ScriptHandler.php @@ -16,21 +16,13 @@ namespace Piwik\Composer; */ class ScriptHandler { - private static function isPhp7orLater() - { - return version_compare('7.0.0-dev', PHP_VERSION) < 1; - } - public static function cleanXhprof() { if (! is_dir('vendor/facebook/xhprof/extension')) { return; } - if (!self::isPhp7orLater()) { - // doesn't work with PHP 7 at the moment - passthru('misc/composer/clean-xhprof.sh'); - } + passthru('misc/composer/clean-xhprof.sh'); } public static function buildXhprof() @@ -39,9 +31,6 @@ class ScriptHandler return; } - - if (!self::isPhp7orLater()) { - passthru('misc/composer/clean-xhprof.sh'); - } + passthru('misc/composer/clean-xhprof.sh'); } } diff --git a/core/Db/BatchInsert.php b/core/Db/BatchInsert.php index f2b146e4ea..73dfab5940 100644 --- a/core/Db/BatchInsert.php +++ b/core/Db/BatchInsert.php @@ -221,10 +221,9 @@ class BatchInsert * @see http://bugs.php.net/bug.php?id=54158 */ $openBaseDir = ini_get('open_basedir'); - $isUsingNonBuggyMysqlnd = function_exists('mysqli_get_client_stats') && version_compare(PHP_VERSION, '5.6.17', '>='); $safeMode = ini_get('safe_mode'); - if (($isUsingNonBuggyMysqlnd || empty($openBaseDir)) && empty($safeMode)) { + if ((function_exists('mysqli_get_client_stats') || empty($openBaseDir)) && empty($safeMode)) { // php 5.x - LOAD DATA LOCAL INFILE only used if open_basedir is not set (or we're using a non-buggy version of mysqlnd) // and if safe mode is not enabled $keywords[] = 'LOCAL '; diff --git a/misc/composer/build-xhprof.sh b/misc/composer/build-xhprof.sh index fb9741d0ec..88864db8eb 100755 --- a/misc/composer/build-xhprof.sh +++ b/misc/composer/build-xhprof.sh @@ -2,7 +2,7 @@ if ! type phpize &> /dev/null; then echo "phpize missing, skipping build" - echo "If you installed PHP via Aptitude, you can install phpize w/ 'sudo apt-get install php5-dev'" + echo "If you installed PHP via Aptitude, you can install phpize w/ 'sudo apt-get install php7-dev'" exit fi diff --git a/plugins/Diagnostics/Diagnostic/PhpSettingsCheck.php b/plugins/Diagnostics/Diagnostic/PhpSettingsCheck.php index 679167576e..da353a8256 100644 --- a/plugins/Diagnostics/Diagnostic/PhpSettingsCheck.php +++ b/plugins/Diagnostics/Diagnostic/PhpSettingsCheck.php @@ -62,23 +62,6 @@ class PhpSettingsCheck implements Diagnostic $maxExecutionTime->setErrorResult(DiagnosticResult::STATUS_WARNING); $requiredSettings[] = $maxExecutionTime; - if ($this->isPhpVersionAtLeast56() && ! defined("HHVM_VERSION") && !$this->isPhpVersionAtLeast70()) { - // always_populate_raw_post_data must be -1 - // removed in PHP 7 - $requiredSettings[] = new RequiredPhpSetting('always_populate_raw_post_data', -1); - } - return $requiredSettings; } - - private function isPhpVersionAtLeast56() - { - return version_compare(PHP_VERSION, '5.6', '>='); - } - - private function isPhpVersionAtLeast70() - { - return version_compare(PHP_VERSION, '7.0.0-dev', '>='); - } - } diff --git a/plugins/Insights/tests/Unit/FilterOrderByTest.php b/plugins/Insights/tests/Unit/FilterOrderByTest.php index f3aa74f7bf..2b67f7aeb4 100644 --- a/plugins/Insights/tests/Unit/FilterOrderByTest.php +++ b/plugins/Insights/tests/Unit/FilterOrderByTest.php @@ -44,11 +44,7 @@ class FilterOrderByTest extends BaseUnitTest $this->applyOrderByFilter(); - if (SystemTestCase::isPhp7orLater()) { - $this->assertOrder(array('pos1', 'pos3', 'pos5', 'pos4', 'pos2', 'pos6', 'neg3', 'neg2', 'neg1', 'neg5', 'neg4')); - } else { - $this->assertOrder(array('pos1', 'pos5', 'pos3', 'pos4', 'pos2', 'pos6', 'neg3', 'neg2', 'neg1', 'neg5', 'neg4')); - } + $this->assertOrder(array('pos1', 'pos3', 'pos5', 'pos4', 'pos2', 'pos6', 'neg3', 'neg2', 'neg1', 'neg5', 'neg4')); } public function testOrderByShouldSortDependingOnNbVisitsIfColumnsHaveSameValue() diff --git a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php index 6622c6ea7a..3494cebd68 100644 --- a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php +++ b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php @@ -108,16 +108,6 @@ abstract class SystemTestCase extends PHPUnit_Framework_TestCase return !empty($travis); } - public static function isPhpVersion53() - { - return strpos(PHP_VERSION, '5.3') === 0; - } - - public static function isPhp7orLater() - { - return version_compare('7.0.0-dev', PHP_VERSION) < 1; - } - public static function isMysqli() { return getenv('MYSQL_ADAPTER') == 'MYSQLI'; diff --git a/tests/PHPUnit/Integration/PiwikTest.php b/tests/PHPUnit/Integration/PiwikTest.php index 4cbf92eeb1..d2cfc13543 100644 --- a/tests/PHPUnit/Integration/PiwikTest.php +++ b/tests/PHPUnit/Integration/PiwikTest.php @@ -33,11 +33,6 @@ class PiwikTest extends IntegrationTestCase '1e3', 0x123, "-1e-2", ); - if (!self::isPhp7orLater()) { - // this seems to be no longer considered valid in PHP 7+ - $value[] = '0x123'; - } - foreach ($valid as $key => $value) { $valid[$key] = array($value); } diff --git a/tests/PHPUnit/Unit/FilesystemTest.php b/tests/PHPUnit/Unit/FilesystemTest.php index bd77e6958d..3ecbbc2c10 100644 --- a/tests/PHPUnit/Unit/FilesystemTest.php +++ b/tests/PHPUnit/Unit/FilesystemTest.php @@ -44,9 +44,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase $input = array('xyz/1.gif', 'x/xyz.gif', 'xxyyzzgg'); $result = Filesystem::sortFilesDescByPathLength($input); - if (SystemTestCase::isPhp7orLater()) { - $input = array('x/xyz.gif', 'xyz/1.gif', 'xxyyzzgg'); - } + $input = array('x/xyz.gif', 'xyz/1.gif', 'xxyyzzgg'); $this->assertEquals($input, $result); } |