Commit bcc511ff authored by Manfred Kutas's avatar Manfred Kutas

ZP-756 add compat function for memory_get_peak_usage.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 5998b9dc
...@@ -148,3 +148,17 @@ if (!function_exists('http_response_code')) { ...@@ -148,3 +148,17 @@ if (!function_exists('http_response_code')) {
return $code; return $code;
} }
} }
if (!function_exists('memory_get_peak_usage')) {
/**
* memory_get_peak_usage is not available prior to PHP 5.2.
* This complementary function will return the value of memory_get_usage();
* @see http://php.net/manual/en/function.memory-get-usage.php
* @see http://php.net/manual/en/function.memory-get-peak-usage.php
*/
function memory_get_peak_usage() {
ZLog::Write(LOGLEVEL_DEBUG, "memory_get_peak_usage() is not available on this system. The value of memory_get_usage() will be used.");
return memory_get_usage();
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment