Some time ago I stumbled upon this great message from some program on my PC, I can’t remember which one now.
Haga doble clic en el icono de adv. en la barra est. para ver este mens. en el fut.
Andrea Ercolino, Software Engineer
Some time ago I stumbled upon this great message from some program on my PC, I can’t remember which one now.
Haga doble clic en el icono de adv. en la barra est. para ver este mens. en el fut.
This EventManager class is for PHP 5.3. It has got the same features as Yet Another EventManager Class in PHP (<5.3):
plus the following:
As a namespace for my projects I chose Ando, which is short, and tells a bit about me (Andrea), and a bit about Miho, my wife, which once called me Andorea.
Global functions, class methods, object methods, and anonymous functions are all supported.
Not only bind() accepts any callable expression, but also accepts and returns an object of the class AndoCoreCallable. This way, for unbinding an event handler, the Callable object that bind() returns must be passed to unbind().
Callable objects are just a wrapper around callable expressions, that allows for a uniform access and storage.
{[ .callable | 1.hilite(=php=) ]}
—
{[ .another_event_manager | 1.hilite(=php=) ]}
As is, the previous scripts outputs nothing, but uncommenting the commented line you get
Hello Popeye !
{[ .wrapping_actions | 1.hilite(=php,ln-1=) ]}
Trace
2009-11-16 07:17:29: one:before: 3 2009-11-16 07:17:32: one:after: NULL 2009-11-16 07:17:32: one:before: 3 2009-11-16 07:17:35: one:after: NULL 2009-11-16 07:17:35: two:before: 2 2009-11-16 07:17:37: two:after: NULL 2009-11-16 07:17:37: two:before: 2 2009-11-16 07:17:39: two:after: NULL 2009-11-16 07:17:39: one:before: 3 2009-11-16 07:17:42: one:after: NULL
{[ .runtime_class_extension | 1.hilite(=php,ln-1=) ]}
Trace
{[ .runtime_class_extension_result /precode.php ]}
{[ .filters_pipeline | 1.hilite(=php,ln-1=) ]}
Output
a *quick* red fox jumps OVER a _lazy_ brown dog.
a *quick* red fox jumps over a _lazy_ brown dog.
—
Last but not least, here is the code of the EventManager class
{[ .event_manager | 1.hilite(=php,ln-1=) ]}