diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2011-01-04 19:32:49 +0100 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2011-01-04 19:32:49 +0100 |
| commit | 6d987d2c0ba8435a64843d42362851d40b277eec (patch) | |
| tree | 5750d20b1d02c894401061b9b2dfa8b990ca5260 /Wrt3g/Config.php | |
| parent | 6177cbc9990399619d61b1b7c2f1d6b32c8d0166 (diff) | |
| download | linksys-wrt3g-tools-6d987d2c0ba8435a64843d42362851d40b277eec.tar.gz linksys-wrt3g-tools-6d987d2c0ba8435a64843d42362851d40b277eec.zip | |
check that the hostname is configured
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 |
