Skip to content

Commit

Permalink
fix autoloader
Browse files Browse the repository at this point in the history
  • Loading branch information
sokil committed Aug 23, 2017
1 parent 2272de9 commit f4c81f0
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion bin/mongo-migrator
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
#!/usr/bin/env php
<?php

require_once __DIR__ . '/../vendor/autoload.php';
// find and load autoloader
$autoloadPathList = [
// phar, global install, dev
__DIR__ . '/../vendor/autoload.php',
// install to vendor/bin
__DIR__ . '/../../../autoload.php'
];

foreach ($autoloadPathList as $autoloadPath) {
if (file_exists($autoloadPath)) {
require_once $autoloadPath;
break;
}
}

// start application
$application = new \Sokil\Mongo\Migrator\Console\Application;
$application->run();

0 comments on commit f4c81f0

Please sign in to comment.