diff --git a/lib/SimpleSAML/Configuration.php b/lib/SimpleSAML/Configuration.php index 97521d380c33533303fc5ffa20cbb322c1c8825c..5996147cb9da88d4d0d4349619e1f27074b0da46 100644 --- a/lib/SimpleSAML/Configuration.php +++ b/lib/SimpleSAML/Configuration.php @@ -33,10 +33,20 @@ class SimpleSAML_Configuration { } public static function init($path, $instancename = 'simplesaml', $configfilename = 'config.php') { + /* Check if we already have loaded the given config - return the existing instance if we have. */ + if(array_key_exists($instancename, self::$instance)) { + return self::$instance[$instancename]; + } + self::$instance[$instancename] = new SimpleSAML_Configuration($path, $configfilename); } public function copyFromBase($instancename, $filename) { + /* Check if we already have loaded the given config - return the existing instance if we have. */ + if(array_key_exists($instancename, self::$instance)) { + return self::$instance[$instancename]; + } + self::$instance[$instancename] = new SimpleSAML_Configuration($this->configpath, $filename); return self::$instance[$instancename]; }