From 7404220e1de8a64d8c183ee2f97da7e32a5cf70a Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sun, 18 Aug 2019 20:40:22 +0200 Subject: [PATCH] Script: allow running from git clone If you git clone the repo and run `composer install` and then call the program like so: ```bash php path/to/gitclone/parallel-lint ``` For a non-composer based project, PHP-Parallel-Lint would fail with the following message: ``` You must set up the project dependencies, run the following commands: curl -s http://getcomposer.org/installer | php php composer.phar install ``` For a composer based project, i.e. which does have a `vendor/autoload.php` file, but that file may not contain references to the PHP-Parallel-Lint application, it would fail with the following hard error: ``` Fatal error: Uncaught Error: Class 'JakubOnderka\PhpParallelLint\Application' not found in path/to/gitclone/parallel-lint:66 ``` This small change allows the application to work correctly in that situation. --- parallel-lint | 1 + 1 file changed, 1 insertion(+) diff --git a/parallel-lint b/parallel-lint index ea93fff..318637f 100755 --- a/parallel-lint +++ b/parallel-lint @@ -38,6 +38,7 @@ if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50400) { $autoloadLocations = [ getcwd() . '/vendor/autoload.php', getcwd() . '/../../autoload.php', + __DIR__ . '/vendor/autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/../../../autoload.php', ];