Back to index

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