}
$cl->setArg(null, $zip);
$cl->execute();
+
+ if (stristr($cl->getOutput(), 'zipfile corrupt')) {
+ $corrupted = $zip . '.corrupted';
+ rename($zip, $corrupted);
+ $cl = new CommandLine('zip');
+ $cl->setManualArg('-FF ' . $corrupted);
+ $cl->setArg('out', $zip);
+ $cl->execute();
+ unlink($corrupted);
+ if (file_exists($zip . '.zip')) {
+ rename($zip . '.zip', $zip);
+ }
+ return self::extract($zip, $dir, $junkPath);
+ }
+
return $cl;
// } else if (class_exists('ZipArchive')) {
// $za = new \ZipArchive();