-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How i can get all events=>callbacks? #8
Comments
Please look at the docs: Removed Functionality Originally posted by @froschdesign at zendframework/zend-eventmanager#22 (comment) |
I have dirty solution (in \Zend\EventManager\EventManager): class EventManager implements EventManagerInterface
{
// ...
public static $allEvents = [];
// ...
public function attach($event, $callback = null, $priority = 1)
{
// ...
if (empty($this->events[$event])) {
$this->events[$event] = new PriorityQueue();
self::$allEvents[$event] = new PriorityQueue();
}
// ...
$this->events[$event]->insert($listener, $priority);
self::$allEvents[$event]->insert($listener, $priority);
return $listener;
} after this i see all :) but this is unacceptable and very dirty. Originally posted by @maxgu at zendframework/zend-eventmanager#22 (comment) |
@froschdesign $this->setEventManager(new EventManager());
// or
$this->events = new EventManager(); in my task i need get all (ALL in whole app) events and handlers. Originally posted by @maxgu at zendframework/zend-eventmanager#22 (comment) |
Now i have problem: I have big application with many modules, and when i see in code I want solve this faster if i have map: events=>callbacks+priorities, like this:
Originally posted by @maxgu at zendframework/zend-eventmanager#22 (comment) |
@maxgu checkout this https://github.com/snapshotpl/ZfSnapEventDebugger Originally posted by @snapshotpl at zendframework/zend-eventmanager#22 (comment) |
@froschdesign He's asking about v2, not v3. @maxgu — The following methods will assist:
Hopefully with the above information, you can stitch something together! Originally posted by @weierophinney at zendframework/zend-eventmanager#22 (comment) |
@snapshotpl thnx, but
Originally posted by @maxgu at zendframework/zend-eventmanager#22 (comment) |
in EventManager v2.* can i get all events names\callbacks for my application
Originally posted by @maxgu at zendframework/zend-eventmanager#22
The text was updated successfully, but these errors were encountered: