Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiosmosis <benaka@piwik.pro>2015-05-21 00:38:47 +0300
committerdiosmosis <benaka@piwik.pro>2015-05-21 18:32:41 +0300
commit6e785703aca37f8db2434cc652ffa6de892652d1 (patch)
treeea3eaa3de5881a4bc5ce3e8dbe679187239d8736 /core/EventDispatcher.php
parent10962b88b7138fb4ec03f6f8c00cd6edc988e4c6 (diff)
Allow event observers to be defined before the container is created via the observers.global DI config entry.
Diffstat (limited to 'core/EventDispatcher.php')
-rw-r--r--core/EventDispatcher.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/EventDispatcher.php b/core/EventDispatcher.php
index 2955e5b03f..7bd674f2df 100644
--- a/core/EventDispatcher.php
+++ b/core/EventDispatcher.php
@@ -64,9 +64,14 @@ class EventDispatcher
/**
* Constructor.
*/
- public function __construct($pluginManager = null)
+ public function __construct(Plugin\Manager $pluginManager, array $globalObservers = array())
{
$this->pluginManager = $pluginManager;
+
+ foreach ($globalObservers as $observerInfo) {
+ list($eventName, $callback) = $observerInfo;
+ $this->extraObservers[$eventName][] = $callback;
+ }
}
/**