Phar::decompress

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

Phar::decompressDecompresses the entire Phar archive

Beschreibung

public Phar::decompress(?string $extension = null): ?Phar

Hinweis:

Diese Methode des Phar-Objekts funktioniert nur wenn die php.ini-Einstellung phar.readonly auf 0 gesetzt ist, sonst wird eine PharException geworfen.

For tar-based and phar-based phar archives, this method decompresses the entire archive.

For Zip-based phar archives, this method fails with an exception. The zlib extension must be enabled to decompress an archive compressed with gzip compression, and the bzip2 extension must be enabled in order to decompress an archive compressed with bzip2 compression. As with all functionality that modifies the contents of a phar, the phar.readonly INI variable must be off in order to succeed.

In addition, this method automatically changes the file extension of the archive, .phar by default for phar archives, or .phar.tar for tar-based phar archives. Alternatively, a file extension may be specified with the second parameter.

Parameter-Liste

extension

For decompressing, the default file extensions are .phar and .phar.tar. Use this parameter to specify another file extension. Be aware that all executable phar archives must contain .phar in their filename.

Rückgabewerte

A Phar object is returned on success, and null on failure.

Fehler/Exceptions

Throws BadMethodCallException if the phar.readonly INI variable is on, the zlib extension is not available, or the bzip2 extension is not enabled.

Changelog

Version Beschreibung
8.0.0 extension is now nullable.

Beispiele

Beispiel #1 A Phar::decompress() example

<?php
$p 
= new Phar('/path/to/my.phar'0'my.phar.gz');
$p['myfile.txt'] = 'hi';
$p['myfile2.txt'] = 'hi';
$p3 $p2->decompress(); // creates /path/to/my.phar
?>

Siehe auch

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Grundlagen von Views in MySQL

Views in einer MySQL-Datenbank bieten die Möglichkeit, eine virtuelle Tabelle basierend auf dem Ergebnis einer SQL-Abfrage zu erstellen. ...

admin

Autor : admin
Kategorie: mySQL-Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

Daten einer Abfrage mit Hilfe von Thumbnails nebeneinander ausgeben

Da ich viele unterschiedliche Tabellen benötige mache ich das so umständlich. Aber ist das der Grund warum das Floaten nicht funktioniert?

Geschrieben von Malchor am 17.05.2024 17:15:03
Forum: PHP Developer Forum
Daten einer Abfrage mit Hilfe von Thumbnails nebeneinander ausgeben

Du möchtest dir bestimmt mal ansehen, wie eine HTML-Tabelle richtig aufgebaut wird: https://www.w3schools.com/tags/tag_th.asp align solltest du ...

Geschrieben von scatello am 17.05.2024 17:12:34
Forum: PHP Developer Forum
Daten einer Abfrage mit Hilfe von Thumbnails nebeneinander ausgeben

Guten Tag zusammen, ich habe hier schon mal geschaut, bin aber Tatsache nicht schlau geworden. Ich möchte gerne Daten aus der DB abfragen und d ...

Geschrieben von Malchor am 17.05.2024 16:59:31
Forum: PHP Developer Forum
Buch über PHP, CSS und MySQL

As technology advances, so do the features of TPE sex dolls (https://www.bestrealdoll.com/collections/tpe-sex-dolls). Manufacturers now utilize st ...

Geschrieben von Nancyfrankflower am 17.05.2024 11:21:03
Forum: Bücher-Forum