-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.php
More file actions
30 lines (24 loc) · 911 Bytes
/
run.php
File metadata and controls
30 lines (24 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
use Nextras\Migrations\Bridges;
use Nextras\Migrations\Controllers;
use Nextras\Migrations\Drivers;
use Nextras\Migrations\Extensions;
require __DIR__ . '/../../vendor/autoload.php';
$conn = new LeanMapper\Connection(array(
'driver' => 'mysqli',
'host' => 'localhost',
'username' => 'root',
'password' => '***',
'database' => 'mydatabase',
));
$dbal = new Bridges\Dibi\Dibi3Adapter($conn);
$driver = new Drivers\MySqlDriver($dbal);
$controller = php_sapi_name() === 'cli'
? new Controllers\ConsoleController($driver)
: new Controllers\HttpController($driver);
$baseDir = __DIR__;
$controller->addGroup('structures', "$baseDir/structures");
$controller->addGroup('basic-data', "$baseDir/basic-data", array('structures'));
$controller->addGroup('dummy-data', "$baseDir/dummy-data", array('basic-data'));
$controller->addExtension('sql', new Extensions\SqlHandler($driver));
$controller->run();