From de89d46be24f6b3454a0c0e62973af947b22ff29 Mon Sep 17 00:00:00 2001 From: corbosman Date: Tue, 6 Jan 2015 21:48:39 +0100 Subject: Load plugins before sessions have started Move the plugin loading phase to before sessions have started allowing plugins to add session drivers. Plugins that want to use this should define an "onload" method in their plugins. This method does not have access to variables like $task as they are not yet initialised at that time. --- program/include/rcmail.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'program/include') diff --git a/program/include/rcmail.php b/program/include/rcmail.php index a16319f72..306e5938a 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -93,6 +93,10 @@ class rcmail extends rcube $this->filename = $basename; } + // load all configured plugins + $this->plugins->load_plugins((array)$this->config->get('plugins', array()), + array('filesystem_attachments', 'jqueryui')); + // start session $this->session_init(); @@ -124,10 +128,8 @@ class rcmail extends rcube $GLOBALS['OUTPUT'] = $this->load_gui(!empty($_REQUEST['_framed'])); } - // load plugins + // run init method on all the plugins $this->plugins->init($this, $this->task); - $this->plugins->load_plugins((array)$this->config->get('plugins', array()), - array('filesystem_attachments', 'jqueryui')); } /** -- cgit v1.2.3