Download the PHP package webmunkeez/adr-bundle without Composer

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

WebmunkeezADRBundle

This bundle unleashes the Action-Domain-Responder pattern on Symfony applications.

Installation

Use Composer to install this bundle:

Add the bundle in your application kernel:

Usage

Actions

An Action is just an invokable class that has to implement \Webmunkeez\ADRBundle\Action\ActionInterface:

But, it can be a more classic Controller that implements the same interface:

(Each service that implements ActionInterface is automatically tagged controller.service_arguments)

Responders

Responders are services which take data (an object that implements \Webmunkeez\ADRBundle\Response\ResponseDataInterface) and return it in a Response.
It can be a response containing HTML or a JsonResponse, or whatever you want, as far as it is a Symfony\Component\HttpFoundation\Response instance.

In this bundle, there is a responder manager \Webmunkeez\ADRBundle\Response\Responder that you can inject into your actions (or controllers).

This responder manager takes all responders of your application (it uses a compiler pass to get all services tagged webmunkeez_adr.responder sorted by priority) and find the right one to render the response.

You can use \Webmunkeez\ADRBundle\Response\ResponderAwareInterface and \Webmunkeez\ADRBundle\Response\ResponderAwareTrait to automatically inject Responder:

And you can use \Webmunkeez\ADRBundle\Action\ActionTrait to clean code:

Or directly extend \Webmunkeez\ADRBundle\Action\AbstractAction:

Responders are classes that implement \Webmunkeez\ADRBundle\Response\ResponderInterface (and so, they are automatically tagged webmunkeez_adr.responder):

As you can see, there are two methods: supports that defines conditions to "activate" the responder and render to make the response.

Core responders

There are two core responders provided:

HtmlResponder

\Webmunkeez\ADRBundle\Response\HtmlResponder that uses Twig for render html with a twig template. To indicate template, you have to use \Webmunkeez\ADRBundle\Attribute\Template:

This responder is active if the request contains HTTP_ACCEPT text/html header (warning: a twig template is needed for this responder, otherwise it will throw an \Webmunkeez\ADRBundle\Exception\RenderingException exception).
It has a priority: -20.

JsonResponder

\Webmunkeez\ADRBundle\Response\JsonResponder that uses Serializer for render json (you can indicate serialization context with \Webmunkeez\ADRBundle\Attribute\SerializationContext):

This responder is active if the request contains HTTP_ACCEPT application/json header.
It has a priority: -10.

Custom responders

You can write your own reponders like in my previous XmlResponder example, by implementing \Webmunkeez\ADRBundle\Response\ResponderInterface.

Services implementing this interface are automatically tagged webmunkeez_adr.responder with priority: 0, and you can change it (in your service.yaml or by static getDefaultPriority method ; see https://symfony.com/doc/current/service_container/tags.html#tagged-services-with-priority).

You can define "generic" responders like html, json, xml and so on. But you can also define more specifics, by checking $request->attributes->get('_controller') to make a responder only for a specific action:

Render Exception Listener

If there is an uncaught \Webmunkeez\ADRBundle\Exception\RenderingException, it will be catch by this listener which will throw an \Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException that will embed the original exception.

Exception Listener

If there is an uncaught \Throwable, it will be catch by this listener which will throw an \Symfony\Component\HttpKernel\Exception\BadRequestHttpException that will embed the original exception.

Http Exception Listener

If you request an Action with HTTP_ACCEPT application/json header and if this Action throws an Exception that implements \Symfony\Component\HttpKernel\Exception\HttpExceptionInterface, its content will automatically be serialized in a JSON reading format to the Response body content.


All versions of adr-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
phpdocumentor/reflection-docblock Version ^5.3
symfony/config Version ^6.4
symfony/dependency-injection Version ^6.4
symfony/http-foundation Version ^6.4
symfony/http-kernel Version ^6.4
symfony/property-access Version ^6.4
symfony/property-info Version ^6.4
symfony/serializer Version ^6.4
twig/twig Version ^3.8
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 webmunkeez/adr-bundle contains the following files

Loading the files please wait ....