diff options
Diffstat (limited to 'Wrt3g/Config.php')
| -rw-r--r-- | Wrt3g/Config.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Wrt3g/Config.php b/Wrt3g/Config.php index 5036f7d..fc058ed 100644 --- a/Wrt3g/Config.php +++ b/Wrt3g/Config.php @@ -102,6 +102,8 @@ class Wrt3g_Config 2 ); + $this->verify(); + if (isset($options['save'])) { $this->save($file); } @@ -201,6 +203,22 @@ class Wrt3g_Config $this->logger->log('Saving config into file ' . $file, 2); $cfg->writeConfig($file, 'inifile'); } + + + + /** + * Verifies that all required options are set + * + * @return void + * + * @throw Exception When something is missing + */ + protected function verify() + { + if ($this->host == '') { + throw new Exception('Hostname missing'); + } + } } ?>
\ No newline at end of file |
