--TEST-- Phar::setStub() (zip-based) --SKIPIF-- --INI-- phar.require_hash=0 phar.readonly=0 --FILE-- setStub(''); $p['a'] = 'a'; $p['b'] = 'b'; $p['c'] = 'c'; copy($fname2, $fname); $phar = new Phar($fname); echo $phar->getStub(); $file = ''; //// 2 $phar->setStub($file); echo $phar->getStub(); $fname3 = __DIR__ . '/' . basename(__FILE__, '.php') . '.phartmp.php'; $file = ''; $fp = fopen($fname3, 'wb'); fwrite($fp, $file); fclose($fp); $fp = fopen($fname3, 'rb'); //// 3 $phar->setStub($fp); fclose($fp); echo $phar->getStub(); $fp = fopen($fname3, 'ab'); fwrite($fp, 'booya'); fclose($fp); echo file_get_contents($fname3) . "\n"; $fp = fopen($fname3, 'rb'); //// 4 $phar->setStub($fp, strlen($file)); fclose($fp); echo $phar->getStub(); $phar['testing'] = 'hi'; echo $phar->getStub(); ?> ===DONE=== --CLEAN-- --EXPECT-- booya ===DONE===