downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Phar::isFileFormat> <Phar::isBuffering
[edit] Last updated: Wed, 19 Jun 2013

view this page in

Phar::isCompressed

(PHP >= 5.3.0, PECL phar >= 2.0.0)

Phar::isCompressedRetourne Phar::GZ ou PHAR::BZ2 si l'archive entière est compressée (.tar.gz/tar.bz, etc)

Description

mixed Phar::isCompressed ( void )

Note:

Cette méthode nécessite que la variable de configuration INI phar.readonly soit définie à 0 pour fonctionner avec les objets Phar. Sinon, une exception PharException sera lançée.

Retourne Phar::GZ ou PHAR::BZ2 si l'archive entière est compressée (.tar.gz/tar.bz, etc). Les archives phar basées sur Zip ne peuvent pas être compressées en tant que fichier, et cette méthode retournera toujours FALSE si une archive phar basée sur Zip est interrogée.

Liste de paramètres

Aucun paramètre.

Valeurs de retour

Phar::GZ, Phar::BZ2 ou FALSE

Exemples

Exemple #1 Exemple avec Phar::isCompressed()

<?php
try {
    
$phar1 = new Phar('monphar.zip.phar');
    
var_dump($phar1->isCompressed());
    
$phar2 = new Phar('monpharnoncompresse.tar.phar');
    
var_dump($phar2->isCompressed());
    
$phar2->compressAllFilesGZ();
    
var_dump($phar2->isCompressed() == Phar::GZ);
} catch (
Exception $e) {
}
?>

L'exemple ci-dessus va afficher :

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

Voir aussi



add a note add a note User Contributed Notes Phar::isCompressed - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites