-
Notifications
You must be signed in to change notification settings - Fork 114
/
agendavcli
executable file
·43 lines (36 loc) · 1.58 KB
/
agendavcli
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
38
39
40
41
42
43
#!/usr/bin/php
<?php
$vendor_directory = getenv('COMPOSER_VENDOR_DIR');
if ($vendor_directory === false) {
$vendor_directory =__DIR__ . '/web/vendor';
}
require_once $vendor_directory . '/autoload.php';
$app = require_once __DIR__ . '/web/app/app.php';
require_once __DIR__ . '/web/app/services.php';
require __DIR__.'/web/config/prod.php';
$helperSet = new \Symfony\Component\Console\Helper\HelperSet(
[
'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($app['db']),
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($app['orm']),
'dialog' => new \Symfony\Component\Console\Helper\DialogHelper(),
]
);
$cli = new \Symfony\Component\Console\Application('AgenDAV CLI', \AgenDAV\Version::V);
$cli->setCatchExceptions(true);
$cli->setHelperSet($helperSet);
$cli->addCommands(array(
// DBAL Commands
new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(),
new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(),
new \Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand(),
new \Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand(),
new \Doctrine\DBAL\Migrations\Tools\Console\Command\GenerateCommand(),
new \Doctrine\DBAL\Migrations\Tools\Console\Command\MigrateCommand(),
new \Doctrine\DBAL\Migrations\Tools\Console\Command\StatusCommand(),
new \Doctrine\DBAL\Migrations\Tools\Console\Command\VersionCommand(),
// ORM
new \Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand(),
// Clear sessions command
new \AgenDAV\Console\Command\SessionsClearCommand(),
));
$cli->run();