Warning: file_put_contents(): Only -1 of 58 bytes written, possibly out of free disk space in /var/www/html/index.php on line 3

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 23

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 24

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 25
Phar::apiVersion Phar::canWrite phar PHP Manual Phar::canCompress (PECL phar:1.0.0-1.2.1) — Returns whether extension supports compression using either zlib or bzip2 Descrierea bool ([ int $type ...
Forum und email

Phar::canCompress

(PECL phar:1.0.0-1.2.1)

Phar::canCompress — Returns whether phar extension supports compression using either zlib or bzip2

Descrierea

bool Phar::canCompress ([ int $type ] )

This should be used to test whether compression is possible prior to loading a phar archive containing compressed files.

Parametri

type

Either Phar::GZ or Phar::BZ2 can be used to test whether compression is possible with a specific compression algorithm (zlib or bzip2).

Valorile întroarse

TRUE if compression/decompression is available, FALSE if not.

Exemple

Example#1 A Phar::canCompress() example

<?php
if (Phar::canCompress()) {
    echo 
file_get_contents('phar://compressedphar.phar/internal/file.txt');
} else {
    echo 
'no compression available';
}
?>

Vedeţi de asemenea