2
0
forked from Wavyzz/dolibarr

Cannot redeclare getmypid()

This commit is contained in:
frederic34
2014-07-31 10:21:47 +02:00
parent 55a51a9724
commit 6645b8a454
4 changed files with 17 additions and 15 deletions

View File

@@ -2333,7 +2333,7 @@ function dol_print_error($db='',$error='')
else // Mode CLI
{
$out.='> '.$langs->transnoentities("ErrorInternalErrorDetected").":\n".$argv[0]."\n";
$syslog.="pid=".getmypid();
$syslog.="pid=".dol_getmypid();
}
if (is_object($db))
@@ -4742,18 +4742,20 @@ function dol_set_focus($selector)
}
if (! function_exists('getmypid'))
/**
* Return getmypid() or random PID when function is disabled
* Some web hosts disable this php function for security reasons
* and sometimes we can't redeclare function
*
* @return int
*/
function dol_getmypid()
{
/**
* Return random PID
* Some web hosts disable this php function for security reasons
*
* @return int
*/
function getmypid()
{
return rand(1,32768);
}
if (! function_exists('getmypid')) {
return rand(1,32768);
} else {
return getmypid();
}
}