1
0
mirror of https://github.com/mosbth/cimage.git synced 2025-01-17 19:18:15 +01:00

make debug depend on file exists

This commit is contained in:
Mikael Roos 2016-07-10 22:57:58 +02:00
parent 6118f298ff
commit 9a0a9429db

View File

@ -18,6 +18,9 @@ define("CIMAGE_USER_AGENT", "CImage/$version");
function debug($msg)
{
$file = "/tmp/cimage";
if (!is_writable($file)) {
return;
}
$msg .= ":" . count(get_included_files());
$msg .= ":" . round(memory_get_peak_usage()/1024/1024, 3) . "MB";
$msg .= ":" . (string) round((microtime(true) - $_SERVER['REQUEST_TIME_FLOAT']), 6) . "ms";