public function __construct($configuration = array()) { parent::__construct($configuration); $this->loadConfiguration(); $this->events = new EventsManager(); $this->logger = LogHandler::create($this->configuration); $this->audit = AuditHandler::create($this->configuration); $this->cache = CacheHandler::create($this->configuration); try { $plugins_handler = new Plugins($this->database, $this->configuration); $this->dispatcher = new Dispatcher($this->configuration, $this->events, $this->cache, $this->logger); $this->dispatcher->extra()->set('database', $this->database())->set('audit', $this->audit()); $this->dispatcher->router()->add("/", "ROUTE", "\\Comodojo\\Services\\Landing"); $this->dispatcher->router()->add("/rpc", "ROUTE", "\\Comodojo\\Services\\Rpc"); $this->dispatcher->router()->add("/authentication", "ROUTE", "\\Comodojo\\Services\\Authentication"); $this->dispatcher->router()->add("/error", "ROUTE", "\\Comodojo\\Services\\Error"); foreach (PluginIterator::loadBy(array('framework', '=', 'dispatcher')) as $plugin) { $this->dispatcher->events()->subscribe($plugin->event, $plugin->class, $plugin->method); } } catch (Exception $e) { $this->startup_exception = $e; } }
public function getPlugins() { $filter = array("package", "=", $this->id); return PluginIterator::loadBy($filter, $this->configuration(), $this->database(), true); }