(No version information available, might be only in CVS)
Phar::convertToZip — Convert the phar archive to the zip file format
Note: This method requires the php.ini setting phar.readonly to be set to 0 in order to work for Phar objects. Otherwise, a PharException will be thrown.
This method is used to convert a phar archive in phar or tar format to the zip file format.
No parameters are accepted.
This method throws BadMethodCallException when the requested archive is buffering with Phar::startBuffering() and has not concluded with Phar::stopBuffering(), an UnexpectedValueException if write support is disabled, and a PharException if any problems are encountered during the phar creation process.
Example#1 A Phar::convertToZip() example
Using Phar::convertToZip():
<?php
try {
$phar = new Phar('myphar.phar');
// convert it to the zip file format
$phar->convertToZip();
$phar->setStub('<?php Phar::webPhar("myphar.phar", "web/index.php");
include "phar://" . __FILE__ . "/cli.php";
__HALT_COMPILER();');
} catch (Exception $e) {
// handle the error here
}
?>