PclZip::privAddFile( $p_filedescr, $p_header, $p_options )
- Source
wp-admin/includes/class-pclzip.php:2530
Compatibility
- WordPress
- core
- PHP
- 7.4–8.6-dev
- 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), and compiles on PHP 7.4 through 8.6-dev.
Parameters
$p_filedescr$p_header$p_options
Performance profile
How much work a call to PclZip::privAddFile() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.
- Cost class
- Heavy
- Scaling
- Constant
- Instructions
- 85–218
- Plugin surface
- None
- Called by
- 1
Reads or writes the filesystem via filemtime().
No loop in the body: the same number of instructions runs whatever you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 375.
Nothing here hands control to plugin code.
1 place in core call this, so the cost is paid more often than your own code shows.
What it touches
- filesystemfilesystem access
filemtime()called directly
What one call costs · 148 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost PclZip::privAddFile() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) | 85–102 | clearstatcache(), filemtime() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) | 85–98 | clearstatcache(), time() |
$p_filename != "" && !isset($p_filedescr) | 100–124 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) | 100–119 | clearstatcache(), filemtime(), ->privAddFileUsingTempFile() |
$p_filename != "" && !isset($p_filedescr) | 100–117 | clearstatcache(), time(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) | 100–115 | clearstatcache(), time(), ->privAddFileUsingTempFile() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) | 107–120 | clearstatcache(), filemtime(), ->privWriteFileHeader() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) | 107–116 | clearstatcache(), time(), ->privWriteFileHeader() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file == 0 | 107–126 | clearstatcache(), filemtime(), fopen(), ::PclZip(), ::PclZip() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file == 0 | 107–122 | clearstatcache(), time(), fopen(), ::PclZip(), ::PclZip() |
$p_filename != "" && !isset($p_filedescr) | 111–131 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction() |
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 | 111–122 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction() |
136 further outcomes, up to 207 instructions
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $p_options && $v_result != 1 | 116–124 | clearstatcache(), filemtime(), crc32(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $p_options && $v_result != 1 | 116–120 | clearstatcache(), time(), crc32(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && !$v_result | 118–135 | clearstatcache(), filemtime(), ->privAddFileUsingTempFile(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && !$v_result | 118–131 | clearstatcache(), time(), ->privAddFileUsingTempFile(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) | 119–140 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) | 119–141 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), ->privAddFileUsingTempFile() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 | 119–133 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 | 119–134 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), ->privAddFileUsingTempFile() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && !$p_options && $v_result != 1 | 121–129 | clearstatcache(), filemtime(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && !$p_options && $v_result != 1 | 121–125 | clearstatcache(), time(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $p_options && $v_result == 1 | 124–132 | clearstatcache(), filemtime(), crc32(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $p_options && $v_result == 1 | 124–128 | clearstatcache(), time(), crc32(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && $v_result == 1 | 125–136 | clearstatcache(), filemtime(), ->privWriteFileHeader(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && $v_result == 1 | 125–132 | clearstatcache(), time(), ->privWriteFileHeader(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) | 126–142 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), ->privWriteFileHeader() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 | 126–135 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), ->privWriteFileHeader() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) | 126–147 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) | 126–148 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), ->privAddFileUsingTempFile() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 | 126–138 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 | 126–137 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), ->privAddFileUsingTempFile() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file == 0 | 126–148 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), ::PclZip(), ::PclZip() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file == 0 | 126–141 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), ::PclZip(), ::PclZip() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && !$p_options && $v_result == 1 | 129–137 | clearstatcache(), filemtime(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && !$p_options && $v_result == 1 | 129–133 | clearstatcache(), time(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) | 133–149 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), ->privWriteFileHeader() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 | 133–140 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), ->privWriteFileHeader() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && $p_options && $v_result != 1 | 133–152 | clearstatcache(), filemtime(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file == 0 | 133–155 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), ::PclZip(), ::PclZip() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && $p_options && $v_result != 1 | 133–148 | clearstatcache(), time(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file == 0 | 133–144 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), ::PclZip(), ::PclZip() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $p_options && $v_result != 1 | 135–146 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), crc32(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $p_options && $v_result != 1 | 135–139 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), crc32(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && !$v_result | 137–157 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), ->privAddFileUsingTempFile(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && !$v_result | 137–150 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), ->privAddFileUsingTempFile(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && !$p_options && $v_result != 1 | 138–157 | clearstatcache(), filemtime(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && !$p_options && $v_result != 1 | 138–153 | clearstatcache(), time(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && $p_options && $v_result == 1 | 139–148 | clearstatcache(), filemtime(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && $p_options && $v_result == 1 | 139–144 | clearstatcache(), time(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && !$p_options && $v_result != 1 | 140–151 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && !$p_options && $v_result != 1 | 140–144 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && $p_options && $v_result == 1 | 141–160 | clearstatcache(), filemtime(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && $p_options && $v_result == 1 | 141–156 | clearstatcache(), time(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && $p_options && $v_result != 1 | 141–160 | clearstatcache(), filemtime(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && $p_options && $v_result != 1 | 141–156 | clearstatcache(), time(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $p_options && $v_result != 1 | 142–153 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $p_options && $v_result != 1 | 142–144 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && $p_options && $v_result == 1 | 143–154 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), crc32(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && $p_options && $v_result == 1 | 143–147 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), crc32(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result == 1 | 144–158 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), ->privWriteFileHeader(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_result == 1 | 144–151 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), ->privWriteFileHeader(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && !$v_result | 144–164 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), ->privAddFileUsingTempFile(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && !$v_result | 144–153 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), ->privAddFileUsingTempFile(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && !$p_options && $v_result == 1 | 144–153 | clearstatcache(), filemtime(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && !$p_options && $v_result == 1 | 144–149 | clearstatcache(), time(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && !$p_options && $v_result == 1 | 146–165 | clearstatcache(), filemtime(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && !$p_options && $v_result == 1 | 146–161 | clearstatcache(), time(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && !$p_options && $v_result != 1 | 146–165 | clearstatcache(), filemtime(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && !$p_options && $v_result != 1 | 146–161 | clearstatcache(), time(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && !$p_options && $v_result != 1 | 147–158 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && !$p_options && $v_result != 1 | 147–149 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && !$p_options && $v_result == 1 | 148–159 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && !$p_options && $v_result == 1 | 148–152 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && $p_options && $v_result == 1 | 149–168 | clearstatcache(), filemtime(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && $p_options && $v_result == 1 | 149–164 | clearstatcache(), time(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && $p_options && $v_result == 1 | 150–161 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && $p_options && $v_result == 1 | 150–152 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result == 1 | 151–165 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), ->privWriteFileHeader(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_result == 1 | 151–156 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), ->privWriteFileHeader(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && $p_options && $v_result != 1 | 152–174 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && $p_options && $v_result != 1 | 152–167 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && !$p_options && $v_result == 1 | 154–173 | clearstatcache(), filemtime(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && !$p_options && $v_result == 1 | 154–169 | clearstatcache(), time(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && !$p_options && $v_result == 1 | 155–166 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && !$p_options && $v_result == 1 | 155–157 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && $p_options && $v_result == 1 | 156–176 | clearstatcache(), filemtime(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && $p_options && $v_result == 1 | 156–172 | clearstatcache(), time(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && !$p_options && $v_result != 1 | 157–179 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result != 1 | 157–172 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $p_options && $v_result == 1 | 158–170 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $p_options && $v_result == 1 | 158–163 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && $p_options && $v_result != 1 | 159–181 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && $p_options && $v_result != 1 | 159–170 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && $p_options && $v_result == 1 | 160–182 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && $v_file != 0 && $p_options && $v_result == 1 | 160–175 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && $p_options && $v_result != 1 | 160–182 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && $p_options && $v_result != 1 | 160–175 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && !$p_options && $v_result == 1 | 161–181 | clearstatcache(), filemtime(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && !$p_options && $v_result == 1 | 161–177 | clearstatcache(), time(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && !$p_options && $v_result == 1 | 163–175 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && !$p_options && $v_result == 1 | 163–168 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && $p_options && $v_result == 1 | 164–184 | clearstatcache(), filemtime(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && $p_options && $v_result == 1 | 164–180 | clearstatcache(), time(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && !$p_options && $v_result != 1 | 164–186 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result != 1 | 164–175 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $p_options && $v_result == 1 | 165–177 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $p_options && $v_result == 1 | 165–168 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && !$p_options && $v_result == 1 | 165–187 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result == 1 | 165–180 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && !$p_options && $v_result != 1 | 165–187 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result != 1 | 165–180 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && $p_options && $v_result == 1 | 167–189 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && $v_file != 0 && $p_options && $v_result == 1 | 167–178 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && $p_options && $v_result != 1 | 167–189 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && $p_options && $v_result != 1 | 167–178 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && $p_options && $v_result == 1 | 168–190 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && $v_file != 0 && $p_options && $v_result == 1 | 168–183 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && !$p_options && $v_result == 1 | 169–189 | clearstatcache(), filemtime(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && !$p_options && $v_result == 1 | 169–185 | clearstatcache(), time(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && !$p_options && $v_result == 1 | 170–182 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && !$p_options && $v_result == 1 | 170–173 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && !$p_options && $v_result == 1 | 172–194 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result == 1 | 172–183 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && !$p_options && $v_result != 1 | 172–194 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result != 1 | 172–183 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose() |
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && !$p_options && $v_result == 1 | 173–195 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result == 1 | 173–188 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && $p_options && $v_result == 1 | 175–198 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && $p_options && $v_result == 1 | 175–191 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && $p_options && $v_result == 1 | 175–197 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && $v_file != 0 && $p_options && $v_result == 1 | 175–186 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && !$p_options && $v_result == 1 | 180–203 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result == 1 | 180–196 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && !$p_options && $v_result == 1 | 180–202 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result == 1 | 180–191 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && $p_options && $v_result == 1 | 182–205 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && $p_options && $v_result == 1 | 182–194 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && $p_options && $v_result == 1 | 183–206 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && $p_options && $v_result == 1 | 183–199 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && !$p_options && $v_result == 1 | 187–210 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result == 1 | 187–199 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && !$p_options && $v_result == 1 | 188–211 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result == 1 | 188–204 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && $p_options && $v_result == 1 | 190–213 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && $p_options && $v_result == 1 | 190–202 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && !$p_options && $v_result == 1 | 195–218 | clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result == 1 | 195–207 | clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo() |
This body has more branch combinations than are worth enumerating, so the table covers the outcomes found first rather than every one that exists.
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 375 | 85–218 | 31 | |
| 8.5 | 375 | 85–218 | 31 | |
| 8.4 | 375 | 85–218 | 31 | 3 fewer instructions than PHP 8.3 |
| 8.3 | 378 | 85–218 | 31 | |
| 8.2 | 378 | 85–218 | 31 | |
| 8.1 | 378 | 85–218 | 31 | |
| 7.4 | 378 | 85–218 | 31 |
An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.
Uses · 6
Used by · 1
Source code
function privAddFile($p_filedescr, &$p_header, &$p_options) { $v_result=1; // ----- Working variable $p_filename = $p_filedescr['filename']; // TBC : Already done in the fileAtt check ... ? if ($p_filename == "") { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file list parameter (invalid or empty list)"); // ----- Return return PclZip::errorCode(); } // ----- Look for a stored different filename /* TBC : Removed if (isset($p_filedescr['stored_filename'])) { $v_stored_filename = $p_filedescr['stored_filename']; } else { $v_stored_filename = $p_filedescr['stored_filename']; } */ // ----- Set the file properties clearstatcache(); $p_header['version'] = 20; $p_header['version_extracted'] = 10; $p_header['flag'] = 0; $p_header['compression'] = 0; $p_header['crc'] = 0; $p_header['compressed_size'] = 0; $p_header['filename_len'] = strlen($p_filename); $p_header['extra_len'] = 0; $p_header['disk'] = 0; $p_header['internal'] = 0; $p_header['offset'] = 0; $p_header['filename'] = $p_filename;// TBC : Removed $p_header['stored_filename'] = $v_stored_filename; $p_header['stored_filename'] = $p_filedescr['stored_filename']; $p_header['extra'] = ''; $p_header['status'] = 'ok'; $p_header['index'] = -1; // ----- Look for regular file if ($p_filedescr['type']=='file') { $p_header['external'] = 0x00000000; $p_header['size'] = filesize($p_filename); } // ----- Look for regular folder else if ($p_filedescr['type']=='folder') { $p_header['external'] = 0x00000010; $p_header['mtime'] = filemtime($p_filename); $p_header['size'] = filesize($p_filename); } // ----- Look for virtual file else if ($p_filedescr['type'] == 'virtual_file') { $p_header['external'] = 0x00000000; $p_header['size'] = strlen($p_filedescr['content']); } // ----- Look for filetime if (isset($p_filedescr['mtime'])) { $p_header['mtime'] = $p_filedescr['mtime']; } else if ($p_filedescr['type'] == 'virtual_file') { $p_header['mtime'] = time(); } else { $p_header['mtime'] = filemtime($p_filename); } // ------ Look for file comment if (isset($p_filedescr['comment'])) { $p_header['comment_len'] = strlen($p_filedescr['comment']);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.