From fef9729e12dd78924fb3cebe2d4a269db1461ba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no> Date: Fri, 27 Feb 2009 15:53:44 +0000 Subject: [PATCH] Add functions to check whether configuration exists git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1337 44740490-163a-0410-bde0-09ae8108e29a --- lib/SimpleSAML/Configuration.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/SimpleSAML/Configuration.php b/lib/SimpleSAML/Configuration.php index 34745503b..83d3e0352 100644 --- a/lib/SimpleSAML/Configuration.php +++ b/lib/SimpleSAML/Configuration.php @@ -278,6 +278,23 @@ class SimpleSAML_Configuration { return $this->configuration[$name]; } + + /** + * Check whether an key in the configuration exists... + */ + public function hasValue($name) { + return array_key_exists($name, $this->configuration); + } + /** + * Check whether an key in the configuration exists... + */ + public function hasValueOneOf($names) { + foreach($names AS $name) if ($this->hasValue($name)) return TRUE; + return FALSE; + } + + + public function getBaseURL() { if (preg_match('/^\*(.*)$/', $this->getValue('baseurlpath', ''), $matches)) { return SimpleSAML_Utilities::getFirstPathElement(false) . $matches[1]; -- GitLab