2007-01-28 05:11:41 +00:00
|
|
|
--TEST--
|
2007-03-22 16:31:46 +00:00
|
|
|
Phar::setStub()/stopBuffering()
|
2007-01-28 05:11:41 +00:00
|
|
|
--SKIPIF--
|
2008-01-04 16:26:44 +00:00
|
|
|
<?php if (!extension_loaded("phar")) die("skip"); ?>
|
2007-01-28 05:11:41 +00:00
|
|
|
--INI--
|
|
|
|
phar.require_hash=0
|
|
|
|
phar.readonly=0
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
$p = new Phar(dirname(__FILE__) . '/brandnewphar.phar', 0, 'brandnewphar.phar');
|
|
|
|
$p['file1.txt'] = 'hi';
|
2007-03-22 16:31:46 +00:00
|
|
|
$p->stopBuffering();
|
2008-02-20 14:28:49 +00:00
|
|
|
var_dump(strlen($p->getStub()));
|
2007-01-28 22:11:28 +00:00
|
|
|
$p->setStub("<?php
|
2007-01-28 05:40:18 +00:00
|
|
|
function __autoload(\$class)
|
2007-01-28 05:11:41 +00:00
|
|
|
{
|
2007-01-28 05:40:18 +00:00
|
|
|
include 'phar://' . str_replace('_', '/', \$class);
|
2007-01-28 05:11:41 +00:00
|
|
|
}
|
2007-01-28 05:40:18 +00:00
|
|
|
Phar::mapPhar('brandnewphar.phar');
|
|
|
|
include 'phar://brandnewphar.phar/startup.php';
|
2007-01-28 05:11:41 +00:00
|
|
|
__HALT_COMPILER();
|
|
|
|
?>");
|
|
|
|
var_dump($p->getStub());
|
|
|
|
?>
|
|
|
|
===DONE===
|
|
|
|
--CLEAN--
|
|
|
|
<?php
|
|
|
|
unlink(dirname(__FILE__) . '/brandnewphar.phar');
|
2008-01-18 05:42:16 +00:00
|
|
|
__HALT_COMPILER();
|
2007-01-28 05:11:41 +00:00
|
|
|
?>
|
2007-01-28 05:40:18 +00:00
|
|
|
--EXPECT--
|
2008-05-19 19:05:42 +00:00
|
|
|
int(6683)
|
2007-05-27 16:54:37 +00:00
|
|
|
string(200) "<?php
|
2007-01-28 05:40:18 +00:00
|
|
|
function __autoload($class)
|
|
|
|
{
|
|
|
|
include 'phar://' . str_replace('_', '/', $class);
|
|
|
|
}
|
|
|
|
Phar::mapPhar('brandnewphar.phar');
|
|
|
|
include 'phar://brandnewphar.phar/startup.php';
|
2007-05-27 16:54:37 +00:00
|
|
|
__HALT_COMPILER(); ?>
|
|
|
|
"
|
2007-01-28 05:40:18 +00:00
|
|
|
===DONE===
|