I have a function like this :
public function asset_exists($path)
{
$webRoot = realpath($this->kernel->getRootDir() . '/../web/');
$toCheck = $webRoot . $path;
if (!file_exists("/Users/mtmac/app/app-web/web/uploads/clients/5b7e824a97ba4.jpeg"))
{
return false;
}
return true;
}
Everything is working well when I put value as string on file_exists function.
THE ISSUE IS When I change that IF conditional
if (!file_exists($toCheck))
{ return false; }
I always get return value FALSE from that condition.
NOTE :
a. The image is exists on disk
b. The value of param $toCheck
is
/Users/mtmac/app/app-web/web/uploads/clients/5b7e824a97ba4.jpeg