45 if ($dh = opendir(
$dir))
49 while ((
$file = readdir($dh)) !==
false)
68 if( (!empty($zipdir)) && ($filenct==0))
72 $this->addEmptyDir(substr($zipdir, 0, -1));
87 if (!is_dir($p_folder)) {
88 throw new \Exception(
"ERR-ZE87");
91 $dir=opendir($p_folder);
92 if(
$dir==
false)
throw new \Exception(
"ERR-ZE90");
94 while( ($entry=readdir(
$dir)) !=
false) {
95 if ( preg_match($p_pattern, $entry)) {
96 if ( ! $this->addFile($p_folder .
"/" . $entry,$entry) )
97 throw new \Exception(
"ERR-EZ95 : cannot add $p_folder/$entry");
add_file_pattern( $p_folder, $p_pattern)
add file to the current file from a folder matching the pattern $p_pattern
add_recurse_folder($dir, $zipdir='')
Function to recursively add a directory, sub-directories and files to a zip archive.