Back to index

php5  5.3.10
write6.phar.inc
Go to the documentation of this file.
00001 <?php
00002 
00003 $fname = dirname(__FILE__) . '/write6.phar';
00004 @unlink($fname);
00005 
00006 $phar = new Phar($fname);
00007 $phar->setStub('<?php
00008 $phar = new Phar(__FILE__);
00009 $d = dirname(__FILE__) . "/copyonwrite6";
00010 mkdir($d);
00011 file_put_contents($d . "/file1", "file1\n");
00012 file_put_contents($d . "/file2", "file2\n");
00013 $arr = $phar->buildFromIterator(new RecursiveDirectoryIterator($d, RecursiveDirectoryIterator::SKIP_DOTS),$d);
00014 $arr = $phar->buildFromDirectory($d);
00015 ksort($arr);
00016 var_dump($arr);
00017 $phar2 = new Phar(__FILE__);
00018 $arr = array();
00019 foreach ($phar2 as $name => $file) {
00020        $arr[$name] = $file->getContent();
00021 }
00022 ksort($arr);
00023 foreach ($arr as $name => $content) {
00024        echo $name, " ", $content;
00025 }
00026 echo "ok\n";
00027 __HALT_COMPILER();
00028 ?>');
00029 $phar['hi'] = "hi\n";
00030 ?>