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

search for in the

PharFileInfo::getCompressedSize> <PharFileInfo::delMetadata
[edit] Last updated: Fri, 25 May 2012

view this page in

PharFileInfo::getCRC32

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

PharFileInfo::getCRC32Retourne le code CRC32 ou soulève une exception si le CRC n'a pas été vérifié

Description

int PharFileInfo::getCRC32 ( void )

Retourne la somme de contrôle crc32() du fichier au sein de l'archive Phar.

Valeurs de retour

La somme de contrôle crc32() du fichier au sein de l'archive Phar.

Erreurs / Exceptions

Soulève une exception BadMethodCallException si le CRC32 du fichier n'a pas encore été vérifié. Ceci n'arrive normalement pas, car le CRC est vérifié à l'ouverture du fichier en lecture ou en écriture.

Exemples

Exemple #1 Exemple avec PharFileInfo::getCRC32()

<?php
try {
    
$p = new Phar('/chemin/vers/mon.phar'0'mon.phar');
    
$p['monfichier.txt'] = 'salut';
    
$file $p['monfichier.txt'];
    echo 
$file->getCRC32();
} catch (
Exception $e) {
    echo 
'L'écriture de mon.phar.phar a échouée ', $e;
}
?>

L'exemple ci-dessus va afficher :

3633523372



add a note add a note User Contributed Notes PharFileInfo::getCRC32
There are no user contributed notes for this page.

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