Gaufrette\File::delete PHP Method

delete() public method

Deletes the file from the filesystem.
public delete ( array $metadata = [] ) : boolean
$metadata array optional metadata which should be send when write
return boolean TRUE on success
    public function delete($metadata = array())
    {
        $this->setMetadata($metadata);
        return $this->filesystem->delete($this->key);
    }

Usage Example

Exemplo n.º 1
0
 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::delete