PHP Classes

File: libraries/vendor/league/flysystem/docs/adapter/zip-archive.md

Recommend this page to a friend!
  Classes of Duong Huynh Nghia   PHP Slim Framework 3 Modular Application   libraries/vendor/league/flysystem/docs/adapter/zip-archive.md   Download  
File: libraries/vendor/league/flysystem/docs/adapter/zip-archive.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: PHP Slim Framework 3 Modular Application
Create modular applications using Slim Framework
Author: By
Last change:
Date: 6 years ago
Size: 759 bytes
 

Contents

Class file image Download

layout: default permalink: /adapter/zip-archive/ title: ZipArchive Adapter

ZipArchive Adapter

Installation

composer require league/flysystem-ziparchive

Usage

use League\Flysystem\Filesystem;
use League\Flysystem\ZipArchive\ZipArchiveAdapter;

$filesystem = new Filesystem(new ZipArchiveAdapter(__DIR__.'/path/to/archive.zip'));

Force Save

When creating a new zip file it will only be saved at the end of the PHP request because the ZipArchive library relies on an internal __destruct method to be called. You can force the saving of the zip file before the end of the request by calling the close method on the archive through the adapter.

$filesystem->getAdapter()->getArchive()->close();