Download the PHP package meuhmeuhconcept/processor without Composer

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

Processor

Mechanism to process a work from a request

Installation

You can install Processor with Composer

How to use it ?

The main interest of this library is the ChainProcessor. It contains multiple processors who can procced a particular work from a request and generate a response.

The ChainProcessor ask to each processors contains on it if it can proceed the job for a particular request. The first processor who awser that it can do it will be use. The response contains several things like the request itself, the status code, name of processor who do the job and obviously the output of the job.

Build a Request

Before use the processor you have to build your request. You request can be what ever you want : a simple string, an array, a object... This object will be use to determine if processor can do the job and to do it.

Example

Proceed the job

You just have to use a Processor to try to do the job. The best way is to use a ChainProcessor who contains several processors.

In fact you can directly try to do the job with a ChainProcessor. If the job can't be done the processor return a response with the special status code Mmc\Processor\Component\ResponseStatusCode::NOT_IMPLEMENTED.

Use the Response

The fisrt thing that you have to do with a Response is to consult the status code to know how the job is done.

You can also know which Processor had done the job (when you use a ChainProcessor) with the next method :

Obviously you can get the initial request (i.e. to get the input) with the method $response->getRequest().

And the more important is to get the result of the job.

Build your own Processor

This library is not ready to play because there is no Processor define in it. You have to create them to do the job that you want.

To do it you just have to create a class who implements Mmc\Processor\Component\Processor interface.

Now, you just have to add it on a ChainProcessor.

Easiers ways

Why ? Because the process method :

The difference with previous method is that 'process' method have to be call 'doProcess' and be protected.

Example with AbstractProcessor

Example with ProcessorTrait

Integration with other libraries

Symfony

meuhmeuhconcept/processor contains a CompilerPass to link automatically Processor to a ChainProcessor.

Configuration

You can use this CompilerPass with class Mmc\Processor\Bridge\Symfony\DependencyInjection\Compiler\ProcessorPass or just add the bundle in your Symfony kernel like this :

To use it you have to require symfony/dependency-injection and symfony/options-resolver packages (if you don't use Symfony fullstack).

Uses

Now you can use the tag mmc.processor.chain on a service (which is instance of ChainProcessor). Every services tagged with the name of this service will be add in it.

You can add priority parameter on the tag to set the priority of the processor (default priority is 10).

In this example, the ChainProcessor my_chain will receive the two Processor p1 and p2.

What now ?

The input of the Processor if no constraint by a type hinting, so you can use really what you want to create your request. The ChainProcessor can do what you want... if it contains Processor who can do it.


All versions of processor with dependencies

PHP Build Version
Package Version
Requires php Version >5.3.0
greg0ire/enum Version >=3.1
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 meuhmeuhconcept/processor contains the following files

Loading the files please wait ....