jacwright / RestServer

A PHP REST server for providing a very light-weight REST API.
MIT License
510 stars 194 forks source link

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

Open Cleonet opened 7 years ago

Cleonet commented 7 years ago

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

tyzoid commented 7 years ago

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.

kevjett commented 6 years ago

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