Download the PHP package objective-php/matcher without Composer

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

Objective PHP / Matcher Build Status

Library topic

Matcher is a simple but powerful key matching engine meant for components using key based identification (events handler, dependencies injector...)

The idea behind os to offer a flexible and performing way to match individual keys as well as subsets in a collection. The first use case is our own EventHandler component. We thought that using the Matcher to attach callbacks to events would lead to a much more uniform and flexible mechanism than any other event handling component.

Concept

Sections

The identifiers that Matcher can work with are supposed to be built by concatenating sections, more or less as namespaces work:

Sections are, by default, separated by a dot. This is however configurable in the component itself. Keys are supposed to be lowered case, but that's not mandatory. Just a good practice to keep keys uniform.

Matcher is aware of the section concept, and will rely on it when dealing with wildcards (see next chapter).

Wildcards

When comparing an identifier to another, either can contain one or more wildcards to symbolize sections: a question mark (?) will replace one section or key, while a star (*) will replace any number of sections and/or key.

Alternatives

In some case, wildcards are kindof too flexible... to restrict matching pattern, you can also use alternatives by providing several values for a single section of the identifier using the square brackets ([ and ])

Usage

Now that you are aware of what both section and wildcards are, let's see some examples, using realistic event identifiers coming from an MVC workflow sample:

In the above example, you can see how the Matcher can help easily binding a callback to several events at once. And if you need to me bore selective, this is where alternatives can help you:

To see more example, please take a look at the unit tests!

Performance

The matching algorithm has been rewritten several times to reach more than decent performances. With dozen of thousands call looping on large identifiers stack (also several thousands entries, including wildcards), the total user time consumed was above 100ms... Given that this is really improbable that a real application make use of that many identifiers (at least, for events or services for instance), we consider that the matching engine is very transparent from a performance perspective.


All versions of matcher with dependencies

PHP Build Version
Package Version
Requires php Version >=7.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 objective-php/matcher contains the following files

Loading the files please wait ....