From ab5b89b854746c76a26b70612c1220a8f3841824 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 30 Oct 2014 08:59:52 +0100 Subject: Improve load_config() so when called many times it will read config file only once --- program/lib/Roundcube/rcube_plugin.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'program/lib/Roundcube') diff --git a/program/lib/Roundcube/rcube_plugin.php b/program/lib/Roundcube/rcube_plugin.php index 9c7a9c2dc..71a7ccf3c 100644 --- a/program/lib/Roundcube/rcube_plugin.php +++ b/program/lib/Roundcube/rcube_plugin.php @@ -71,6 +71,7 @@ abstract class rcube_plugin protected $home; protected $urlbase; private $mytask; + private $loaded_config = array(); /** @@ -141,6 +142,12 @@ abstract class rcube_plugin */ public function load_config($fname = 'config.inc.php') { + if (in_array($fname, $this->loaded_config)) { + return; + } + + $this->loaded_config[] = $fname; + $fpath = $this->home.'/'.$fname; $rcube = rcube::get_instance(); -- cgit v1.2.3