/** * Gzip decode a file. * * @param \BackupMigrate\Core\File\BackupFileReadableInterface $from * @param \BackupMigrate\Core\File\BackupFileWritableInterface $to * @return bool */ protected function _ZipDecode(BackupFileReadableInterface $from, BackupFileWritableInterface $to) { $success = FALSE; if (class_exists('ZipArchive')) { $zip = new \ZipArchive(); $res = $zip->open($to->realpath(), constant("ZipArchive::CREATE")); if ($res === TRUE) { $zip->addFile($from->realpath(), $from->getMeta('filename')); $success = $zip->close(); } } return $success; }