- protected static $arTranslations = array(
- 'GPRS_MSG.WWBEAR' => 'type',
- 'GPRS_MSG.NNAME' => 'network',
- 'GPRS_MSG.STRENGTH' => 'signal strength',
- 'GPRS_MSG.ACQUIRING' => 'aquiring',
- 'GPRS_MSG.WWBEAR_GPRS' => 'GPRS',
- 'GPRS_MSG.WWBEAR_UMTS' => 'UMTS',
- );
+ /**
+ * Logging verbosity
+ * 0 - no debug logging
+ * 1 - show important details (connected URLs)
+ * 2 - show internal details
+ * 3 - show HTTP requests and responses
+ *
+ * @var integer
+ */
+ public $verbosity = 0;
+
+ /**
+ * Class to send HTTP Requests with.
+ * Needs to be compatible with HTTP_Request2
+ *
+ * @var string
+ */
+ public $requestClass = 'HTTP_Request2';
+
+ /**
+ * Configuration object
+ *
+ * @var Wrt3g_Config
+ */
+ public $config;
+
+
+
+ /**
+ * Loads the configuration from file and cmdline options
+ *
+ * @param array $options Command line options array
+ *
+ * @return void
+ *
+ * @see Wrt3g_Config
+ */
+ public function loadConfig($options = array())
+ {
+ $this->config = new Wrt3g_Config($this);
+ $this->config->load($options);
+ }
+
+
+
+ /**
+ * Returns the base URL to use for requests that require authentification.
+ * Includes username, password and host.
+ *
+ * @return string URL without trailing slash after the host
+ */
+ protected function getAuthBaseUrl()
+ {
+ return 'http://'
+ . $this->config->user
+ . ':' . $this->config->password
+ . '@' . $this->config->host;
+ }
+
+
+
+ /**
+ * Returns the base URL to use for requests that do
+ * not require authentification.
+ *
+ * @return string URL without trailing slash after the host
+ */
+ protected function getAnonBaseUrl()
+ {
+ return 'http://' . $this->config->host;
+ }
+
+