From afff30a8b3e3786d1fa0cf7ada977940cb1781f9 Mon Sep 17 00:00:00 2001 From: Matthew Gamble Date: Wed, 2 Sep 2020 09:45:58 +1000 Subject: [PATCH 1/2] Move to supporting Box v3 Box v2 has been out of support for a very long time. --- box.json | 8 +++----- parallel-lint | 8 ++++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/box.json b/box.json index 951802d..17db203 100644 --- a/box.json +++ b/box.json @@ -2,10 +2,9 @@ "output": "parallel-lint.phar", "chmod": "0755", "compactors": [ - "Herrera\\Box\\Compactor\\Php" + "KevinGH\\Box\\Compactor\\Php" ], - "extract": false, - "main": "parallel-lint.php", + "main": "parallel-lint", "files": [ "LICENSE" ], @@ -23,6 +22,5 @@ "in": "bin" } ], - "stub": true, - "web": false + "stub": true } diff --git a/parallel-lint b/parallel-lint index 0d77fdb..b5d1dfa 100755 --- a/parallel-lint +++ b/parallel-lint @@ -35,9 +35,13 @@ if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50400) { exit(254); } +function isPhar() { + return class_exists(Phar::class) && (strlen(Phar::running()) > 0 ? true : false); +} + $autoloadLocations = [ - getcwd() . '/vendor/autoload.php', - getcwd() . '/../../autoload.php', + isPhar() ? "" : getcwd() . '/vendor/autoload.php', + isPhar() ? "" : getcwd() . '/../../autoload.php', __DIR__ . '/vendor/autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/../../../autoload.php', From 6cf534632e0fd3e0524c12c63f38e9d424c1319e Mon Sep 17 00:00:00 2001 From: Matthew Gamble Date: Fri, 4 Sep 2020 15:50:28 +1000 Subject: [PATCH 2/2] Support PHP 5.4 --- parallel-lint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parallel-lint b/parallel-lint index b5d1dfa..fa8844b 100755 --- a/parallel-lint +++ b/parallel-lint @@ -36,7 +36,7 @@ if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50400) { } function isPhar() { - return class_exists(Phar::class) && (strlen(Phar::running()) > 0 ? true : false); + return class_exists('Phar') && (strlen(Phar::running()) > 0 ? true : false); } $autoloadLocations = [