2008-05-13 05:03:49 +08:00
|
|
|
--TEST--
|
|
|
|
Phar: fopen a .phar for writing (existing file)
|
|
|
|
--SKIPIF--
|
|
|
|
<?php if (!extension_loaded("phar")) die("skip"); ?>
|
|
|
|
--INI--
|
|
|
|
phar.readonly=0
|
|
|
|
phar.require_hash=0
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
|
|
|
|
$pname = 'phar://' . $fname;
|
|
|
|
$file = "<?php __HALT_COMPILER(); ?>";
|
|
|
|
|
|
|
|
$files = array();
|
|
|
|
$files['a.php'] = '<?php echo "This is a\n"; ?>';
|
|
|
|
$files['b.php'] = '<?php echo "This is b\n"; ?>';
|
|
|
|
$files['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
|
|
|
|
include 'files/phar_test.inc';
|
|
|
|
|
|
|
|
$fp = fopen($pname . '/b/c.php', 'wb');
|
2008-08-01 21:38:48 +08:00
|
|
|
fwrite($fp, b'extra');
|
2008-05-13 05:03:49 +08:00
|
|
|
fclose($fp);
|
|
|
|
include $pname . '/b/c.php';
|
|
|
|
?>
|
|
|
|
|
|
|
|
===DONE===
|
|
|
|
--CLEAN--
|
|
|
|
<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
|
|
|
|
--EXPECTF--
|
|
|
|
extra
|
|
|
|
===DONE===
|