mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +01:00
Fix: Must work with PHP 5.*
This commit is contained in:
@@ -31,6 +31,22 @@
|
||||
*/
|
||||
|
||||
|
||||
if (! function_exists('json_encode'))
|
||||
{
|
||||
/**
|
||||
* Implement json_encode for PHP that does not support it
|
||||
*
|
||||
* @param mixed $elements PHP Object to json encode
|
||||
* @return string Json encoded string
|
||||
*/
|
||||
function json_encode($elements)
|
||||
{
|
||||
if (is_array($elements)) return '["' . join('","', $elements) . '"]';
|
||||
else return '"'.$elements.'"';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return a DoliDB instance (database handler).
|
||||
*
|
||||
@@ -52,18 +68,6 @@ function getDoliDBInstance($type, $host, $user, $pass, $name, $port)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function output memory used by PHP and exit everything. Used for debugging purpose.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function dol_stopwithmem()
|
||||
{
|
||||
print memory_get_usage();
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function called at end of web php process
|
||||
*
|
||||
@@ -77,6 +81,7 @@ function dol_shutdown()
|
||||
dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].($disconnectdone?' (Warn: db disconnection forced)':''), ($disconnectdone?LOG_WARNING:LOG_DEBUG));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return value of a param into GET or POST supervariable
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user