26 $sapi_type = php_sapi_name();
27 $script_file = basename(__FILE__);
31 if (substr($sapi_type, 0, 3) ==
'cgi') {
32 echo
"Error: You are using PHP for CGI. To execute ".$script_file.
" from command line, you must use PHP for CLI mode.\n";
43 define(
'EVEN_IF_ONLY_LOGIN_ALLOWED', 1);
48 $tmp = empty(
$_SERVER[
'SCRIPT_FILENAME']) ?
'' :
$_SERVER[
'SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
49 while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; }
50 if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)).
"/master.inc.php")) $res = @include substr($tmp, 0, ($i + 1)).
"/master.inc.php";
51 if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1))).
"/master.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1))).
"/master.inc.php";
53 if (!$res && file_exists(
"../master.inc.php")) $res = @include
"../master.inc.php";
54 if (!$res && file_exists(
"../../master.inc.php")) $res = @include
"../../master.inc.php";
55 if (!$res && file_exists(
"../../../master.inc.php")) $res = @include
"../../../master.inc.php";
57 print "Include of master fails";
67 $result = $user->fetch(
'',
'admin');
73 if (!isset($argv[1])) {
74 print "Usage: ".$script_file.
" param1 param2 ...\n";
77 print '--- start'.
"\n";
78 print 'Argument 1='.$argv[1].
"\n";
79 print 'Argument 2='.$argv[2].
"\n";
168 print '--- end ok'.
"\n";
170 print '--- end error code='.$error.
"\n";
dol_getmypid()
Return getmypid() or random PID when function is disabled Some web hosts disable this php function fo...
print $_SERVER["PHP_SELF"]
Edit parameters.
print
Draft customers invoices.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...