Array('zipfilepath1', 'zipfilepath2', ...), * 'exclude'=> Array('zipfilepath3', ...) * ) * * DEFAULT: If include is specified only files under the specified path will be included. * If exclude is specified folders or files will be excluded. */ if($includeExclude === false) $includeExclude = Array(); $lista = $this->getList(); if(sizeof($lista)) foreach($lista as $fileName=>$trash){ // Should the file be ignored? if($includeExclude['include'] && !$this->__checkPathInArray($fileName, $includeExclude['include'])) { // Do not include something not specified in include continue; } if($includeExclude['exclude'] && $this->__checkPathInArray($fileName, $includeExclude['exclude'])) { // Do not include something not specified in include continue; } // END $dirname = dirname($fileName); // Rename the path with the matching one (as specified) if(!empty($renamePaths)) { foreach($renamePaths as $lookup => $replace) { if(strpos($dirname, $lookup) === 0) { $dirname = substr_replace($dirname, $replace, 0, strlen($lookup)); break; } } } // END $outDN = "$targetDir/$dirname"; if(substr($dirname, 0, strlen($baseDir)) != $baseDir) continue; if(!is_dir($outDN) && $maintainStructure){ $str = ""; $folders = explode("/", $dirname); foreach($folders as $folder){ $str = $str?"$str/$folder":$folder; if(!is_dir("$targetDir/$str")){ $this->debugMsg(1, "Creating folder: $targetDir/$str"); mkdir("$targetDir/$str"); if($applyChmod) @chmod("$targetDir/$str", $applyChmod); } } } if(substr($fileName, -1, 1) == "/") continue; $this->unzip($fileName, "$targetDir/$dirname/".basename($fileName), $applyChmod); } } } ?>