Skip to content
Snippets Groups Projects
Commit 97233b77 authored by Bart Visscher's avatar Bart Visscher
Browse files

Remove DOCUMENTROOT static var, and make SUBURI var private

parent 9a66b869
Branches
No related tags found
No related merge requests found
...@@ -30,10 +30,6 @@ class OC{ ...@@ -30,10 +30,6 @@ class OC{
* Assoziative array for autoloading. classname => filename * Assoziative array for autoloading. classname => filename
*/ */
public static $CLASSPATH = array(); public static $CLASSPATH = array();
/**
* $_SERVER['DOCUMENTROOT'] but without symlinks
*/
public static $DOCUMENTROOT = '';
/** /**
* The installation path for owncloud on the server (e.g. /srv/http/owncloud) * The installation path for owncloud on the server (e.g. /srv/http/owncloud)
*/ */
...@@ -41,7 +37,7 @@ class OC{ ...@@ -41,7 +37,7 @@ class OC{
/** /**
* the current request path relative to the owncloud root (e.g. files/index.php) * the current request path relative to the owncloud root (e.g. files/index.php)
*/ */
public static $SUBURI = ''; private static $SUBURI = '';
/** /**
* the owncloud root path for http requests (e.g. owncloud/) * the owncloud root path for http requests (e.g. owncloud/)
*/ */
...@@ -122,7 +118,7 @@ class OC{ ...@@ -122,7 +118,7 @@ class OC{
public static function initPaths(){ public static function initPaths(){
// calculate the documentroot // calculate the documentroot
OC::$DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']); $DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']);
OC::$SERVERROOT=str_replace("\\",'/',substr(__FILE__,0,-13)); OC::$SERVERROOT=str_replace("\\",'/',substr(__FILE__,0,-13));
OC::$SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen(OC::$SERVERROOT)); OC::$SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen(OC::$SERVERROOT));
$scriptName=$_SERVER["SCRIPT_NAME"]; $scriptName=$_SERVER["SCRIPT_NAME"];
...@@ -138,7 +134,7 @@ class OC{ ...@@ -138,7 +134,7 @@ class OC{
} }
OC::$WEBROOT=substr($scriptName,0,strlen($scriptName)-strlen(OC::$SUBURI)); OC::$WEBROOT=substr($scriptName,0,strlen($scriptName)-strlen(OC::$SUBURI));
// try a new way to detect the WEBROOT which is simpler and also works with the app directory outside the owncloud folder. let´s see if this works for everybody // try a new way to detect the WEBROOT which is simpler and also works with the app directory outside the owncloud folder. let´s see if this works for everybody
// OC::$WEBROOT=substr(OC::$SERVERROOT,strlen(OC::$DOCUMENTROOT)); // OC::$WEBROOT=substr(OC::$SERVERROOT,strlen($DOCUMENTROOT));
if(OC::$WEBROOT!='' and OC::$WEBROOT[0]!=='/'){ if(OC::$WEBROOT!='' and OC::$WEBROOT[0]!=='/'){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment