Gaufrette\File::exists PHP Method

exists() public method

Indicates whether the file exists in the filesystem.
public exists ( ) : boolean
return boolean
    public function exists()
    {
        return $this->filesystem->has($this->key);
    }

Usage Example

 public function testCreateAnDeleteFile()
 {
     $fs = $this->getFilesystem();
     $filename = uniqid('test_');
     $file = new File($filename, $fs);
     $this->assertFalse($file->exists());
     $file->setContent('Hello');
     $this->assertTrue($file->exists());
     $file->delete();
     $this->assertFalse($file->exists());
 }
All Usage Examples Of Gaufrette\File::exists