Phar::convertToTar

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

Phar::convertToTar — Convert the phar archive to the tar file format, optionally compressing the entire archive using gzip or bzip2 compression

Описание

bool Phar::convertToTar ( int $compression )

Замечание: 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 zip format to the tar file format.

Список параметров

compression

This can be one of Phar::GZ or Phar::BZ2. By default, no compression is applied.

Возвращаемые значения

The method returns TRUE on success, but it is safer to encase the call within a try/catch block and assume success if an exception is not thrown.

Errors/Exceptions

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

Примеры

Пример #1 A Phar::convertToTar() example

Using Phar::convertToTar():

<?php
try {
    
$zip = new Phar('myphar.zip.phar');
    
$tar $zip->convertToTar();
    
$phar->setStub('<?php include "phar://" . __FILE__ . "/cli.php"; __HALT_COMPILER();');
} catch (
Exception $e) {
    
// handle the error here
}
?>

[an error occurred while processing the directive]

Коментарии

404 Not Found

404 Not Found


nginx

    Поддержать сайт на родительском проекте КГБ