diff options
author | Friendika <info@friendika.com> | 2011-02-06 19:15:20 -0800 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-02-06 19:15:20 -0800 |
commit | b96d6c015b8090ee2ec56f320821fe962f821c6f (patch) | |
tree | 4d642cf482bf0d18737fb57cb108dca21f565e97 /boot.php | |
parent | 147d7f3bbf6c785f2c1eb7cdcfaa0a47e0ee43d3 (diff) | |
download | volse-hubzilla-b96d6c015b8090ee2ec56f320821fe962f821c6f.tar.gz volse-hubzilla-b96d6c015b8090ee2ec56f320821fe962f821c6f.tar.bz2 volse-hubzilla-b96d6c015b8090ee2ec56f320821fe962f821c6f.zip |
fix contact photo updates - a result of baseurl being wrong for cmdline processes
Diffstat (limited to 'boot.php')
-rw-r--r-- | boot.php | 40 |
1 files changed, 29 insertions, 11 deletions
@@ -2,7 +2,7 @@ set_time_limit(0); -define ( 'BUILD_ID', 1036 ); +define ( 'BUILD_ID', 1037 ); define ( 'FRIENDIKA_VERSION', '2.10.0905' ); define ( 'DFRN_PROTOCOL_VERSION', '2.1' ); @@ -215,9 +215,19 @@ class App { $this->scheme = ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'])) ? 'https' : 'http' ); - if(x($_SERVER,'SERVER_NAME')) + if(x($_SERVER,'SERVER_NAME')) { $this->hostname = $_SERVER['SERVER_NAME']; + /** + * 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; + } + set_include_path("include/$this->hostname" . PATH_SEPARATOR . 'include' . PATH_SEPARATOR . '.' ); if((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) === "q=") @@ -225,14 +235,6 @@ class App { if(x($_GET,'q')) $this->cmd = trim($_GET['q'],'/\\'); - /** - * 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; /** @@ -295,8 +297,20 @@ class App { } function set_baseurl($url) { + $parsed = parse_url($url); + $this->baseurl = $url; - $this->hostname = basename($url); + + if($parsed) { + $this->scheme = $parsed['scheme']; + + $this->hostname = $parsed['host']; + if($parsed['port']) + $this->hostname .= ':' . $parsed['port']; + if($parsed['path']) + $this->path = trim($parsed['path'],'\\/'); + } + } function get_hostname() { @@ -406,8 +420,12 @@ function system_unavailable() { if(! function_exists('check_config')) { function check_config(&$a) { + load_config('system'); + if(! x($_SERVER,'SERVER_NAME')) + return; + $build = get_config('system','build'); if(! x($build)) $build = set_config('system','build',BUILD_ID); |