Skip to content

Instantly share code, notes, and snippets.

@davedevelopment
Forked from davehewy/phpmig.php
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davedevelopment/6e3a350a4161382f215d to your computer and use it in GitHub Desktop.
Save davedevelopment/6e3a350a4161382f215d to your computer and use it in GitHub Desktop.
dave:~/sites/bin $ ./phpmig status
PHP Fatal error: Call to a member function schema() on boolean in /Users/davidheward/sites/vendor/davedevelopment/phpmig/src/Phpmig/Adapter/Illuminate/Database.php on line 89
Fatal error: Call to a member function schema() on boolean in /Users/davidheward/sites/vendor/davedevelopment/phpmig/src/Phpmig/Adapter/Illuminate/Database.php on line 89
<?php
require '../game/http/includes/config.php';
use \Phpmig\Pimple\Pimple,
\Phpmig\Adapter,
\Illuminate\Database\Capsule\Manager as Capsule;
$container = new Pimple();
$container['config'] = array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'migration_test',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => ''
);
$container['capsule'] = $container->share(function($c) {
$capsule = new Capsule;
$capsule->addConnection($c['config']);
$capsule->setAsGlobal();
return $capsule;
});
$container['schema'] = $container->share(function($c) {
return $c['capsule']->schema();
});
$container['phpmig.adapter'] = $container->share(function() use ($container) {
return new \Phpmig\Adapter\Illuminate\Database($container['capsule'], 'migrations');
});
$container['phpmig.migrations_path'] = __DIR__ . DIRECTORY_SEPARATOR . 'migrations/';
return $container;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment