Download the PHP package request-interop/interface without Composer

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

Request-Interop Standard Interface Package

Request-Interop provides an interoperable package of standard interfaces for encapsulating readable server-side request values in PHP 8.4 or later, in order to reduce the global mutable state problems that exist with PHP superglobals. It reflects, refines, and reconciles the common practices identified within several pre-existing projects.

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 (RFC 2119, RFC 8174).

Interfaces

Request-Interop defines the following interfaces:

RequestStruct

RequestStruct represents the current request values and input stream.

RequestStruct Properties

RequestStructFactory

RequestStructFactory affords creating a new RequestStruct instance for the current request.

RequestStructFactory Methods

RequestThrowable

Throwable to mark an Exception as request-related. It adds no class members.

RequestTypeAliases

RequestTypeAliases provides custom PHPStan types to aid static analysis.

Implementations

Implementations advertised as readonly or immutable MUST be deeply readonly or immutable. With the exception of StringableStream implementations meeting the specified readonly or immutable conditions, they MUST NOT encapsulate any references, resources, mutable objects, objects or arrays encapsulating references or resources or mutable objects, and so on.

Implementations MAY define additional class members not specified in these interfaces; implementations advertised as readonly or immutable MUST make those additional class members deeply readonly or immutable.

Notes:

Q & A

Why is RequestStruct not identical to a client-side request interface?

None of the researched projects model their request objects that way.

A more general answer is from Fowler in Patterns of Enterprise Application Architecture (2003, p 21):

... I think there is a good distinction to be made between an interface that you provide as a service to others and your use of someone else's service. ... I find it beneficial to think about these differently because the difference in clients alters the way you think about the service.

Request-Interop attempts to model an interface that uses a request received from an external source, not one that provides a request for sending.

How is Request-Interop different from PSR-7 ServerRequestInterface?

In short:

A longer answer is at README-PSR-7.md.

How is Request-Interop different from the Server-Side Request and Response Objects RFC?

This package is an intellectual descendant of that RFC, similar in form but much reduced in scope: only the superglobal-equivalent arrays, the method string, the URI, and the uploads properties remain.

Why is there a separate RequestStructFactory ?

Of the 16 researched projects, only 3 provide a separate factory class. The remainder provide either a static factory method on the request object itself, or use only new for creating a request object.

However, the Request-Interop request interface is modeled as a struct, meaning it can have no methods, only properties.

As such, even though the use of a factory class is decidedly the minority position, Request-Interop asserts that it is the more suitable choice here.

Further, Request-Interop opines that a separate factory interface better separates the concern of creating or building the RequestStruct using the superglobals and related environment elements.



All versions of interface with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
stream-interop/interface Version 1.x@dev
upload-interop/interface Version 1.x@dev
uri-interop/interface Version 1.x@dev
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 request-interop/interface contains the following files

Loading the files please wait ...