PharData
PHP Manual

PharData::convertToTar

(No version information available, might be only in CVS)

PharData::convertToTar — Convert a zip archive to the tar file format

Description

bool PharData::convertToTar ( string $extension )

This method is used to convert a phar archive in phar or zip format to the tar file format.

Parameters

extension

By default, the extension is .tar for converting from zip archives.

Return Values

The method returns a PharData object on success and throws an exception on failure.

Errors/Exceptions

This method throws BadMethodCallException when unable to compress, an unknown compression method has been specified, 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 tar creation process.

Examples

Example#1 A PharData::convertToTar() example

Using PharData::convertToTar():

<?php
try {
    
$zip = new PharData('myphar.zip');
    
$tar $zip->convertToTar();
} catch (
Exception $e) {
    
// handle the error here
}
?>

See Also


PharData
PHP Manual