update readme
[linksys-wrt3g-tools.git] / Wrt3g / HtmlParser.php
index c40f117a9d77eedd3a94677100d54d2b0cccae9f..ac4db350a799090b5698fba62f5e1c350c6c3630 100644 (file)
@@ -36,8 +36,10 @@ class Wrt3g_HtmlParser
      *
      * @param string $body HTML document to parse
      *
-     * @return array Array of key-value pairs, probably with "type", "network" and
-     *               "signal strength"
+     * @return array Array of key-value pairs, probably with
+     *               - "type"
+     *               - "network"
+     *               - "signal strength"
      */
     public function index_wstatus1($body)
     {
@@ -100,6 +102,9 @@ class Wrt3g_HtmlParser
     public function index_wstatus2($body)
     {
         preg_match('/var status2 = "(.+)"/', $body, $arMatches);
+        if (!isset($arMatches[1])) {
+            return array();
+        }
 
         $strStatus = $arMatches[1];
         //Connecting
@@ -116,7 +121,18 @@ class Wrt3g_HtmlParser
      *
      * @param string $body HTML document to parse
      *
-     * @return array FIXME
+     * @return array Array of key-value pairs with the following keys:
+     *               - type
+     *               - network
+     *               - signal strength
+     *               - connection time
+     *               - session usage (array)
+     *               - card model
+     *               - card revision
+     *               - card firmware
+     *               - IMSI
+     *
+     * @todo FIXME implement "connection" value as index_wstatus2() does it
      */
     public function status_noauth($body)
     {