Bolt\Twig\Handler\UtilsHandler::fileExists PHP Метод

fileExists() публичный Метод

Check if a file exists.
public fileExists ( string $fn, boolean $safe ) : boolean
$fn string
$safe boolean
Результат boolean
    public function fileExists($fn, $safe)
    {
        if ($safe) {
            // pretend we don't know anything about any files
            return false;
        } else {
            return file_exists($fn);
        }
    }

Usage Example

Пример #1
0
 public function testFileExistsSafe()
 {
     $app = $this->getApp();
     $handler = new UtilsHandler($app);
     $result = $handler->fileExists(__FILE__, true);
     $this->assertFalse($result);
 }