Elgg\Filesystem\File::exists PHP Method

exists() public method

public exists ( ) : boolean
return boolean Whether this file exists.
    public function exists()
    {
        return $this->directory->isFile($this->path);
    }

Usage Example

Exemplo n.º 1
0
 public function testCanCheckForItsOwnExistence()
 {
     $directory = GaufretteDirectory::createInMemory();
     $directory->putContents('/foo/bar/bar.php', 'bar');
     $realfile = new File($directory, '/foo/bar/bar.php');
     $nonfile = new File($directory, '/foo/baz.php');
     $this->assertTrue($realfile->exists());
     $this->assertFalse($nonfile->exists());
 }
All Usage Examples Of Elgg\Filesystem\File::exists