forked from intaro/pinboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconsole
executable file
·37 lines (28 loc) · 1.15 KB
/
console
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
31
32
33
34
35
36
37
#!/usr/bin/env php
<?php
//ini_set('display_errors', 'on');
require __DIR__ . '/src/init.php';
//$app['debug'] = true;
$console = new Pinboard\Console\Application('Intaro Pinboard');
$console->setSilex($app);
$doctrineConfiguration = new Doctrine\DBAL\Migrations\Configuration\Configuration($app['db']);
$doctrineConfiguration->setMigrationsNamespace('Pinboard\\DoctrineMigrations');
$doctrineConfiguration->setMigrationsDirectory(__DIR__ . '/src/Pinboard/DoctrineMigrations');
$doctrineConfiguration->registerMigrationsFromDirectory(__DIR__ . '/src/Pinboard/DoctrineMigrations');
$doctrineCommands = array(
'ExecuteCommand',
'GenerateCommand',
'MigrateCommand',
'StatusCommand',
'VersionCommand',
);
foreach($doctrineCommands as $commandName) {
$fullCommandName = 'Doctrine\\DBAL\\Migrations\\Tools\\Console\\Command\\' . $commandName;
$command = new $fullCommandName();
$command->setMigrationConfiguration($doctrineConfiguration);
$console->add($command);
}
$console->add(new Pinboard\Command\InitCommand());
$console->add(new Pinboard\Command\AggregateCommand());
$console->add(new Pinboard\Command\AddUserCommand());
$console->run();