From: Marcus Boerger Date: Tue, 13 Feb 2007 00:19:00 +0000 (+0000) Subject: - MFH Add new example X-Git-Tag: php-5.2.2RC1~417 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5026a9fd83a6c22f231a70208743d9ed61019e22;p=php - MFH Add new example --- diff --git a/ext/spl/examples/phar_from_dir.php b/ext/spl/examples/phar_from_dir.php new file mode 100755 index 0000000000..2972748915 --- /dev/null +++ b/ext/spl/examples/phar_from_dir.php @@ -0,0 +1,53 @@ + \ [\] + * + * Create phar archive \ using entries from \ that + * optionally match \. + */ + +if ($argc < 3) +{ + echo << 3) +{ + $dir = new RegexIterator($dir, '/'.$argv[3].'/'); +} + + +$cwd .= DIRECTORY_SEPARATOR; + +$phar->begin(); + +foreach($dir as $file) +{ + echo "$file\n"; + copy($file, "phar://newphar/$file"); +} + +$phar->commit(); + +?> \ No newline at end of file