Download the PHP package jbzoo/event without Composer

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

JBZoo / Event

CI Coverage Status Psalm Coverage Psalm Level CodeFactor
Stable Version Total Downloads Dependents GitHub License

The EventEmitter is a simple pattern that allows you to create an object that emits events, and allow you to listen to those events.

Install

Simple example

Set priority

By supplying a priority, you are ensured that subscribers handle in a specific order. The default priority is EventManager::MID. Anything below that will be triggered earlier, anything higher later. If there are two subscribers with the same priority, they will execute in an undefined, but deterministic order.

Types of Callback

All default PHP callbacks are supported, so closures are not required.

Cancel queue of events

Passing arguments

Arguments can be passed as an array.

Because you cannot really do anything with the return value of a listener, you can pass arguments by reference to communicate between listeners and back to the emitter.

Namespaces

Summary benchmark info (execution time) PHP v7.4

All benchmark tests are executing without xdebug and with a huge random array and 100.000 iterations.

Benchmark tests based on the tool phpbench/phpbench. See details here.

Please, pay attention - 1μs = 1/1.000.000 of second!

benchmark: ManyCallbacks

subject groups its revs mean stdev rstdev mem_real diff
benchOneUndefined undefined 10 100000 0.65μs 0.01μs 1.00% 6,291,456b 1.00x
benchOneWithStarBegin *.bar 10 100000 0.67μs 0.01μs 1.44% 6,291,456b 1.04x
benchOneWithAllStars *.* 10 100000 0.68μs 0.03μs 4.18% 6,291,456b 1.04x
benchOneWithStarEnd foo.* 10 100000 0.68μs 0.01μs 1.24% 6,291,456b 1.04x
benchOneNested foo.bar 10 100000 43.23μs 0.46μs 1.07% 6,291,456b 66.56x
benchOneSimple foo 10 100000 45.07μs 2.63μs 5.83% 6,291,456b 69.39x

benchmark: ManyCallbacksWithPriority

subject groups its revs mean stdev rstdev mem_real diff
benchOneUndefined undefined 10 100000 0.65μs 0.01μs 1.35% 6,291,456b 1.00x
benchOneNestedStarAll *.* 10 100000 0.67μs 0.01μs 1.34% 6,291,456b 1.03x
benchOneWithStarBegin *.bar 10 100000 0.67μs 0.01μs 1.10% 6,291,456b 1.04x
benchOneWithStarEnd foo.* 10 100000 0.68μs 0.01μs 1.13% 6,291,456b 1.05x
benchOneSimple foo 10 100000 4.54μs 0.02μs 0.35% 6,291,456b 7.03x
benchOneNested foo.bar 10 100000 4.58μs 0.04μs 0.81% 6,291,456b 7.10x

benchmark: OneCallback

subject groups its revs mean stdev rstdev mem_real diff
benchOneWithStarBegin *.bar 10 100000 0.69μs 0.03μs 4.00% 6,291,456b 1.00x
benchOneWithStarEnd foo.* 10 100000 0.70μs 0.03μs 4.22% 6,291,456b 1.00x
benchOneNestedStarAll *.* 10 100000 0.70μs 0.04μs 6.02% 6,291,456b 1.01x
benchOneUndefined undefined 10 100000 0.71μs 0.05μs 7.44% 6,291,456b 1.02x
benchOneSimple foo 10 100000 1.18μs 0.03μs 2.27% 6,291,456b 1.70x
benchOneNested foo.bar 10 100000 1.25μs 0.03μs 2.46% 6,291,456b 1.81x

benchmark: Random

subject groups its revs mean stdev rstdev mem_real diff
benchOneSimple random.*.triggers 10 100000 4.29μs 0.33μs 7.69% 6,291,456b 1.00x

Unit tests and check code style

License

MIT


All versions of event with dependencies

PHP Build Version
Package Version
Requires php Version ^8.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 jbzoo/event contains the following files

Loading the files please wait ....