+ public function detectServerAddress () {
+ // Is the entry set?
+ if (!$this->isConfigurationEntrySet('server_addr')) {
+ // Is it set in $_SERVER?
+ if (isset($_SERVER['SERVER_ADDR'])) {
+ // Set it from $_SERVER
+ $this->setServerAddress($_SERVER['SERVER_ADDR']);
+ } elseif (class_exists('ConsoleTools')) {
+ // Run auto-detecting through console tools lib
+ ConsoleTools::acquireSelfIPAddress();
+ }
+ } // END - if
+
+ // Now get it from configuration
+ $serverAddress = $this->getServerAddress();
+
+ // Return it
+ return $serverAddress;
+ }
+
+ /**
+ * Setter for SERVER_ADDR
+ *
+ * @param $serverAddress New SERVER_ADDR value to set
+ * @return void
+ */
+ public function setServerAddress ($serverAddress) {
+ $this->setConfigEntry('server_addr', (string) $serverAddress);
+ }
+
+ /**
+ * Getter for SERVER_ADDR
+ *
+ * @return $serverAddress New SERVER_ADDR value to set
+ */
+ public function getServerAddress () {
+ return $this->getConfigEntry('server_addr');
+ }
+
+ /**
+ * Detects the HTTPS flag
+ *
+ * @return $https The detected HTTPS flag or null if failed
+ */
+ public function detectHttpSecured () {
+ // Default is null
+ $https = NULL;
+
+ // Is HTTPS set?
+ if ($this->isHttpSecured()) {
+ // Then use it
+ $https = $_SERVER['HTTPS'];
+ } // END - if
+
+ // Return it
+ return $https;
+ }
+
+ /**
+ * Checks wether HTTPS is set in $_SERVER
+ *
+ * @return $isset Wether HTTPS is set
+ */
+ public function isHttpSecured () {
+ return (isset($_SERVER['HTTPS']));