Improve load_config() so when called many times it will read config file only once

pull/201/merge
Aleksander Machniak 10 years ago
parent e979511083
commit ab5b89b854

@ -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();

Loading…
Cancel
Save