/** * Unzip the file. * * @param String zip_file-- the zip file to be extracted. * @param String destdir-- destination directory */ public function unzip_ushahidi($zip_file, $destdir) { $archive = new Pclzip($zip_file); $this->log[] = sprintf("Unpacking %s ", $zip_file); if (@$archive->extract(PCLZIP_OPT_PATH, $destdir) == 0) { $this->errors[] = sprintf(Kohana::lang('libraries.upgrade_extracting_error'), $archive->errorInfo(true)); return false; } $this->log[] = sprintf("Unpacking went successful"); $this->success = true; return true; }
/** * Unzip the file. * * @param String zip_file-- the zip file to be extracted. * @param String destdir-- destination directory */ public function unzip_ushahidi($zip_file, $destdir) { $archive = new Pclzip($zip_file); $this->log[] = sprintf("Unpacking %s ", $zip_file); if (@$archive->extract(PCLZIP_OPT_PATH, $destdir) == 0) { $this->errors[] = sprintf('Error while extracting: <code>%s</code>', $archive->errorInfo(true)); return false; } $this->log[] = sprintf("Unpacking went successful"); $this->success = true; return true; }