Skip to content
Snippets Groups Projects
Commit fef9729e authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Add functions to check whether configuration exists

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1337 44740490-163a-0410-bde0-09ae8108e29a
parent 782e8d70
No related branches found
No related tags found
No related merge requests found
......@@ -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];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment