Skip to content

Commit d78eda7

Browse files
committed
Load vendor path when installed by dependents.
1 parent 88e3686 commit d78eda7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

phpbcc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22
<?php
33

44
$rootDir = dirname(__FILE__);
5-
$autoloader = $rootDir . "/vendor/autoload.php";
5+
$autoloader = $rootDir . "/../../autoload.php";
66

7-
if (!file_exists($autoloader)) {
7+
if (file_exists($rootDir . "/../../autoload.php")) {
8+
$autoloader = $rootDir . "/../../autoload.php";
9+
} elseif (file_exists($rootDir . "/vendor/autoload.php")) {
10+
$autoloader = $rootDir . "/vendor/autoload.php";
11+
}
12+
13+
if (!$autoloader) {
814
throw new Exception('You need to run composer to create the autoloader.');
915
}
1016

0 commit comments

Comments
 (0)