From 5026a9fd83a6c22f231a70208743d9ed61019e22 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Tue, 13 Feb 2007 00:19:00 +0000 Subject: [PATCH] - MFH Add new example --- ext/spl/examples/phar_from_dir.php | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 ext/spl/examples/phar_from_dir.php 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 -- 2.50.1