Submit
Path:
~
/
home
/
b
/
f
/
x
/
bfxleof
/
www
/
wp-content
/
plugins
/
duplicator
/
classes
/
package
/
File Content:
class.pack.archive.zip-20260622141516.php
<?php defined('ABSPATH') || defined('DUPXABSPATH') || exit; // Exit if accessed directly if (! defined('DUPLICATOR_VERSION')) exit; require_once (DUPLICATOR_PLUGIN_PATH.'classes/package/class.pack.archive.php'); /** * Creates a zip file using the built in PHP ZipArchive class */ class DUP_Zip extends DUP_Archive { //PRIVATE private static $compressDir; private static $countDirs = 0; private static $countFiles = 0; private static $sqlPath; private static $zipPath; private static $zipFileSize; private static $zipArchive; private static $limitItems = 0; private static $networkFlush = false; private static $scanReport; /** * Creates the zip file and adds the SQL file to the archive */ public static function create(DUP_Archive $archive, $buildProgress) { try { $timerAllStart = DUP_Util::getMicrotime(); $package_zip_flush = DUP_Settings::Get('package_zip_flush'); self::$compressDir = rtrim(wp_normalize_path(DUP_Util::safePath($archive->PackDir)), '/'); self::$sqlPath = DUP_Settings::getSsdirTmpPath()."/{$archive->Package->Database->File}"; self::$zipPath = DUP_Settings::getSsdirTmpPath()."/{$archive->File}"; self::$zipArchive = new ZipArchive(); self::$networkFlush = empty($package_zip_flush) ? false : $package_zip_flush; $filterDirs = empty($archive->FilterDirs) ? 'not set' : $archive->FilterDirs; $filterExts = empty($archive->FilterExts) ? 'not set' : $archive->FilterExts; $filterFiles = empty($archive->FilterFiles) ? 'not set' : $archive->FilterFiles; $filterOn = ($archive->FilterOn) ? 'ON' : 'OFF'; $filterDirsFormat = rtrim(str_replace(';', "\n\t", $filterDirs)); $filterFilesFormat = rtrim(str_replace(';', "\n\t", $filterFiles)); $lastDirSuccess = self::$compressDir; //LOAD SCAN REPORT $json = file_get_contents(DUP_Settings::getSsdirTmpPath()."/{$archive->Package->NameHash}_scan.json"); self::$scanReport = json_decode($json); DUP_Log::Info("\n********************************************************************************"); DUP_Log::Info("ARCHIVE (ZIP):"); DUP_Log::Info("********************************************************************************"); $isZipOpen = (self::$zipArchive->open(self::$zipPath, ZIPARCHIVE::CREATE) === TRUE); if (!$isZipOpen) { $error_message = "Cannot open zip file with PHP ZipArchive."; $buildProgress->set_failed($error_message); DUP_Log::error($error_message, "Path location [".self::$zipPath."]", Dup_ErrorBehavior::LogOnly); $archive->Package->setStatus(DUP_PackageStatus::ERROR); return; } DUP_Log::Info("ARCHIVE DIR: ".self::$compressDir); DUP_Log::Info("ARCHIVE FILE: ".basename(self::$zipPath)); DUP_Log::Info("FILTERS: *{$filterOn}*"); DUP_Log::Info("DIRS:\n\t{$filterDirsFormat}"); DUP_Log::Info("FILES:\n\t{$filterFilesFormat}"); DUP_Log::Info("EXTS: {$filterExts}"); DUP_Log::Info("----------------------------------------"); DUP_Log::Info("COMPRESSING"); DUP_Log::Info("SIZE:\t".self::$scanReport->ARC->Size); DUP_Log::Info("STATS:\tDirs ".self::$scanReport->ARC->DirCount." | Files ".self::$scanReport->ARC->FileCount); //ADD SQL $sql_ark_file_path = $archive->Package->getSqlArkFilePath(); $isSQLInZip = self::$zipArchive->addFile(self::$sqlPath, $sql_ark_file_path); if ($isSQLInZip) { DUP_Log::Info("SQL ADDED: ".basename(self::$sqlPath)); } else { $error_message = "Unable to add database.sql to archive."; DUP_Log::error($error_message, "SQL File Path [".self::$sqlPath."]", Dup_ErrorBehavior::LogOnly); $buildProgress->set_failed($error_message); $archive->Package->setStatus(DUP_PackageStatus::ERROR); return; } self::$zipArchive->close(); self::$zipArchive->open(self::$zipPath, ZipArchive::CREATE); //ZIP DIRECTORIES $info = ''; foreach (self::$scanReport->ARC->Dirs as $dir) { $emptyDir = $archive->getLocalDirPath($dir); if (is_readable($dir) && self::$zipArchive->addEmptyDir($emptyDir)) { self::$countDirs++; $lastDirSuccess = $dir; } else { //Don't warn when dirtory is the root path if (strcmp($dir, rtrim(self::$compressDir, '/')) != 0) { $dir_path = strlen($dir) ? "[{$dir}]" : "[Read Error] - last successful read was: [{$lastDirSuccess}]"; $info .= "DIR: {$dir_path}\n"; } } } //LOG Unreadable DIR info if (strlen($info)) { DUP_Log::Info("\nWARNING: Unable to zip directories:"); DUP_Log::Info($info); } /** * count update for integrity check */ $sumItems = (self::$countDirs + self::$countFiles); /* ZIP FILES: Network Flush * This allows the process to not timeout on fcgi * setups that need a response every X seconds */ $totalFileCount = count(self::$scanReport->ARC->Files); $info = ''; if (self::$networkFlush) { foreach (self::$scanReport->ARC->Files as $file) { $file_size = filesize($file); $localFileName = $archive->getLocalFilePath($file); if (is_readable($file)) { if (defined('DUPLICATOR_ZIP_ARCHIVE_ADD_FROM_STR') && DUPLICATOR_ZIP_ARCHIVE_ADD_FROM_STR && $file_size < DUP_Constants::ZIP_STRING_LIMIT && self::$zipArchive->addFromString($localFileName, file_get_contents($file))) { Dup_Log::Info("Adding {$file} to zip"); self::$limitItems++; self::$countFiles++; } elseif (self::$zipArchive->addFile($file, $localFileName)) { Dup_Log::Info("Adding {$file} to zip"); self::$limitItems++; self::$countFiles++; } else { $info .= "FILE: [{$file}]\n"; } } else { $info .= "FILE: [{$file}]\n"; } //Trigger a flush to the web server after so many files have been loaded. if (self::$limitItems > DUPLICATOR_ZIP_FLUSH_TRIGGER) { self::$zipArchive->close(); self::$zipArchive->open(self::$zipPath); self::$limitItems = 0; DUP_Util::fcgiFlush(); DUP_Log::Info("Items archived [{$sumItems}] flushing response."); } if(self::$countFiles % 500 == 0) { // Every so many files update the status so the UI can display $archive->Package->Status = DupLiteSnapLibUtil::getWorkPercent(DUP_PackageStatus::ARCSTART, DUP_PackageStatus::ARCVALIDATION, $totalFileCount, self::$countFiles); $archive->Package->update(); } } } //Normal else { foreach (self::$scanReport->ARC->Files as $file) { $file_size = filesize($file); $localFileName = $archive->getLocalFilePath($file); if (is_readable($file)) { if (defined('DUPLICATOR_ZIP_ARCHIVE_ADD_FROM_STR') && DUPLICATOR_ZIP_ARCHIVE_ADD_FROM_STR && $file_size < DUP_Constants::ZIP_STRING_LIMIT && self::$zipArchive->addFromString($localFileName, file_get_contents($file))) { self::$countFiles++; } elseif (self::$zipArchive->addFile($file, $localFileName)) { self::$countFiles++; } else { $info .= "FILE: [{$file}]\n"; } } else { $info .= "FILE: [{$file}]\n"; } if(self::$countFiles % 500 == 0) { // Every so many files update the status so the UI can display $archive->Package->Status = DupLiteSnapLibUtil::getWorkPercent(DUP_PackageStatus::ARCSTART, DUP_PackageStatus::ARCVALIDATION, $totalFileCount, self::$countFiles); $archive->Package->update(); } } } //LOG Unreadable FILE info if (strlen($info)) { DUP_Log::Info("\nWARNING: Unable to zip files:"); DUP_Log::Info($info); unset($info); } DUP_Log::Info(print_r(self::$zipArchive, true)); /** * count update for integrity check */ $archive->file_count = self::$countDirs + self::$countFiles; DUP_Log::Info("FILE ADDED TO ZIP: ".$archive->file_count); //-------------------------------- //LOG FINAL RESULTS DUP_Util::fcgiFlush(); $zipCloseResult = self::$zipArchive->close(); if($zipCloseResult) { DUP_Log::Info("COMPRESSION RESULT: '{$zipCloseResult}'"); } else { $error_message = "ZipArchive close failure."; DUP_Log::error($error_message, "The ZipArchive engine is having issues zipping up the files on this server. For more details visit the FAQ\n" . "I'm getting a ZipArchive close failure when building. How can I resolve this?\n" . "[https://snapcreek.com/duplicator/docs/faqs-tech/#faq-package-165-q]", Dup_ErrorBehavior::LogOnly); $buildProgress->set_failed($error_message); $archive->Package->setStatus(DUP_PackageStatus::ERROR); return; } $timerAllEnd = DUP_Util::getMicrotime(); $timerAllSum = DUP_Util::elapsedTime($timerAllEnd, $timerAllStart); self::$zipFileSize = @filesize(self::$zipPath); DUP_Log::Info("COMPRESSED SIZE: ".DUP_Util::byteSize(self::$zipFileSize)); DUP_Log::Info("ARCHIVE RUNTIME: {$timerAllSum}"); DUP_Log::Info("MEMORY STACK: ".DUP_Server::getPHPMemory()); } catch (Exception $e) { $error_message = "Runtime error in class.pack.archive.zip.php constructor."; DUP_Log::error($error_message, "Exception: {$e}", Dup_ErrorBehavior::LogOnly); $buildProgress->set_failed($error_message); $archive->Package->setStatus(DUP_PackageStatus::ERROR); return; } } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
duparchive
---
0755
.DS_Store
10234 bytes
0644
DownloadConfController-20260707160053.php
945 bytes
0644
DownloadConfController.php
945 bytes
0644
LimitStream.php
4209 bytes
0644
README.md
2555 bytes
0644
Revisions.php
6508 bytes
0644
class-collector.php
984 bytes
0644
class-option-tabs-formatter.php
2321 bytes
0644
class-premium-upsell-admin-block.php
3631 bytes
0644
class-sitemaps-admin-20260703023908.php
3665 bytes
0644
class-sitemaps-admin.php
3665 bytes
0644
class-tracking-server-data.php
1989 bytes
0644
class-wpseo-statistics.php
1443 bytes
0644
class-yoast-notification-center.php
23601 bytes
0644
class-yoast-plugin-conflict.php
10390 bytes
0644
class.archive.config.php
1364 bytes
0644
class.pack.archive-20260622103452.php
28719 bytes
0644
class.pack.archive.filters.php
2353 bytes
0644
class.pack.archive.php
28719 bytes
0644
class.pack.archive.zip-20260622141516.php
11666 bytes
0644
class.pack.database-20260622052051.php
30838 bytes
0644
class.pack.database.php
30838 bytes
0644
class.password.php
6377 bytes
0644
class.snaplib.u.net-20260705060007.php
1831 bytes
0644
class.snaplib.u.net.php
1831 bytes
0644
class.u.json.php
4832 bytes
0644
class.ui.dialog.php
6780 bytes
0644
ctrl.package.php
17073 bytes
0644
duplicator-main.php
26907 bytes
0644
duplicator.php
1781 bytes
0644
elFinderPlugin-20260706172919.php
3331 bytes
0644
elFinderPlugin.php
3331 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623050500-20260705194237.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623050500.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class.php
48544 bytes
0644
exceptions.php
708 bytes
0644
image-helper-20260707023606.php
10231 bytes
0644
image-helper.php
10231 bytes
0644
inc.validator.php
5401 bytes
0644
index-20260622052309.php
14 bytes
0644
index.php
157663 bytes
0644
loco.php
5626 bytes
0644
loco.xml
657 bytes
0644
manager.php
14659 bytes
0644
meta-fields-presenter.php
1600 bytes
0644
module.php
1297 bytes
0644
quick-edit-handler-1650-20260707145325.js
1848 bytes
0644
quick-edit-handler-1650.js
1848 bytes
0644
setup-20260705134507.php
2699 bytes
0644
setup.php
2699 bytes
0644
social.php
725 bytes
0644
uninstall.php
4401 bytes
0644
wordpress-seojs-ar.json
25925 bytes
0644
N4ST4R_ID | Naxtarrr