Download the PHP package front-interop/interface without Composer

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

Front-Interop Standard Interface Package

PDS Skeleton PDS Composer Script Names

Front-Interop provides an interoperable package of standard interfaces for front controller functionality in any execution context (HTTP, CLI, etc.). 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).

This package attempts to adhere to the Package Development Standards approach to naming and versioning.

Interfaces

This package defines the following interfaces:

FrontController

FrontController affords an entry point into the outermost presentation layer in any execution context (HTTP, CLI, etc.).

FrontController Methods

FrontTypeAliases

FrontTypeAliases provides custom PHPStan types to aid static analysis.

Implementations

Implementations MAY define additional class members not defined in these interfaces.

Notes:

Q & A

Why run()?

The researched projects use one of six verbs for the front controller's main method: dispatch(), execute(), handle(), __invoke(), run(), or start(). Of these, run() is the clear majority at 12 of 23 projects; the remaining five verbs together account for the other 11. Front-Interop follows the majority practice.

Why does run() return int?

Of the 23 researched projects:

The majority of researched projects in an HTTP execution context have the front controller handle response-sending itself and return nothing.

However, Front-Interop observes that a front controller in a different execution context may need to return an integer exit status code to its caller or parent process. These contexts include, among others:

While providing two interfaces (one to return void and another to return int) would cover both cases, it leads to inconsistencies in setup and expectations.

Thus, contra the most common void or null return, Front-Interop directs that run() returns an integer exit status code. This is an unusual practice for front controllers in an HTTP execution context, but imposes only a trivial implementation burden. Doing so allows the same interface to be used across many different execution contexts, and keeps the interface machine-friendly.

Why handle all Throwables?

Of the 23 researched projects, 21 handle exceptions in some way. The specific handling location varies between projects: 4 in the bootstrap, 2 in the front controller itself, and the remainder somewhere deeper in the call stack. For that remainder, either the bootstrap or the front controller defines or registers the handling logic.

Of the 21 projects that handle exceptions, 19 handle all types of Throwable, 1 handles all types of Exception, and 1 handles only specific exception subtypes.

Front-Interop observes that a front controller invocation occurs at the outermost boundary of the presentation layer. This is the last point at which any uncaught Throwables may be handled gracefully. The choice then is whether they are handled by the bootstrap script, or by the front controller proper.

In the interest of keeping such handling within a class, Front-Interop directs that FrontController itself must act as (or delegate to) a final backstop against Throwables. There may be other handling subsystems in the logic called by the FrontController, but any Throwable that escapes them will be handled by the FrontController or its delegate.



All versions of interface with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
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 front-interop/interface contains the following files

Loading the files please wait ...