ziparchive.addglob(3) php man page | unix.com

Man Page: ziparchive.addglob

Operating Environment: php

Section: 3

ZIPARCHIVE.ADDGLOB(3)							 1						     ZIPARCHIVE.ADDGLOB(3)

ZipArchive::addGlob - Add files from a directory by glob pattern

SYNOPSIS
bool ZipArchive::addGlob (string $pattern, [int $flags], [array $options = array()])
DESCRIPTION
Add files from a directory which match the glob $pattern.
PARAMETERS
o $pattern - A glob(3) pattern against which files will be matched. o $flags - A bit mask of glob() flags. o $options - An associative array of options. Available options are: o "add_path" Prefix to prepend when translating to the local path of the file within the archive. This is applied after any remove operations defined by the "remove_path" or "remove_all_path" options. o "remove_path" Prefix to remove from matching file paths before adding to the archive. o "remove_all_path" TRUE to use the file name only and add to the root of the archive.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1 ZipArchive::addGlob example Add all php scripts and text files from current working directory <?php $zip = new ZipArchive(); $ret = $zip->open('application.zip', ZipArchive::OVERWRITE); if ($ret !== TRUE) { printf('Failed with code %d', $ret); } else { $options = array('add_path' => 'sources/', 'remove_all_path' => TRUE); $zip->addGlob('*.{php,txt}', GLOB_BRACE, $options); $zip->close(); } ?>
SEE ALSO
ZipArchive::addFile, ZipArchive::addPattern. PHP Documentation Group ZIPARCHIVE.ADDGLOB(3)
Related Man Pages
zipgrep(1l) - mojave
ziparchive(3) - php
phardata.extractto(3) - php
ziparchive.open(3) - php
phar.extractto(3) - php
Similar Topics in the Unix Linux Community
Looping on a list of files...
Listing files containing a pattern!
Finding a text file from a group of zip files without unzipping
Finding file extension on C Shell script
Match partial text