Download the PHP package umber/http without Composer

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

Umber HTTP

A series of light weight abstractions around crafting HTTP responses.

Master Develop
Build Status Build Status

Installation

The package can be installed through composer through Packagist:

Please anchor the version to 2.x as version 1.x is not supported anymore.

Usage

A HTTP response is represented by an implementation of HttpResponseInterface. These classes implement basic concepts of a HTTP response and can be used to compile a valid response for use OR can be converted to your framework of choice.

The following classes are at its core:

Basic implementations of these classes exist:

Currently the only format this package supports out of the box is json. This is not a design limitation but because the package was originally designed with an API focus. For working with json the following classes are available:

Abstractions around the following API concepts are also implemented:

Serialization

For requests that are used in API context you may want to invoke a serializer. This package does not provide a serialization implementation but an abstraction to interact with one of your choice.

A HttpResponseInterface tailored for serialization is provided:

This response requires an instance of HttpResponseSerializerInterface is provided along with any serialization groups. The data given to the response is the raw data to be serialized. When the response is used to get the body it will serialize the data at that point.

NOTE, when using JsonHttpResponseGenerator with a HttpResponseSerializerInterface provided it will automatically construct these SerializerHttpResponse classes for you.

Serialization is done just in time and therefore will not be represented as a performance hit within your controllers. This is done so that responses can be intercepted and changed without wasting compute on serializing data that is not needed.

Pagination

For requests that are used in API context you may want to invoke a paginator. This package does not provide a pagination implementation but an abstraction to interact with one of your choice.

A HttpResponseInterface should not accept a paginator as it's data. However a PaginatiorAwareHttpResponseInterface will.

Because of this the following responses are available (and should be used as example for adding other types):

Responses that are paginator aware should make use of the PagiantorResponseHelper and follow the example of the JsonPaginatorHttpResponse. These responses will initialise 4 new headers when the paginator is invoked.

Paginator aware responses should be automatically constructed when given to the *Factory of your choice. As the *Generator will often use the *Factory this class also accepts paginator's. For example giving a paginator to the JsonHttpResponseFactory (or JsonHttpResponseGenerator) will return a JsonPaginatorHttpResponse.

Frameworks

Currently I have a bundle for Symfony that defines all the classes as services. Controllers are allowed to return instances of HttpResponseInterface and they will be transformed in to Symfony Request objects.

Simply use the following bundle:

The configuration is optional, but to define a serializer implementation use the following methods to provide link to the service you wish to use.


All versions of http with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
ext-json Version *
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 umber/http contains the following files

Loading the files please wait ...