array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'pharfileinfo.getcompressedsize.php', 1 => 'PharFileInfo::getCompressedSize', 2 => 'Returns the actual size of the file (with compression) inside the Phar archive', ), 'up' => array ( 0 => 'class.pharfileinfo.php', 1 => 'PharFileInfo', ), 'prev' => array ( 0 => 'pharfileinfo.getcrc32.php', 1 => 'PharFileInfo::getCRC32', ), 'next' => array ( 0 => 'pharfileinfo.getcontent.php', 1 => 'PharFileInfo::getContent', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/phar/PharFileInfo/getCompressedSize.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

PharFileInfo::getCompressedSize

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

PharFileInfo::getCompressedSizeReturns the actual size of the file (with compression) inside the Phar archive

Beschreibung

public PharFileInfo::getCompressedSize(): int

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()

Parameter-Liste

Diese Funktion besitzt keine Parameter.

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