Back to index

php5  5.3.10
write2.phar.inc
Go to the documentation of this file.
00001 <?php
00002 
00003 $fname = dirname(__FILE__) . '/write2.phar';
00004 @unlink($fname);
00005 
00006 $phar = new Phar($fname);
00007 $phar->setStub('<?php
00008 $phar = new Phar(__FILE__);
00009 var_dump($phar->getMetadata());
00010 mkdir("phar://" . __FILE__ . "/test");
00011 var_dump(is_dir("phar://" . __FILE__ . "/test"));
00012 $phar2 = new Phar(__FILE__);
00013 var_dump($phar2->getMetadata());
00014 var_dump(isset($phar["test"]));
00015 var_dump(isset($phar2["test"]));
00016 echo "ok\n";
00017 __HALT_COMPILER();
00018 ?>');
00019 $phar->setMetadata('hi');
00020 $phar['test.txt'] = "hi
00021 ";
00022 $phar['test.txt']->setMetadata('hi');
00023 ?>