diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-03-01 22:04:13 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-03-01 22:59:35 +0100 |
commit | 3d3190309f85a3b66890763f9605a6919f52d5f4 (patch) | |
tree | 8befdf616f7144037f81c617e28f817f637f6754 /lib | |
parent | 1471d8f7109a9f6aa322a67a19e03e8faf37c985 (diff) | |
download | nextcloud-server-3d3190309f85a3b66890763f9605a6919f52d5f4.tar.gz nextcloud-server-3d3190309f85a3b66890763f9605a6919f52d5f4.zip |
Simplify stripping the last part off WEBROOT and SERVERROOT for 3rdparty and app dir
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/lib/base.php b/lib/base.php index 0df6631df4d..ee79f08eb22 100644 --- a/lib/base.php +++ b/lib/base.php @@ -181,14 +181,8 @@ class OC{ OC::$THIRDPARTYROOT=OC::$SERVERROOT; OC::$THIRDPARTYWEBROOT=OC::$WEBROOT; }elseif(file_exists(OC::$SERVERROOT.'/../3rdparty')){ - $url_tmp=explode('/',OC::$WEBROOT); - $length=count($url_tmp); - unset($url_tmp[$length-1]); - OC::$THIRDPARTYWEBROOT=implode('/',$url_tmp); - $root_tmp=explode('/',OC::$SERVERROOT); - $length=count($root_tmp); - unset($root_tmp[$length-1]); - OC::$THIRDPARTYROOT=implode('/',$root_tmp); + OC::$THIRDPARTYWEBROOT=rtrim(dirname(OC::$WEBROOT), '/'); + OC::$THIRDPARTYROOT=rtrim(dirname(OC::$SERVERROOT), '/'); }else{ echo("3rdparty directory not found! Please put the ownCloud 3rdparty folder in the ownCloud folder or the folder above. You can also configure the location in the config.php file."); exit; @@ -199,14 +193,8 @@ class OC{ OC::$APPSROOT=OC::$SERVERROOT; OC::$APPSWEBROOT=OC::$WEBROOT; }elseif(file_exists(OC::$SERVERROOT.'/../apps')){ - $url_tmp=explode('/',OC::$WEBROOT); - $length=count($url_tmp); - unset($url_tmp[$length-1]); - OC::$APPSWEBROOT=implode('/',$url_tmp); - $root_tmp=explode('/',OC::$SERVERROOT); - $length=count($root_tmp); - unset($root_tmp[$length-1]); - OC::$APPSROOT=implode('/',$root_tmp); + OC::$APPSWEBROOT=rtrim(dirname(OC::$WEBROOT), '/'); + OC::$APPSROOT=rtrim(dirname(OC::$SERVERROOT), '/'); }else{ echo("apps directory not found! Please put the ownCloud apps folder in the ownCloud folder or the folder above. You can also configure the location in the config.php file."); exit; |