PHP Doku:: Returns the actual size of the file (with compression) inside the Phar archive - pharfileinfo.getcompressedsize.html

Verlauf / Chronik / History: (2) anzeigen

Sie sind hier:
Doku-Startseite ≥ PHP-Handbuch ≥ Funktionsreferenz ≥ Erweiterungen zur Datenkompression und Archivierung ≥ Phar ≥ The PharFileInfo class ≥ PharFileInfo::getCompressedSize

Ein Service von Reinhard Neidl - Webprogrammierung.

The PharFileInfo class

<<PharFileInfo::getCRC32

PharFileInfo::getMetaData>>

PharFileInfo::getCompressedSize

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

PharFileInfo::getCompressedSize — Returns the actual size of the file (with compression) inside the Phar archive

Beschreibung

int PharFileInfo::getCompressedSize ( void )

This returns the size of the file within the Phar archive. Uncompressed files will return the same value for getCompressedSize as they will with filesize()

Rückgabewerte

The size in bytes of the file within the Phar archive on disk.

Beispiele

Beispiel #1 A PharFileInfo::getCompressedSize() example

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

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

2

Siehe auch


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)