forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli
More file actions
executable file
·40 lines (32 loc) · 1.23 KB
/
Copy pathcli
File metadata and controls
executable file
·40 lines (32 loc) · 1.23 KB
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
#!/usr/bin/env php
<?php
declare(strict_types=1);
use Doctrine\Migrations\DependencyFactory;
use Doctrine\Migrations\Tools\Console\ConsoleRunner as MigrationsConsoleRunner;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Tools\Console\ConsoleRunner as ORMConsoleRunner;
use Doctrine\ORM\Tools\Console\EntityManagerProvider\SingleManagerProvider;
use Firehed\Container\TypedContainerInterface;
use OpenEMR\Console\Command\{
InstallCommand,
};
use Symfony\Component\Console\Application;
$container = require_once __DIR__ . '/bootstrap.php';
assert($container instanceof TypedContainerInterface);
if (php_sapi_name() !== 'cli') {
echo 'This can only be run from the command line.';
exit(1);
}
file_put_contents(
'php://stderr',
"WARNING: This CLI tool is experimental and in progress. You probably want bin/console.\n",
);
$application = new Application();
$application->addCommand($container->get(InstallCommand::class));
// Doctrine Migrations integration
MigrationsConsoleRunner::addCommands($application, $container->get(DependencyFactory::class));
// Doctrine ORM integration
ORMConsoleRunner::addCommands($application, new SingleManagerProvider(
$container->get(EntityManagerInterface::class),
));
$application->run();