Commit dbe3f17b authored by Marco Pivetta's avatar Marco Pivetta

#598 - Simpler autoloader definition

parent c17662fa
...@@ -20,21 +20,19 @@ ...@@ -20,21 +20,19 @@
use Symfony\Component\Console\Helper\HelperSet; use Symfony\Component\Console\Helper\HelperSet;
use Doctrine\DBAL\Tools\Console\ConsoleRunner; use Doctrine\DBAL\Tools\Console\ConsoleRunner;
function requireAutoloader() { $files = array(__DIR__ . '/../vendor/autoload.php', __DIR__ . '/../../../autoload.php');
$files = array(__DIR__ . '/../vendor/autoload.php', __DIR__ . '/../../../autoload.php');
foreach ($files as $file) { foreach ($files as $file) {
if (file_exists($file)) { if (file_exists($file)) {
require $file; $loader = require $file;
return;
}
}
echo 'vendor/autoload.php could not be found. Did you run `php composer.phar install`?' . PHP_EOL; break;
exit(1); }
} }
requireAutoloader(); if (! $loader) {
throw new RuntimeException('vendor/autoload.php could not be found. Did you run `php composer.phar install`?');
}
$directories = array(getcwd(), getcwd() . DIRECTORY_SEPARATOR . 'config'); $directories = array(getcwd(), getcwd() . DIRECTORY_SEPARATOR . 'config');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment