(No version information available, might be only in CVS)
PharData::convertToZip — Convert a tar archive to the zip file format
This method is used to convert a phar archive in phar or tar format to the zip file format.
By default, the extension is .zip for converting from tar archives.
The method returns a PharData object on success and throws an exception on failure.
This method throws BadMethodCallException when the requested archive is buffering with PharData::startBuffering() and has not concluded with PharData::stopBuffering(), and a PharException if any problems are encountered during the zip creation process.
Example#1 A PharData::convertToZip() example
Using PharData::convertToZip():
<?php
try {
$tar = new PharData('myphar.tar.gz');
// convert it to the zip file format
$zip = $tar->convertToZip();
} catch (Exception $e) {
// handle the error here
}
?>