- $this->timezone = ((x($default_timezone)) ? $default_timezone : 'UTC');
-
- date_default_timezone_set($this->timezone);
-
- $this->performance["start"] = microtime(true);
- $this->performance["database"] = 0;
- $this->performance["network"] = 0;
- $this->performance["file"] = 0;
- $this->performance["rendering"] = 0;
- $this->performance["parser"] = 0;
- $this->performance["marktime"] = 0;
- $this->performance["markstart"] = microtime(true);
-
- $this->config = array();
- $this->page = array();
- $this->pager= array();
-
- $this->query_string = '';
-
- startup();
-
- set_include_path(
- 'include' . PATH_SEPARATOR
- . 'library' . PATH_SEPARATOR
- . 'library/phpsec' . PATH_SEPARATOR
- . 'library/langdet' . PATH_SEPARATOR
- . '.' );
-
-
- $this->scheme = 'http';
- if(x($_SERVER,'HTTPS') && $_SERVER['HTTPS'])
- $this->scheme = 'https';
- elseif(x($_SERVER,'SERVER_PORT') && (intval($_SERVER['SERVER_PORT']) == 443))
- $this->scheme = 'https';
-
- if(x($_SERVER,'SERVER_NAME')) {
- $this->hostname = $_SERVER['SERVER_NAME'];
-
- // See bug 437 - this didn't work so disabling it
- //if(stristr($this->hostname,'xn--')) {
- // PHP or webserver may have converted idn to punycode, so
- // convert punycode back to utf-8
- // require_once('library/simplepie/idn/idna_convert.class.php');
- // $x = new idna_convert();
- // $this->hostname = $x->decode($_SERVER['SERVER_NAME']);
- //}
-
- if(x($_SERVER,'SERVER_PORT') && $_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443)
- $this->hostname .= ':' . $_SERVER['SERVER_PORT'];
- /**
- * Figure out if we are running at the top of a domain
- * or in a sub-directory and adjust accordingly
- */
-
- $path = trim(dirname($_SERVER['SCRIPT_NAME']),'/\\');
- if(isset($path) && strlen($path) && ($path != $this->path))
- $this->path = $path;
- }