2
0
forked from Wavyzz/dolibarr

Fix CLI tools must return a positive value on error for better cross

platform compatibility
This commit is contained in:
Laurent Destailleur
2024-03-04 19:41:21 +01:00
parent c181bbe2f2
commit 3bafcf5d00
27 changed files with 250 additions and 110 deletions

View File

@@ -34,7 +34,7 @@ $path = __DIR__.'/';
// 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);
exit(1);
}
@set_time_limit(0); // No timeout for this script
@@ -69,7 +69,7 @@ dol_syslog($script_file." launched with arg ".join(',', $argv));
if (empty($argv[1])) {
print "Usage: $script_file subdirtoscan (test|confirm)\n";
print "Example: $script_file propale test\n";
exit(-1);
exit(1);
}
print '--- start'."\n";