--TEST-- Phar::convertToZip|Tar|Phar() repeated (phar_based archives) --SKIPIF-- --INI-- phar.require_hash=0 phar.readonly=0 --FILE-- '; $file = $stub; $files = array(); $files['a'] = 'a'; $files['b'] = 'b'; $files['c'] = 'c'; include 'files/phar_test.inc'; echo "=================== new Phar() =======================\n"; $phar = new Phar($fname); var_dump($phar->isFileFormat(Phar::PHAR)); var_dump($phar->isFileFormat(Phar::TAR)); var_dump($phar->isFileFormat(Phar::ZIP)); var_dump($phar->getStub()); var_dump($phar->getAlias()); echo "================= convertToTar() =====================\n"; $phar = $phar->convertToExecutable(Phar::TAR); var_dump($phar->isFileFormat(Phar::PHAR)); var_dump($phar->isFileFormat(Phar::TAR)); var_dump($phar->isFileFormat(Phar::ZIP)); var_dump($phar->getStub()); var_dump($phar->getAlias()); echo "================= convertToZip() =====================\n"; $phar = $phar->convertToExecutable(Phar::ZIP); var_dump($phar->isFileFormat(Phar::PHAR)); var_dump($phar->isFileFormat(Phar::TAR)); var_dump($phar->isFileFormat(Phar::ZIP)); var_dump($phar->getStub()); var_dump($phar->getAlias()); echo "================= convertToPhar() ====================\n"; $phar = $phar->convertToExecutable(Phar::PHAR, Phar::NONE, '.2.phar'); var_dump($phar->isFileFormat(Phar::PHAR)); var_dump($phar->isFileFormat(Phar::TAR)); var_dump($phar->isFileFormat(Phar::ZIP)); var_dump(strlen($phar->getStub())); var_dump($phar->getAlias()); echo "================= convertToZip() =====================\n"; $phar = $phar->convertToExecutable(Phar::ZIP, Phar::NONE, '.2.phar.zip'); var_dump($phar->isFileFormat(Phar::PHAR)); var_dump($phar->isFileFormat(Phar::TAR)); var_dump($phar->isFileFormat(Phar::ZIP)); var_dump($phar->getStub()); var_dump($phar->getAlias()); echo "================= convertToTar() =====================\n"; $phar = $phar->convertToExecutable(Phar::TAR, Phar::NONE, '2.phar.tar'); var_dump($phar->isFileFormat(Phar::PHAR)); var_dump($phar->isFileFormat(Phar::TAR)); var_dump($phar->isFileFormat(Phar::ZIP)); var_dump($phar->getStub()); var_dump($phar->getAlias()); echo "================= convertToZip() =====================\n"; $phar = $phar->convertToExecutable(Phar::ZIP, Phar::NONE, '3.phar.zip'); var_dump($phar->isFileFormat(Phar::PHAR)); var_dump($phar->isFileFormat(Phar::TAR)); var_dump($phar->isFileFormat(Phar::ZIP)); var_dump($phar->getStub()); var_dump($phar->getAlias()); ?> --CLEAN-- --EXPECTF-- =================== new Phar() ======================= bool(true) bool(false) bool(false) string(48) "" string(3) "hio" ================= convertToTar() ===================== bool(false) bool(true) bool(false) string(60) "