protected final function __new__() { parent::__new__(func_num_args() > 0 ? func_get_arg(0) : null); $this->o('Template')->cp($this->vars); $this->request_url = parent::current_url(); $this->request_query = parent::query_string() == null ? null : '?' . parent::query_string(); }
protected function __new__($dict = null) { $this->dict($dict); parent::__new__(); $this->templ->cp($this->vars); $port = isset($_SERVER["SERVER_PORT"]) ? $_SERVER["SERVER_PORT"] : 80; $server = isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : (isset($_SERVER["SERVER_NAME"]) ? $_SERVER["SERVER_NAME"] : ""); $path = isset($_SERVER["REQUEST_URI"]) ? $_SERVER["REQUEST_URI"] : ""; if (preg_match("/^(.*?)(\\?.*)\$/", $path, $match)) { list(, $path, self::$request_query) = $match; } self::$request_url = ($port === 443 ? "https" : "http") . "://" . $server . $path; }