Download the PHP package bermudaphp/psr15factory without Composer

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

Bermuda PSR-15 Factory

Languages: Русский

A powerful and flexible factory for creating PSR-15 compatible middleware in PHP. Supports various types of middleware definitions, automatic dependency injection, request data mapping, and multiple middleware patterns.

Requirements

Installation

Quick Start

Basic Setup

Controller Example

Middleware Types

1. Class Name Strategy

Resolves middleware by class name from the container:

2. Callable Strategy

Automatically detects and adapts various callable patterns. Supports multiple callable formats through built-in CallableResolver:

Supported callable formats:

1. Closures

2. Standard PHP callables

3. String representations:

4. Arrays:

Middleware patterns (automatic detection):

Single-pass middleware
Double-pass middleware
Standard callable with DI

Factory Callable

For dynamic middleware creation using the container:

Examples with different formats:

3. Pipeline Strategy and MiddlewareGroup

For combining multiple middleware into a single pipeline:

Request Data Mapping

The factory supports automatic extraction and transformation of data from PSR-7 requests into method parameters using PHP 8+ attributes. This provides clean separation between HTTP data handling and business logic.

Query parameters

The #[MapQueryParameter] attribute extracts individual parameters from the query string:

Query string (complete parameter set)

The #[MapQueryString] attribute extracts all query parameters with optional field renaming:

Request payload (request body)

The #[MapRequestPayload] attribute extracts data from request body (JSON, form data, XML):

Request attributes

The #[RequestAttribute] attribute extracts data set by previous middleware:

Combining different data sources

Mapping error handling

Configuration and DI container

Complex example with configuration

Advanced Usage

Creating custom strategy

Configuration through container

Error handling

Architecture

Main components

Execution flow

  1. Middleware resolution - Factory tries strategies in order
  2. Adaptation - Converting to PSR-15 MiddlewareInterface
  3. Dependency injection - Resolving parameters through container
  4. Data mapping - Extracting data from request by attributes
  5. Execution - Calling middleware with prepared parameters

Real-world examples

REST API controller

Middleware with dependency injection

Complex data processing

Best Practices

1. Strategy order

Register more specific strategies first:

2. Error handling

Always wrap middleware creation in try-catch:

3. Parameter typing

Use strict typing for automatic type conversion:

4. Documenting attributes

Document used attributes for clarity:

5. Configuration usage

Group related settings and use default values:

6. Service injection

Use meaningful service names in the container:

Performance

The factory is optimized for performance:

Testing

License

MIT License


All versions of psr15factory with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
bermudaphp/container-aware Version ^1.0.1
bermudaphp/di-resolver Version ^1.0
bermudaphp/config Version ^2.0
bermudaphp/pipeline Version ^2.1
bermudaphp/reflection Version ^2.0
psr/container Version ^2.0.2
psr/http-message Version ^2.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware 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 bermudaphp/psr15factory contains the following files

Loading the files please wait ....