예제 #1
0
파일: Zip.php 프로젝트: luoshulin/falcon
 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
 public function deleteDir($dirname)
 {
     // This is needed to ensure the right number of
     // files are set to the $numFiles property.
     $this->reopenArchive();
     $location = $this->applyPathPrefix($dirname);
     $path = Util::normalizePrefix($location, '/');
     $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);
 }
예제 #3
0
파일: Local.php 프로젝트: xamiro-dev/xamiro
 /**
  * Constructor
  *
  * @param  string  $root
  */
 public function __construct($root)
 {
     $root = $this->ensureDirectory($root);
     $this->root = Util::normalizePrefix($root, DIRECTORY_SEPARATOR);
 }