Download the PHP package snicco/http-routing-bundle without Composer

On this page you can find all versions of the php package snicco/http-routing-bundle. 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 http-routing-bundle

Snicco - HttpRoutingBundle

codecov Psalm Type-Coverage Psalm level PhpMetrics - Static Analysis PHP-Versions

This WordPress bundle configures the standalone snicco/http-routing library for usage in applications based on snicco/kernel.

Installation

Configuration

This bundle has extensive configuration options:

If these files do not exist in your configuration directory the default configuration will be copied the first time the kernel is booted in dev mode.

Add the HttpRoutingBundle to your bundles.php configuration file.

Usage

This bundle provides to main services that should be used:

This is an example of how the bootstrap file of a plugin could look like:

Requests and Responses

This bundle takes care of running the middleware pipeline of the snicco/http-routing library at just the right moments inside the WordPress request lifecycle.

There are three types of requests that can be handled:

The HttpKernelRunner::listen() method sets appropriate hooks based on the current request type and will then pipe a request through your application.

All of your middlewares and controllers have three types of responses that can be returned:

  1. DelegatedResponse, with headers that should be sent
  2. DelegatedResponse, without headers
  3. Any other PSR-7 response

Depending on the current request type here is what will happen for each response type:

Response type Action
Delegated Response Response headers will be sent, WordPress execution resumes
Delegated Response (no headers) Nothing will be sent, WordPress execution resumes
Other PSR-7 responses Response headers and body will be sent, WordPress execution is terminated
Response type Action
Delegated Response Response headers will be sent, WordPress execution resumes
Delegated Response (no headers) Nothing will be sent, WordPress execution resumes
Other PSR-7 responses HTTP status code between 200 and 300:
=> Headers are sent immediately.
=> Response body is sent at the all_admin_notices hook.

HTTP status code between 300 and 599:
=> Headers and Body sent immediately
=> WordPress execution is terminated

Middleware

This bundle provides a couple PSR-15 middlewares that you can use in your application:

Error handling

This bundle automatically configures the snicco/psr7-error-handler library that is used by snicco/http-routing.

You can configure this behaviour with the http_error_handling configuration.

All exceptions inside YOUR middleware pipeline will be handled automatically. WordPress core code and plugins are not affected by this at all.

Contributing

This repository is a read-only split of the development repo of the Snicco project.

This is how you can contribute.

Reporting issues and sending pull requests

Please report issues in the Snicco monorepo.

Security

If you discover a security vulnerability within BetterWPCache, please follow our disclosure procedure.


All versions of http-routing-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
snicco/kernel Version ^2.0
snicco/http-routing Version ^2.0
snicco/better-wp-hooks-bundle Version ^2.0
snicco/minimal-logger Version ^2.0
snicco/event-dispatcher Version ^2.0
snicco/psr7-error-handler Version ^2.0
snicco/str-arr Version ^2.0
snicco/better-wp-api Version ^2.0
nyholm/psr7-server Version ^1.0.2
laminas/laminas-httphandlerrunner Version ^2.1
psr/log Version ^1.1.1
webimpress/safe-writer Version ^2.2
webmozart/assert Version ^1.10
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 snicco/http-routing-bundle contains the following files

Loading the files please wait ....