forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommand-runner
executable file
·26 lines (22 loc) · 1010 Bytes
/
command-runner
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
#!/usr/bin/php
<?php
/**
* command-runner.php Handles the loading and running of OpenEMR commands that leverage the php namespaces.
* Preference would be to use something like Symfony/Console but we are attempting to avoid too many dependencies so
* we have written this simplified command runner for dev & openemr administration needs
* @package openemr
* @link http://www.open-emr.org
* @author Stephen Nielson <[email protected]>
* @copyright Copyright (c) 2021 Stephen Nielson <[email protected]>
* @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
*/
$rootPath = dirname(__DIR__) . DIRECTORY_SEPARATOR;
require_once $rootPath . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
use OpenEMR\Common\Command\Runner\CommandRunner;
if (php_sapi_name() !== 'cli') {
echo "Only php cli can execute a command\n";
die();
}
$commandRunner = new CommandRunner($rootPath, pathinfo(__FILE__, PATHINFO_FILENAME));
$commandRunner->run();
exit;