forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconsole
47 lines (41 loc) · 1.33 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
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/php
<?php
/**
* bin/console
*
* @package OpenEMR
* @link https://www.open-emr.org
* @author Brady Miller <Brady Miller <[email protected]>
* @copyright Copyright (c) 2022 Brady Miller <Brady Miller <[email protected]>
* @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
*/
if (php_sapi_name() !== 'cli') {
echo "Only php cli can execute a command\n";
die();
}
$siteDefault = 'default';
foreach ($argv as $arg) {
if (str_contains($arg, "--site=")) {
$siteDefault = explode("=", $arg)[1];
}
}
$_GET['site'] = $siteDefault;
$ignoreAuth = true;
// Since from command line, set $sessionAllowWrite since need to set site_id session and no benefit to set to false
$sessionAllowWrite = true;
require_once __DIR__ . '/../interface/globals.php';
use OpenEMR\Common\Command\AclModify;
use OpenEMR\Common\Command\CcdaNewpatientImport;
use OpenEMR\Common\Command\CcdaNewpatient;
use OpenEMR\Common\Command\CcdaImport;
use OpenEMR\Common\Command\Register;
use OpenEMR\Common\Command\ZfcModule;
use Symfony\Component\Console\Application;
$app = new Application();
$app->add(new AclModify());
$app->add(new CcdaNewpatientImport());
$app->add(new CcdaNewpatient());
$app->add(new CcdaImport());
$app->add(new Register());
$app->add(new ZfcModule());
$app->run();