remove() public static method

Remove a file.
public static remove ( string $file, boolean $silenceErrors = false )
$file string
$silenceErrors boolean If true, no exception will be thrown in case removing fails.
 public function delete()
 {
     if ($this->exists()) {
         try {
             Filesystem::remove($this->getAbsoluteLocation());
         } catch (Exception $e) {
             throw new Exception("Unable to delete merged file : " . $this->getAbsoluteLocation() . ". Please delete the file and refresh");
         }
         // try to remove compressed version of the merged file.
         Filesystem::remove($this->getAbsoluteLocation() . ".deflate", true);
         Filesystem::remove($this->getAbsoluteLocation() . ".gz", true);
     }
 }
Beispiel #2
0
 public function test_removeNonExistingFile_shouldNotThrowException()
 {
     Filesystem::remove('foo');
 }