|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 Patcheszip_addPattern.patch (last revision 2011-01-27 15:46 UTC by rquadling)Pull RequestsHistoryAllCommentsChangesGit/SVN commits              [2011-01-27 16:55 UTC] rquadling@php.net
  [2011-01-27 16:57 UTC] pajoye@php.net
 
-Status:      Open
+Status:      Assigned
-Assigned To:
+Assigned To: pajoye
  [2011-01-27 16:57 UTC] pajoye@php.net
  [2011-01-27 17:05 UTC] rquadling@php.net
  [2011-01-27 17:10 UTC] pajoye@php.net
  [2015-08-20 22:20 UTC] cmb@php.net
  [2016-09-06 13:53 UTC] cmb@php.net
 
-Status:      Assigned
+Status:      Closed
-Assigned To: pajoye
+Assigned To: cmb
  [2016-09-06 13:53 UTC] cmb@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 18:00:01 2025 UTC | 
Description: ------------ php --rf zipArchive::addPattern tells us that the path is optional. This is confirmed by the parameter parsing. But, at least on windows, if no path is supplied, with a pattern that will include everything, no files are added. Setting the path to the current directory (for example) will include all files in that directory (using the same regex). Test script: --------------- <?php $zip = new ZipArchive; if (True === $zip->open('./TestAddPattern.zip', ZIPARCHIVE::CREATE)) { echo 'Add all files with no path param', PHP_EOL, print_r($zip->addPattern('/.*/'), True), PHP_EOL, 'Number of files : ', $zip->numFiles, PHP_EOL, 'Add all files in current path param', PHP_EOL, print_r($zip->addPattern('/.*/', '.'), True), PHP_EOL, 'Number of files : ', $zip->numFiles, PHP_EOL; $zip->close(); } Expected result: ---------------- Add all files with no path param Array ( [0] => .\25.BAT ... [88] => .\upxit.bat ) Number of files : 89 Add all files in current path param Array ( [0] => .\25.BAT ... [88] => .\upxit.bat ) Number of files : 178 Actual result: -------------- Add all files with no path param Number of files : 0 Add all files in current path param Array ( [0] => .\25.BAT ... [88] => .\upxit.bat ) Number of files : 89