-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaster_load.inc.php
More file actions
51 lines (42 loc) · 1.17 KB
/
master_load.inc.php
File metadata and controls
51 lines (42 loc) · 1.17 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
41
42
43
44
45
46
47
48
49
50
51
<?php
require_once('env.inc.php');
if (!defined('NOSESSION')) {
define('NOSESSION', '1');
}
$sapi_type = php_sapi_name();
// Test if batch mode
if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit(-1);
}
// Load Dolibarr environment
$res = 0;
// Try master.inc.php using relative path
if (!$res && file_exists("../master.inc.php")) {
$res = @include "../master.inc.php";
}
if (!$res && file_exists("../../master.inc.php")) {
$res = @include "../../master.inc.php";
}
if (!$res && file_exists("../../../master.inc.php")) {
$res = @include "../../../master.inc.php";
}
if (!$res) {
die("Include of master fails");
}
// Useful things
$moduleclassname = 'mod'.$modulename;
$moduledir = strtolower($modulename);
$modulecontext = $moduledir."@".$moduledir;
$moduleprefix = strtoupper($modulename);
// Loading
$langs->load("main");
$langs->load($modulecontext);
// Global variables
$error = 0;
/*
* Main
*/
@set_time_limit(0);
print "***** ".$script_file." (".DOL_VERSION.") pid=".dol_getmypid()." *****\n";
dol_syslog($script_file." launched with arg ".join(',', $argv));