Download the PHP package semaio/request-id-bundle without Composer

On this page you can find all versions of the php package semaio/request-id-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 request-id-bundle

Symfony Request ID Bundle

This bundle adds request IDs to the request and response in your Symfony application.

Why? It is a great and simple way to add some additional information to logs and to present to users. For example, if a request fails or an exception is thrown you'll be able to show the user the request ID which they can pass on to you to locate their specific issue.

Installation

The request ID bundle can be installed at any point during a project's lifecycle.

Requirements

Install the bundle

Please install the bundle using composer:

Enable the bundle

Then, enable the bundle by adding the following line in bundles.php file of your project:

Configure the bundle

Now, that the bundle is installed and enabled, you have to add some configuration:

How it works

When a request comes in your Symfony application and if your configured policy allows it, the bundle inspects the X-Request-Id header. If present, the given value will be used throught the rest of your request lifecycle in your Symfony application. This lets you use request ID's from somewhere higher up in the stack (like in the web server itself or a load balancer).

If no request ID is found or configured policy rejects using any given X-Request-Id header from the incoming request, the bundle creates a new request ID based on the configured generator. By default, a UUID version 4 request ID is generated (example: 31c70a8e-8a1e-47af-9c31-3285e9bc2eb3).

Before sending the response to the client, the X-Request-Id header is also set on the response using the generated request ID value.

Components

Generators

Generators create a random string that will be used as request ID throughout the request lifecycle of your Symfony application.

All generators must implement the Semaio\RequestId\Generator\GeneratorInterface. By default, there are three possible generators:

Policies

Policies check the incoming request for two reasons:

All policies must implement the Semaio\RequestId\Policy\PolicyInterface. By default, there are two possible policies:

Providers

Providers hold the generated request ID and provide it to any part of your code where you might need the request ID. By default, there is only one provider:

Extensions

Monolog integration

This bundle provides a monolog processor which adds the request ID to extra array on the record. This can be turned off by setting enable_monolog to false in bundle configuration.

To use the request ID in your logs, include %extra.request_id% in your formatter. Here's a configuration example from this bundle's tests.

Twig integration

This bundle provides a global request_id function in your Twig environment. This can be turned off by setting enable_twig to false in bundle configuration.

Here's an example of a template.

License

MIT


All versions of request-id-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
monolog/monolog Version ^3.0
ramsey/uuid Version ^4.0
symfony/framework-bundle Version ^6.0|^7.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 semaio/request-id-bundle contains the following files

Loading the files please wait ....