git.cweiske.de
/
linksys-wrt3g-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
check that the hostname is configured
[linksys-wrt3g-tools.git]
/
Wrt3g
/
Config.php
diff --git
a/Wrt3g/Config.php
b/Wrt3g/Config.php
index 5036f7d0a2266e2f32d4e0b9f0beb8320cdef730..fc058edb4940bd551adb17bfbf2653db0c9f3fff 100644
(file)
--- a/
Wrt3g/Config.php
+++ b/
Wrt3g/Config.php
@@
-102,6
+102,8
@@
class Wrt3g_Config
2
);
2
);
+ $this->verify();
+
if (isset($options['save'])) {
$this->save($file);
}
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');
}
$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
}
?>
\ No newline at end of file