Download the PHP package selective/zip-responder without Composer

On this page you can find all versions of the php package selective/zip-responder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package zip-responder

selective/zip-responder

A ZIP responder (PSR-7).

Latest Version on Packagist Build Status Coverage Status Quality Score Total Downloads

Table of Contents

Requirements

Installation

Usage

Creating a new ZipResponder instance using the nyholm/psr7 Psr17Factory:

Creating a new ZipResponder instance using the slim/psr7 StreamFactory:

Sending a ZIP file

Send ZIP file to browser, force direct download:

Sending a ZIP file from a string

Sending a ZIP stream

Send ZIP stream to the browser, force direct download:

Sending a ZIP stream on the fly

Sending a file directly to the client is not intended according to the PSR-7 specification, but can still be realized with the help of a CallbackStream.

Sending a ZipArchive file

The ZIP extension enables you to transparently read or write ZIP compressed archives and the files inside them. A ZipArchive does not support "memory mapped files", like PHP streams. You can only access local files with ZipArchive. For this purpose, you can create a temporary file, or you can use an existing file from the filesystem.

Sending a ZipStream-PHP archive

ZipStream-PHP is a library for streaming dynamic ZIP files without writing to the disk. You can send the file directly to the user, which is much faster and improves testability.

Installation:

Creating and sending a ZIP file (only in-memory) to the browser:

Sending a ZIP-stream on the fly:

Sending a PhpZip archive

PhpZip is a library for extended work with ZIP-archives.

Installation:

Note, when you use the nelexa/zip component, you may not need the selective/zip-responder component because the nelexa/zip already provides its own PSR-7 responder.

Example

In case you want to keep your architecture more clean (SRP), you may use the selective/zip-responder responder to create and send a ZIP file to the browser as follows:

Slim 4 Integration

Create a DI container definition for: StreamFactoryInterface::class and ZipResponder::class

A nyholm/psr7 and PHP-DI example:

A slim/psr7 and PHP-DI example:

The responder should only be used within an action handler or middleware.

Action class example using dependency injection:

License

The MIT License (MIT). Please see License File for more information.


All versions of zip-responder with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3 || ^8.0
nyholm/psr7 Version ^1.4
psr/http-message Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package selective/zip-responder contains the following files

Loading the files please wait ....