forked from partkeepr/PartKeepr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpartkeepr.php
39 lines (28 loc) · 1.06 KB
/
partkeepr.php
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
<?php
namespace PartKeepr\Console;
use PartKeepr\PartKeepr;
include("src/backend/PartKeepr/PartKeepr.php");
PartKeepr::initializeClassLoaders();
PartKeepr::initializeConfig();
$cli = new \Symfony\Component\Console\Application('PartKeepr Console', \PartKeepr\PartKeeprVersion::PARTKEEPR_VERSION);
$cli->setCatchExceptions(true);
try {
PartKeepr::initializeDoctrine();
$helperSet = $cli->getHelperSet();
$helpers = array(
'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper(PartKeepr::getEM()->getConnection()),
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper(PartKeepr::getEM())
);
foreach ($helpers as $name => $helper) {
$helperSet->set($helper, $name);
}
} catch (\Exception $e) {
}
$cli->addCommands(array(
new \PartKeepr\Console\Commands\MinifyJSCommand(),
new \PartKeepr\Console\Commands\ListServicesCommand(),
new \PartKeepr\Console\Commands\ListCallsCommand(),
new \PartKeepr\Console\Commands\DescribeCallCommand(),
new \PartKeepr\Console\Commands\DescribeTypeCommand()
));
$cli->run();