Download the PHP package f3-factory/fatfree-psr7-factory without Composer

On this page you can find all versions of the php package f3-factory/fatfree-psr7-factory. 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 fatfree-psr7-factory

HTTP Message plugin for PHP Fat-Free Framework

This is a plugin to enable PSR-7 HTTP message usage by the framework core.

In order to do so, this package can register any PSR-17 compatible HTTP message factory to the frameworks' core dependency injection container, that can be used to create and hydrate a Request (or ServerRequest) object from current framework globals, so it can be consumed by the route-handling controller or any other package.

Installation

This plugin requires:

To install this package run:

Register factory service

The HTTP message objects (PSR-7) are created by a related PSR-17 factory.

At first, we need to register the PSR-17 factories for every PSR-7 interface. Some PSR-17 packages have different factories for each interface, some share the same for all of them.

This example uses the Psr17Factory from our own fatfree-psr7 package, which is very fast and of course fat-free.

To install it run composer require f3-factory/fatfree-psr7 OR install any other PSR-7 and PSR-17 package you'd like to use instead.

In your bootstrap code or front controller (i.e. index.php):

NB: Instead of the code above, you can use this included shortcut, which will execute the same sequence for you, but it only works with our own fatfree-psr7 package:

Registering the RequestInterface, ServerRequestInterface and ResponseInterface bindings will tell the dependency injection container which shortcut to use to resolve and hydrate the objects accordingly when you type-hinting them in your route controller.

This is essential to make the created request objects use the provided make methods by this factory in order to hydrate the objects with the actual data prepared by the framework. Requests use makeRequest/makeServerRequest and are filled with the currently available data from the F3 hive and SERVER globals. The Response factory will check for an existing response object in the RESPONSE hive variable and uses that instead to ensure you can pass the response between middlewares, route handlers or any other runtime services via dependency injection. You should return this object in route/middleware handlers, so the framework can care about the rest.

Usage

You can receive the Request and Response objects from any point now, i.e. from route handlers via auto-injection:

Alternatively you can create a new request object anywhere manually. These are going to be hydrated from the currently available $_SERVER and hive data via:

Response and the other classes should be instantiated via the PSR17 factory directly and do not need any special treatment by the framework core.

Move uploaded files

This is an example how to use the ServerRequest object to move an uploaded file.

For more usage examples see original PSR Http message readme:


All versions of fatfree-psr7-factory with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
bcosca/fatfree-core Version ^4.0
psr/http-message Version ^1.1 || ^2.0
psr/http-factory 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 f3-factory/fatfree-psr7-factory contains the following files

Loading the files please wait ...