diff options
author | Bart Visscher <bart@thisnet.nl> | 2011-09-18 19:37:54 +0200 |
---|---|---|
committer | Bart Visscher <bart@thisnet.nl> | 2011-09-18 19:37:54 +0200 |
commit | 82c7598861db175617694891bb9f21b426426225 (patch) | |
tree | fce8fb4717b4cc2a5dc6da8835bdb51b5fb40054 /lib/files.php | |
parent | d5656716f69caa6a1eb98706994ffcb9a08553a7 (diff) | |
download | nextcloud-server-82c7598861db175617694891bb9f21b426426225.tar.gz nextcloud-server-82c7598861db175617694891bb9f21b426426225.zip |
Remove global vars and use the OC static version.
Removed global vars are DOCUMENTROOT, SERVERROOT, SUBURI, WEBROOT and CONFIG_DATADIRECTORY
Diffstat (limited to 'lib/files.php')
-rw-r--r-- | lib/files.php | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/files.php b/lib/files.php index f1789d9c7ac..84dc9fd1c53 100644 --- a/lib/files.php +++ b/lib/files.php @@ -33,9 +33,8 @@ class OC_Files { * @param dir $directory */ public static function getDirectoryContent($directory){ - global $CONFIG_DATADIRECTORY; - if(strpos($directory,$CONFIG_DATADIRECTORY)===0){ - $directory=substr($directory,strlen($CONFIG_DATADIRECTORY)); + if(strpos($directory,OC::$CONFIG_DATADIRECTORY)===0){ + $directory=substr($directory,strlen(OC::$CONFIG_DATADIRECTORY)); } $filesfound=true; $content=array(); @@ -279,16 +278,14 @@ class OC_Files { * @param int size filesisze in bytes */ static function setUploadLimit($size){ - global $SERVERROOT; - global $WEBROOT; $size=OC_Helper::humanFileSize($size); $size=substr($size,0,-1);//strip the B $size=str_replace(' ','',$size); //remove the space between the size and the postfix - $content = "ErrorDocument 404 /$WEBROOT/core/templates/404.php\n";//custom 404 error page + $content = "ErrorDocument 404 /".OC::$WEBROOT."/core/templates/404.php\n";//custom 404 error page $content.= "php_value upload_max_filesize $size\n";//upload limit $content.= "php_value post_max_size $size\n"; $content.= "SetEnv htaccessWorking true\n"; $content.= "Options -Indexes\n"; - @file_put_contents($SERVERROOT.'/.htaccess', $content); //supress errors in case we don't have permissions for it + @file_put_contents(OC::$SERVERROOT.'/.htaccess', $content); //supress errors in case we don't have permissions for it } } |