Warning: file_put_contents(): Only -1 of 66 bytes written, possibly out of free disk space in /var/www/html/index.php on line 3

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 23

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 24

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 25
PharFileInfo->isCompressedBZIP2 PharFileInfo->isCRCChecked phar PHP Manual PharFileInfo->isCompressedGZ (PECL phar:1.0.0-1.2.1) PharFileInfo->isCompressedGZ — Returns whether the entry is compr...
Forum und email

PharFileInfo->isCompressedGZ

(PECL phar:1.0.0-1.2.1)

PharFileInfo->isCompressedGZ — Returns whether the entry is compressed using gz

Description

bool PharFileInfo->isCompressedGZ ( void )

This returns whether a file is compressed within a Phar archive with Gzip compression.

Return Values

TRUE if the file is compressed within the Phar archive using Gzip, FALSE if not.

Voorbeelden

Example#1 A PharFileInfo->isCompressedGZ() example

<?php
try {
    
$p = new Phar('/path/to/my.phar'0'my.phar');
    
$p['myfile.txt'] = 'hi';
    
$p['myfile2.txt'] = 'hi';
    
$p['myfile3.txt'] = 'hi';
    
$p['myfile2.txt']->setCompressedGZ();
    
$p['myfile3.txt']->setCompressedBZIP2();
    
$file $p['myfile.txt'];
    
$file2 $p['myfile2.txt'];
    
$file3 $p['myfile3.txt'];
    
var_dump($file->isCompressedGZ());
    
var_dump($file2->isCompressedGZ());
    
var_dump($file3->isCompressedGZ());
} catch (
Exception $e) {
    echo 
'Create/modify on phar my.phar failed: '$e;
}
?>

Het resultaat van dit script is als volgt:

bool(false)
bool(true)
bool(false)