Commit dbe3f17b authored by Marco Pivetta's avatar Marco Pivetta

#598 - Simpler autoloader definition

parent c17662fa
......@@ -20,21 +20,19 @@
use Symfony\Component\Console\Helper\HelperSet;
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) {
if (file_exists($file)) {
require $file;
return;
}
}
foreach ($files as $file) {
if (file_exists($file)) {
$loader = require $file;
echo 'vendor/autoload.php could not be found. Did you run `php composer.phar install`?' . PHP_EOL;
exit(1);
break;
}
}
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');
......
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