1
0
mirror of https://github.com/beestat/app.git synced 2025-05-24 02:14:03 -04:00

Made setting->get() a bit clearer.

This commit is contained in:
Jon Ziebell 2019-07-06 14:28:13 -04:00
parent fd724fd3db
commit 2773fd7184

View File

@ -202,17 +202,20 @@ final class setting {
*/
public function get($setting) {
if(array_key_exists($setting, $this->settings) === true) {
if(array_key_exists($this->settings['environment'], $this->settings[$setting]) === true) {
return $this->settings[$setting][$this->settings['environment']];
}
else {
if(is_array($this->settings[$setting]) === true) {
if(array_key_exists($this->settings['environment'], $this->settings[$setting]) === true) {
return $this->settings[$setting][$this->settings['environment']];
} else {
throw new \Exception('Setting does not exist for environment.');
}
} else {
return $this->settings[$setting];
}
}
else {
} else {
throw new \Exception('Setting does not exist.', 1300);
}
}
}
/**
* Whether or not the current configuration is running the demo.