diff options
author | Aleksander Machniak <alec@alec.pl> | 2014-10-30 08:59:52 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2014-10-30 08:59:52 +0100 |
commit | ab5b89b854746c76a26b70612c1220a8f3841824 (patch) | |
tree | 9e8ecc572c5a8cd843222de2a46db9708e8dfb5c /program/lib/Roundcube/rcube_plugin.php | |
parent | e97951108304bd06d70734c42714fd4a8ad5311d (diff) |
Improve load_config() so when called many times it will read config file only once
Diffstat (limited to 'program/lib/Roundcube/rcube_plugin.php')
-rw-r--r-- | program/lib/Roundcube/rcube_plugin.php | 7 |
1 files changed, 7 insertions, 0 deletions
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(); |