Skip to content
Permalink
Browse files

Composer compatibility - check if library is inside the vendor dir

  • Loading branch information
srggroup authored and mrclay committed Mar 27, 2017
1 parent f79794b commit d95690abc9734e51321fd9d633ce111a3d4c1eff
Showing with 9 additions and 1 deletion.
  1. +9 −1 bootstrap.php
@@ -4,13 +4,21 @@
*/

call_user_func(function () {
$file = __DIR__ . '/vendor/autoload.php';
if (is_dir(__DIR__ . '/../../../vendor')) {
// Used as a composer library
$vendorDir = __DIR__ . '/../../../vendor';
} else {
$vendorDir = __DIR__ . '/vendor';
}

$file = $vendorDir . '/autoload.php';
if (!is_file($file)) {
echo 'You must set up the project dependencies, run the following commands:'.PHP_EOL.
'curl -sS https://getcomposer.org/installer | php'.PHP_EOL.
'php composer.phar install'.PHP_EOL;
exit(1);
}

require $file;
});

0 comments on commit d95690a

Please sign in to comment.
You can’t perform that action at this time.