--TEST-- Phar::startBuffering()/setStub()/stopBuffering() zip-based --SKIPIF-- --INI-- phar.readonly=0 --FILE-- isFileFormat(Phar::ZIP)); //var_dump($p->getStub()); var_dump($p->isBuffering()); $p->startBuffering(); var_dump($p->isBuffering()); $p['a.php'] = 'setStub(''); include 'phar://brandnewphar.phar/a.php'; var_dump($p->getStub()); $p['b.php'] = 'setStub('getStub()); $p->stopBuffering(); echo "===COMMIT===\n"; var_dump($p->isBuffering()); include 'phar://brandnewphar.phar/a.php'; include 'phar://brandnewphar.phar/b.php'; var_dump($p->getStub()); // add portion to test setting stub from resource file_put_contents(dirname(__FILE__) . '/myfakestub.php', ''); $a = fopen(dirname(__FILE__) . '/myfakestub.php', 'rb'); $p->setStub($a); var_dump($p->getStub()); $c = strlen(''); file_put_contents(dirname(__FILE__) . '/myfakestub.php', '' . 'extra stuff'); fseek($a, 0); $p->setStub($a, $c); var_dump($p->getStub()); fclose($a); ?> ===DONE=== --CLEAN-- --EXPECT-- bool(true) bool(false) bool(true) string(5) "Hello" string(84) " " string(5) "World" string(85) " " ===COMMIT=== bool(false) string(5) "Hello" string(5) "World" string(85) " " string(93) " " string(93) " " ===DONE===