aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-10-17 18:53:18 -0700
committerfriendica <info@friendica.com>2012-10-17 18:53:18 -0700
commit2cd999490406f3a1db3995a894768cf08f2cc0fd (patch)
tree589c0d1a1a266e2a915b97a6f6087a3664840536 /boot.php
parenta680eb3a73710eb38fc6e77fb79d017f4a20c6a5 (diff)
downloadvolse-hubzilla-2cd999490406f3a1db3995a894768cf08f2cc0fd.tar.gz
volse-hubzilla-2cd999490406f3a1db3995a894768cf08f2cc0fd.tar.bz2
volse-hubzilla-2cd999490406f3a1db3995a894768cf08f2cc0fd.zip
use a single language config until all the new options are in place
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php79
1 files changed, 37 insertions, 42 deletions
diff --git a/boot.php b/boot.php
index 7f5dd06df..16872eff9 100644
--- a/boot.php
+++ b/boot.php
@@ -393,12 +393,15 @@ function startup() {
if(! class_exists('App')) {
class App {
+
public $account = null; // account record
private $channel = null; // channel record
private $observer = null; // xchan record
private $widgets = array(); // widgets for this page
-
+
+
+
public $language;
public $module_loaded = false;
public $query_string;
@@ -419,7 +422,6 @@ if(! class_exists('App')) {
public $module;
public $pager;
public $strings;
- public $path;
public $hooks;
public $timezone;
public $interactive = true;
@@ -449,6 +451,8 @@ if(! class_exists('App')) {
private $scheme;
private $hostname;
private $baseurl;
+ private $path;
+
private $db;
private $curl_code;
@@ -473,25 +477,16 @@ if(! class_exists('App')) {
startup();
- $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';
+ $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'];
/**
@@ -579,42 +574,42 @@ if(! class_exists('App')) {
}
function get_baseurl($ssl = false) {
+ $scheme = $this->scheme;
- $scheme = $this->scheme;
-
- if((x($this->config,'system')) && (x($this->config['system'],'ssl_policy'))) {
- if(intval($this->config['system']['ssl_policy']) === intval(SSL_POLICY_FULL))
- $scheme = 'https';
+ if((x($this->config,'system')) && (x($this->config['system'],'ssl_policy'))) {
+ if(intval($this->config['system']['ssl_policy']) === intval(SSL_POLICY_FULL))
+ $scheme = 'https';
- // Basically, we have $ssl = true on any links which can only be seen by a logged in user
- // (and also the login link). Anything seen by an outsider will have it turned off.
+ // Basically, we have $ssl = true on any links which can only be seen by a logged in user
+ // (and also the login link). Anything seen by an outsider will have it turned off.
- if($this->config['system']['ssl_policy'] == SSL_POLICY_SELFSIGN) {
- if($ssl)
- $scheme = 'https';
- else
- $scheme = 'http';
- }
- }
+ if($this->config['system']['ssl_policy'] == SSL_POLICY_SELFSIGN) {
+ if($ssl)
+ $scheme = 'https';
+ else
+ $scheme = 'http';
+ }
+ }
- $this->baseurl = $scheme . "://" . $this->hostname . ((isset($this->path) && strlen($this->path)) ? '/' . $this->path : '' );
- return $this->baseurl;
+ $this->baseurl = $scheme . "://" . $this->hostname . ((isset($this->path) && strlen($this->path)) ? '/' . $this\
+->path : '' );
+ return $this->baseurl;
}
function set_baseurl($url) {
- $parsed = @parse_url($url);
+ $parsed = @parse_url($url);
- $this->baseurl = $url;
+ $this->baseurl = $url;
- if($parsed) {
- $this->scheme = $parsed['scheme'];
+ if($parsed) {
+ $this->scheme = $parsed['scheme'];
- $this->hostname = $parsed['host'];
- if(x($parsed,'port'))
- $this->hostname .= ':' . $parsed['port'];
- if(x($parsed,'path'))
- $this->path = trim($parsed['path'],'\\/');
- }
+ $this->hostname = $parsed['host'];
+ if(x($parsed,'port'))
+ $this->hostname .= ':' . $parsed['port'];
+ if(x($parsed,'path'))
+ $this->path = trim($parsed['path'],'\\/');
+ }
}