RestServer icon indicating copy to clipboard operation
RestServer copied to clipboard

Warning unlink (/jacwright/restserver/source/Jacwright/RestServer/RestServer.php (274)

Open Cleonet opened this issue 8 years ago • 2 comments

I have to replace line 274 : @unlink($this->cacheDir.'/urlMap.cache');

by

if (file_exists($this->cacheDir.'/urlMap.cache')) {
unlink($this->cacheDir.'/urlMap.cache');
}

Thank you

Cleonet avatar Oct 26 '17 09:10 Cleonet

Is the @ not squashing the warning? The problem is that this loses atomacy, which is important if handling requests in parallel, such as via apache2 or nginx.

tyzoid avatar Oct 26 '17 17:10 tyzoid

@ only squashes the error not the warning. I would suggest adding the if condition or you will have constant warning garbage in your logs.

kevjett avatar Sep 11 '18 13:09 kevjett