aboutsummaryrefslogtreecommitdiff
path: root/Wrt3g.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2010-12-16 08:44:43 +0100
committerChristian Weiske <cweiske@cweiske.de>2010-12-16 08:44:43 +0100
commitafdec668e5cdaec7f9ea2266c2287c0acb82689b (patch)
treec74fe4c557885db27cc877a271bd7cfa308d36ec /Wrt3g.php
parentb92abe47b7290b0e861ddadaa7abcde5bc65cd6e (diff)
downloadlinksys-wrt3g-tools-afdec668e5cdaec7f9ea2266c2287c0acb82689b.tar.gz
linksys-wrt3g-tools-afdec668e5cdaec7f9ea2266c2287c0acb82689b.zip
add possibility to use dummy router - verrrry useful for testing offline :)
Diffstat (limited to 'Wrt3g.php')
-rw-r--r--Wrt3g.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/Wrt3g.php b/Wrt3g.php
index 9910b8e..c71ae19 100644
--- a/Wrt3g.php
+++ b/Wrt3g.php
@@ -56,6 +56,14 @@ class Wrt3g
*/
public $verbosity = 0;
+ /**
+ * Class to send HTTP Requests with.
+ * Needs to be compatible with HTTP_Request2
+ *
+ * @var string
+ */
+ public $requestClass = 'HTTP_Request2';
+
/**
@@ -99,7 +107,7 @@ class Wrt3g
$url = $this->getAuthBaseUrl() . '/apply.cgi';
$this->log('Connecting to ' . $url);
- $r = new HTTP_Request2();
+ $r = new $this->requestClass();
$r->setMethod(HTTP_Request2::METHOD_POST);
$r->setUrl($url);
$r->addPostParameter('action', 'Reboot');
@@ -130,7 +138,7 @@ class Wrt3g
/**
* Connection status
*/
- $r = new HTTP_Request2();
+ $r = new $this->requestClass();
$r->setMethod(HTTP_Request2::METHOD_GET);
$r->setUrl($strUrlBase . '/index_wstatus2.asp');
$this->log('Connecting to ' . $strUrlBase . '/index_wstatus2.asp', 1);
@@ -167,7 +175,7 @@ class Wrt3g
$url = $strUrlBase . '/Status_NoAuth.asp';
$this->log('Connecting to ' . $url, 1);
- $r = new HTTP_Request2();
+ $r = new $this->requestClass();
$r->setMethod(HTTP_Request2::METHOD_GET);
$r->setUrl($url);
$resp = $r->send();