Example #1
0
 /**
  * Delete all specified paths and create them again with specified permission
  *
  * @param array $paths      Paths
  * @param int   $permission Value for CHMOD
  *
  * @return $this
  */
 public function flush(array $paths, $permission = 0777)
 {
     foreach ($paths as $path) {
         $dir = new self($path);
         $dir->getRoot()->remove();
     }
     foreach ($paths as $path) {
         $dir = new self($path);
         $dir->create($permission);
     }
     return $this;
 }