예제 #1
0
 public function deleteDir($dirname)
 {
     $path = Util::normalizePrefix($dirname, '/');
     $length = strlen($path);
     for ($i = 0; $i < $this->archive->numFiles; $i++) {
         $info = $this->archive->statIndex($i);
         if (substr($info['name'], 0, $length) === $path) {
             $this->archive->deleteIndex($i);
         }
     }
     return $this->archive->deleteName($dirname);
 }
예제 #2
0
 /**
  * Constructor
  *
  * @param  string  $root
  */
 public function __construct($root)
 {
     $root = $this->ensureDirectory($root);
     $this->root = Util::normalizePrefix($root, DIRECTORY_SEPARATOR);
 }