
Chad Sikorra - 2012-01-13 04:04:37
Would it be possible to add error checking to the unzipAll method? It currently does both mkdir and chmod but makes the assumption that both worked. Something like the following diff...
if (!mkdir("$targetDir/$str")) {
$this->debugMsg(2, "Failed to create directory: $targertDir/$str");
return false;
}
if($applyChmod) {
if (!chmod("$targetDir/$str", $applyChmod)) {
$this->debugMsg(2, "Failed to apply permission ($applyChmod) to: $targertDir/$str");
return false;
}
}
And later on...
$unzip_result = $maintainStructure ?
$this->unzip($fileName, "$targetDir/$fileName", $applyChmod):
$this->unzip($fileName, "$targetDir/".basename($fileName), $applyChmod);
if ($unzip_result === false) {
$this->debugMsg(2, "Failed to unzip file from archive: $filename");
return false;
}
And at the end of the method return true.