Download the PHP package moudarir/downloader without Composer

On this page you can find all versions of the php package moudarir/downloader. 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 downloader

Downloader

Latest Version Tests PHP Version Require License

A lightweight and modern PHP library for streaming files and in-memory data with full support for HTTP conditional requests and byte range requests.

Features

Requirements

Installation

Usage

$mime accepts:

  • null to automatically detect the MIME type from the file contents.
  • Or, a MimeType enum.

Download a file

Download with a custom filename

Inline response

Partial content / Range requests

ResponseAction::PARTIAL enables HTTP Range request handling, including:

For browser-based media playback, use ResponseAction::PARTIAL together with inline().

Download from data

Server-side file delivery

For files, the response can be delegated to the web server using X-Sendfile or X-Accel-Redirect.

Apache – X-Sendfile

Nginx – X-Accel-Redirect

X-Accel-Redirect uses an internal URI configured for the web server. It is not required to be the physical filesystem path.

Server-side response actions are only available for file resources.

Download configuration

Download behavior can be customized through DownloadConfig.

The configuration options are:

Action Default Description
withLimitRate() DownloadConfig::BYTES_PER_SECOND (0 = unlimited) Sets the maximum download rate in bytes per second.
withChunkSize() DownloadConfig::CHUNK_SIZE (128 KiB) Sets the stream read buffer size.
withMaxRangeItems() DownloadConfig::MAX_RANGE_ITEMS (10) Sets the maximum number of byte ranges accepted in a single HTTP Range request.

Invalid configuration values throw a DownloadException.

Response actions

Download::fromFile() and Download::fromData() accept a ResponseAction to explicitly define the response mode.

Available actions:

Action Description
ResponseAction::DEFAULT Standard response
ResponseAction::PARTIAL HTTP Range request handling
ResponseAction::X_SEND_FILE Delegate file delivery to the web server
ResponseAction::X_ACCEL_REDIRECT Delegate file delivery through Nginx X-Accel-Redirect

The resulting DownloadResponse must always be sent explicitly:

Response metadata

Download::fromFile() and Download::fromData() return a DownloadResponse instance.

Response metadata can be inspected before sending the response through DownloadResponse::metadata():

Available metadata includes:

ETag

ETag generation is mandatory.

The library automatically generates an ETag for every supported resource and uses it for HTTP conditional requests.

Available strategies:

A strategy can optionally be selected when creating a download:

If no strategy is specified, the library automatically selects the first strategy supported by the resource.

The selected strategy must be supported by the resource. Otherwise, the library throws a DownloadException exception.

HTTP Features

The library automatically supports:

Conditional request evaluation follows the precedence defined by RFC 9110.

If-Range supports both strong ETag comparison and HTTP-date comparison.

HTTP-date parsing supports the HTTP-date formats defined by RFC 9110.

HTTP Responses

The library supports the following response status codes:

412 Precondition Failed responses do not include representation headers such as Content-Type, Content-Disposition or the representation Content-Length.

License

MIT


All versions of downloader with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
moudarir/file 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 moudarir/downloader contains the following files

Loading the files please wait ...