Download the PHP package proteins/response without Composer

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

Protein | Response

The response module wrap and handles the payload sended to the request agent.

Install


Require the class via :

Appending data to the response


Append a string to the response buffer via the add method.

Changing the content type


The type method accepts a MIME type string (or a Response::TYPE_* constant) for the body content type.

Adding an header to the response


The header($name, $value) method set an header for being sended to the request agent.

Get all defined headers


Get response body


Set the entire response body


You can set the entire response body by passing a parameter to the body method.

Set the HTTP response status


You can set the HTTP response status with the status method.

The error($code, $message='') method is used to pass errors.

This method triggers the core.response.error event.

Force download of response body


You can force download of response body with download method passing filename as parameter. Pass a falsy value to disable download.

Download method support also array as parameter with raw string data.

HTTP/2 Server Push


The HTTP/Server Push support is enabled via the push method.
If you have a list of resource links to be pushed in the next Response::send you can pass the URI and the resource type as defined in the W3C Preload Draft

If you don't pass resource type as a second parameter the code will be guess from the extension, however is better (faster) to specify the resource type (for the as parameter of the preload header format).

The current auto-discovered resource types are :

Extensions Type
js script
css style
woff,woff2,ttf,eof font
png,svg,gif,jpg image
other text

Multiple resources can be passed to a single push call via an array :

and as the same as the direct call version you can define resource types via array-keys :


All versions of response with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
proteins/event Version ^1.0.0
proteins/filter Version ^1.0.0
proteins/options Version ^1.0.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 proteins/response contains the following files

Loading the files please wait ....