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/config.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/config.php')
-rw-r--r-- | lib/config.php | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/config.php b/lib/config.php index dafb37edd33..67df5e94c6d 100644 --- a/lib/config.php +++ b/lib/config.php @@ -131,14 +131,12 @@ class OC_Config{ return true; } - global $SERVERROOT; - - if( !file_exists( "$SERVERROOT/config/config.php" )){ + if( !file_exists( OC::$SERVERROOT."/config/config.php" )){ return false; } // Include the file, save the data from $CONFIG - include( "$SERVERROOT/config/config.php" ); + include( OC::$SERVERROOT."/config/config.php" ); if( isset( $CONFIG ) && is_array( $CONFIG )){ self::$cache = $CONFIG; } @@ -158,9 +156,6 @@ class OC_Config{ * Known flaws: Strings are not escaped properly */ public static function writeData(){ - // We need the serverroot path - global $SERVERROOT; - // Create a php file ... $content = "<?php\n\$CONFIG = array(\n"; @@ -177,7 +172,7 @@ class OC_Config{ $content .= ");\n?>\n"; // Write the file - $result=@file_put_contents( "$SERVERROOT/config/config.php", $content ); + $result=@file_put_contents( OC::$SERVERROOT."/config/config.php", $content ); if(!$result) { $tmpl = new OC_Template( '', 'error', 'guest' ); $tmpl->assign('errors',array(1=>array('error'=>"Can't write into config directory 'config'",'hint'=>"You can usually fix this by setting the owner of 'config' to the user that the web server uses (".exec('whoami').")"))); |