PclZip
- Source
wp-admin/includes/class-pclzip.php:190
Compatibility
- WordPress
- core
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Properties · 5
$zipnamepublic$zip_fdpublic$error_codepublic$error_stringpublic$magic_quotes_statuspublic
Methods · 51
- __construct()
- PclZip()
- create()
- add()
- listContent()
- extract()
- extractByIndex()
- delete()
- deleteByIndex()
- properties()
- duplicate()
- merge()
- errorCode()
- errorName()
- errorInfo()
- privCheckFormat()
- privParseOptions()
- privOptionDefaultThreshold()
- privFileDescrParseAtt()
- privFileDescrExpand()
- privCreate()
- privAdd()
- privOpenFd()
- privCloseFd()
- privAddList()
- privAddFileList()
- privAddFile()
- privAddFileUsingTempFile()
- privCalculateStoredFilename()
- privWriteFileHeader()
- privWriteCentralFileHeader()
- privWriteCentralHeader()
- privList()
- privConvertHeader2FileInfo()
- privExtractByRule()
- privExtractFile()
- privExtractFileUsingTempFile()
- privExtractFileInOutput()
- privExtractFileAsString()
- privReadFileHeader()
- privReadCentralFileHeader()
- privCheckFileHeaders()
- privReadEndCentralDir()
- privDeleteByRule()
- privDirCheck()
- privMerge()
- privDuplicate()
- privErrorLog()
- privErrorReset()
- privDisableMagicQuotes()
- privSwapBackMagicQuotes()
Source code
class PclZip { // ----- Filename of the zip file var $zipname = ''; // ----- File descriptor of the zip file var $zip_fd = 0; // ----- Internal error handling var $error_code = 1; var $error_string = ''; // ----- Current status of the magic_quotes_runtime // This value store the php configuration for magic_quotes // The class can then disable the magic_quotes and reset it after var $magic_quotes_status; // -------------------------------------------------------------------------------- // Function : PclZip() // Description : // Creates a PclZip object and set the name of the associated Zip archive // filename. // Note that no real action is taken, if the archive does not exist it is not // created. Use create() for that. // -------------------------------------------------------------------------------- function __construct($p_zipname) { // ----- Tests the zlib if (!function_exists('gzopen')) { die('Abort '.basename(__FILE__).' : Missing zlib extensions'); } // ----- Set the attributes $this->zipname = $p_zipname; $this->zip_fd = 0; $this->magic_quotes_status = -1; // ----- Return return; } public function PclZip($p_zipname) { self::__construct($p_zipname); } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : // create($p_filelist, $p_add_dir="", $p_remove_dir="") // create($p_filelist, $p_option, $p_option_value, ...) // Description : // This method supports two different synopsis. The first one is historical. // This method creates a Zip Archive. The Zip file is created in the // filesystem. The files and directories indicated in $p_filelist // are added in the archive. See the parameters description for the // supported format of $p_filelist. // When a directory is in the list, the directory and its content is added // in the archive. // In this synopsis, the function takes an optional variable list of // options. See below the supported options. // Parameters : // $p_filelist : An array containing file or directory names, or // a string containing one filename or one directory name, or // a string containing a list of filenames and/or directory // names separated by spaces. // $p_add_dir : A path to add before the real path of the archived file, // in order to have it memorized in the archive. // $p_remove_dir : A path to remove from the real path of the file to archive, // in order to have a shorter path memorized in the archive. // When $p_add_dir and $p_remove_dir are set, $p_remove_dir // is removed first, before $p_add_dir is added. // Options : // PCLZIP_OPT_ADD_PATH : // PCLZIP_OPT_REMOVE_PATH : // PCLZIP_OPT_REMOVE_ALL_PATH : // PCLZIP_OPT_COMMENT : // PCLZIP_CB_PRE_ADD : // PCLZIP_CB_POST_ADD :Changelog
Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-admin/includes/class-pclzip.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.