From d7b8921e8e570fb9fc7612910a65c3b11e380f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 14 Mar 2021 10:34:13 +0200 Subject: [PATCH 1/6] Add polyfill for \JsonSerializable --- composer.json | 1 + src/polyfill.php | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/polyfill.php diff --git a/composer.json b/composer.json index ae978fd..3495b2b 100644 --- a/composer.json +++ b/composer.json @@ -29,6 +29,7 @@ "sort-packages": true }, "autoload": { + "files": [ "src/polyfill.php" ], "classmap": [ "./" ] diff --git a/src/polyfill.php b/src/polyfill.php new file mode 100644 index 0000000..79b3049 --- /dev/null +++ b/src/polyfill.php @@ -0,0 +1,15 @@ + Date: Sun, 14 Mar 2021 10:34:18 +0200 Subject: [PATCH 2/6] Use traditional array syntax --- parallel-lint | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parallel-lint b/parallel-lint index 0d77fdb..54adb6c 100755 --- a/parallel-lint +++ b/parallel-lint @@ -35,14 +35,14 @@ if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50400) { exit(254); } -$autoloadLocations = [ +$autoloadLocations = array( getcwd() . '/vendor/autoload.php', getcwd() . '/../../autoload.php', __DIR__ . '/vendor/autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/../../../autoload.php', __DIR__ . '/../../autoload.php', -]; +); $loaded = false; foreach ($autoloadLocations as $autoload) { From 13d8caf0c464f852821e4dd0869676e5d3a9fb7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 14 Mar 2021 10:34:24 +0200 Subject: [PATCH 3/6] Allow loading script with php 5.3 --- parallel-lint | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parallel-lint b/parallel-lint index 54adb6c..7253179 100755 --- a/parallel-lint +++ b/parallel-lint @@ -30,8 +30,8 @@ of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. */ -if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50400) { - fwrite(STDERR, "PHP Parallel Lint require PHP 5.4.0 or newer." . PHP_EOL); +if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50300) { + fwrite(STDERR, "PHP Parallel Lint requires PHP 5.3.0 or newer." . PHP_EOL); exit(254); } From c699e2d9486207bc54e43c20a62093a1c934e589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 14 Mar 2021 10:34:21 +0200 Subject: [PATCH 4/6] Allow php 5.3 in composer --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3495b2b..6ba7932 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": ">=5.4.0", + "php": ">=5.3.0", "ext-json": "*" }, "replace": { From 1acda5a13fdfbe3f960a9f6f12bb085b99c599b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 27 Mar 2021 21:05:55 +0200 Subject: [PATCH 5/6] Add php 5.3 to CI and listed as supported --- .github/workflows/test.yml | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d948369..3bf2aea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -94,6 +94,7 @@ jobs: strategy: matrix: php: + - '5.3' - '5.4' - '5.5' - '5.6' diff --git a/README.md b/README.md index 68c99c1..6fe783b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Additionally `blame` can be used to show commits that introduced the breakage. Running parallel jobs in PHP is inspired by Nette framework tests. -The application is officially supported for use with PHP 5.4 to 8.0. +The application is officially supported for use with PHP 5.3 to 8.0. ## Table of contents From 3f2cc260c18c0fec7dff6d90e35976ae55f4a0e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 28 Mar 2021 13:54:14 +0300 Subject: [PATCH 6/6] Load polyfill from application, not from composer' This way the polyfill won't be executed when php-parallel-lint is loaded as composer dependency but in application only. --- composer.json | 1 - parallel-lint | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6ba7932..6bc745f 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,6 @@ "sort-packages": true }, "autoload": { - "files": [ "src/polyfill.php" ], "classmap": [ "./" ] diff --git a/parallel-lint b/parallel-lint index 7253179..cdbcab9 100755 --- a/parallel-lint +++ b/parallel-lint @@ -61,5 +61,7 @@ if (!$loaded) { exit(254); } +require_once __DIR__ . '/src/polyfill.php'; + $app = new JakubOnderka\PhpParallelLint\Application(); exit($app->run());