From 82c7598861db175617694891bb9f21b426426225 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Sun, 18 Sep 2011 19:37:54 +0200 Subject: Remove global vars and use the OC static version. Removed global vars are DOCUMENTROOT, SERVERROOT, SUBURI, WEBROOT and CONFIG_DATADIRECTORY --- lib/files.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'lib/files.php') 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 } } -- cgit v1.2.3