PharFileInfo::getCRC32

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

PharFileInfo::getCRC32Returns CRC32 code or throws an exception if CRC has not been verified

说明

public PharFileInfo::getCRC32 ( void ) : int

This returns the crc32() checksum of the file within the Phar archive.

返回值

The crc32() checksum of the file within the Phar archive.

错误/异常

Throws BadMethodCallException if the file has not yet had its CRC32 verified. This should be impossible with normal use, as the CRC is verified upon opening the file for reading or writing.

范例

Example #1 A PharFileInfo::getCRC32() example

<?php
try {
    
$p = new Phar('/path/to/my.phar'0'my.phar');
    
$p['myfile.txt'] = 'hi';
    
$file $p['myfile.txt'];
    echo 
$file->getCRC32();
} catch (
Exception $e) {
    echo 
'Write operations on my.phar.phar failed: '$e;
}
?>

以上例程会输出:

3633523372

相关文章
php sqlite 函数 returns whether or not a previous row is availablephp intlchar check if code point is a base characterphp intlchar check if code point is punctuation characterphp mongocommandcursor checks if there are results that have not yet been sent from the databasephp mongocursor checks if there are results that have not yet been sent from the databasephp mongocursorinterface checks if there are results that have not yet been sent from the databasephp mongodb driver exception runtimeexception returns whether an error label is associated with an exceptionphp mongodb driver exception writeexception returns the writeresult for the failed write operationphp phar returns phar gz or phar bz2 if the entire phar archive is compressed .tar.gz/tar.bz and so on php pharfileinfo returns crc32 code or throws an exception if crc has not been verifiedphp pharfileinfo returns the phar file entry flagsphp pharfileinfo returns whether file entry has had its crc verifiedphp solrquery returns true if grouping is enabledphp solrquery returns whether or not the query will be boosted by the interesting term relevancephp swffont returns the ascent of the font or 0 if not availablephp swffont returns the descent of the font or 0 if not availablephp swffont returns the leading of the font or 0 if not availablephp swftext returns the ascent of the current font at its current size or 0 if not availablephp swftext returns the descent of the current font at its current size or 0 if not availablephp swftext returns the leading of the current font at its current size or 0 if not available
关注编程学问公众号