Created
March 12, 2015 12:31
-
-
Save vkbansal/6e7b1ef60a9c161cd3dc to your computer and use it in GitHub Desktop.
Revisions
-
vkbansal created this gist
Mar 12, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,48 @@ <?php require_once "vendor/autoload.php"; use Symfony\Component\Console\Application; use Illuminate\Database\Console\Migrations; use Pimple\Container; $container = new Container(); $container['migration-table'] = 'migration'; $container['db-config'] = [ 'driver' => 'pgsql', 'host' => 'localhost', 'database' => 'dummy', 'username' => 'postgres', 'password' => 'root', 'charset' => 'utf8', 'prefix' => '', 'schema' => 'public' ]; $container['filesytem'] = function ($c) { return new \Illuminate\Filesystem\Filesystem; }; $container['connection'] = function ($c) { $manager = new \Illuminate\Database\Capsule\Manager(); $manager->addConnection($c['db-config']); $manager->setAsGlobal(); $manager->bootEloquent(); return $manager->getConnection('default'); }; $container['resolver'] = function ($c) { $r = new \Illuminate\Database\ConnectionResolver(['default' => $c['connection']]); $r->setDefaultConnection('default'); return $r; }; $container['migration-repo'] = function ($c) { return new \Illuminate\Database\Migrations\DatabaseMigrationRepository($c['resolver'], $c['migration-table']); }; $app = new Application("Foo", "1.0"); $app->add(new Migrations\InstallCommand($container['migration-repo'])); $app->run();