moved plugincontroller and event handler creation to init.php
This commit is contained in:
parent
229529655f
commit
f198658907
|
@ -195,7 +195,3 @@ function trigger_event($name, &$data, $action=null, $canPreventDefault=true) {
|
|||
$evt = new Doku_Event($name, $data);
|
||||
return $evt->trigger($action, $canPreventDefault);
|
||||
}
|
||||
|
||||
// create the event handler
|
||||
global $EVENT_HANDLER;
|
||||
$EVENT_HANDLER = new Doku_Event_Handler();
|
||||
|
|
12
inc/init.php
12
inc/init.php
|
@ -246,9 +246,21 @@ init_files();
|
|||
scriptify(DOKU_CONF.'users.auth');
|
||||
scriptify(DOKU_CONF.'acl.auth');
|
||||
|
||||
// setup plugin controller class (can be overwritten in preload.php)
|
||||
$plugin_types = array('admin','syntax','action','renderer', 'helper');
|
||||
global $plugin_controller_class, $plugin_controller;
|
||||
if (empty($plugin_controller_class)) $plugin_controller_class = 'Doku_Plugin_Controller';
|
||||
|
||||
// load libraries
|
||||
require_once(DOKU_INC.'inc/load.php');
|
||||
|
||||
// initialize plugin controller
|
||||
$plugin_controller = new $plugin_controller_class();
|
||||
|
||||
// initialize the event handler
|
||||
global $EVENT_HANDLER;
|
||||
$EVENT_HANDLER = new Doku_Event_Handler();
|
||||
|
||||
// setup authentication system
|
||||
if (!defined('NOSESSION')) {
|
||||
auth_setup();
|
||||
|
|
|
@ -9,13 +9,6 @@
|
|||
// plugin related constants
|
||||
if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
|
||||
|
||||
$plugin_types = array('admin','syntax','action','renderer', 'helper');
|
||||
|
||||
global $plugin_controller_class, $plugin_controller;
|
||||
if (empty($plugin_controller_class)) $plugin_controller_class = 'Doku_Plugin_Controller';
|
||||
|
||||
$plugin_controller = new $plugin_controller_class();
|
||||
|
||||
/**
|
||||
* Original plugin functions, remain for backwards compatibility
|
||||
*/
|
||||
|
@ -43,4 +36,3 @@ function plugin_directory($plugin) {
|
|||
global $plugin_controller;
|
||||
return $plugin_controller->get_directory($plugin);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue