Skip to content

Commit 501b5b9

Browse files
committed
Fixed autoload path
1 parent a1f84f1 commit 501b5b9

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

parallel-lint.php

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,27 @@ function showOptions()
3939
exit;
4040
}
4141

42-
require_once __DIR__ . '/vendor/autoload.php';
42+
$files = array(
43+
__DIR__ . '/../../autoload.php',
44+
__DIR__ . '/vendor/autoload.php'
45+
);
46+
47+
$autoloadFileFound = false;
48+
foreach ($files as $file) {
49+
if (file_exists($file)) {
50+
require $file;
51+
$autoloadFileFound = true;
52+
break;
53+
}
54+
}
55+
56+
if (!$autoloadFileFound) {
57+
die(
58+
'You need to set up the project dependencies using the following commands:' . PHP_EOL .
59+
'curl -s http://getcomposer.org/installer | php' . PHP_EOL .
60+
'php composer.phar install' . PHP_EOL
61+
);
62+
}
4363

4464
try {
4565
$manager = new PhpParallelLint\Manager;
@@ -53,4 +73,4 @@ function showOptions()
5373
} catch (Exception $e) {
5474
echo $e->getMessage(), PHP_EOL;
5575
die(FAILED);
56-
}
76+
}

0 commit comments

Comments
 (0)