X-Git-Url: https://git.cweiske.de/linksys-wrt3g-tools.git/blobdiff_plain/0b819c19fd42dea09b9ef638ebdba8c592ecddb8..d5acd59f15dd093735036899d8e5fc0e62777398:/Wrt3g.php?ds=sidebyside diff --git a/Wrt3g.php b/Wrt3g.php index 6b12ac5..07a6821 100644 --- a/Wrt3g.php +++ b/Wrt3g.php @@ -63,7 +63,7 @@ class Wrt3g * * @see Wrt3g_Config */ - public function loadConfig($options) + public function loadConfig($options = array()) { $this->config = new Wrt3g_Config($this); $this->config->load($options); @@ -145,14 +145,40 @@ class Wrt3g /** - * Retrieves status information about the router + * Retrieves basic connection status information about the router * * @return array Array with several key-value pairs * connection => connecting, disconnected, connected * - * @throws Exception When the router can't be reached, or unauthorized + * @throws Exception When the router can't be reached */ public function getConnectionStatus() + { + return array_intersect_key( + $this->loadStatus_NoAuth(), + array( + 'connection' => 0, + 'type' => 0, + 'network' => 0, + 'signal strength' => 0, + 'connection time' => 0, + 'session usage' => 0 + ) + ); + } + + + + /** + * Retrieves connection status information about the router. + * Uses pages that can only be reached with authentication. + * + * @return array Array with several key-value pairs + * connection => connecting, disconnected, connected + * + * @throws Exception When the router can't be reached, or unauthorized + */ + public function getConnectionStatusAuth() { $arRetval = array(); @@ -284,9 +310,9 @@ class Wrt3g /** * Log a message to stdout. * - * @param string|object $msg Message to display. May even be a response - * object - * @param integer $level Log level, see $verbosity + * @param string|object $msg Message to display. May even be a response + * object + * @param integer $level Log level, see $verbosity * * @return void */