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/setup.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/setup.php')
-rw-r--r-- | lib/setup.php | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/setup.php b/lib/setup.php index ebdf3ef823e..7183eb624a8 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -3,7 +3,7 @@ $hasSQLite = (is_callable('sqlite_open') or class_exists('SQLite3')); $hasMySQL = is_callable('mysql_connect'); $hasPostgreSQL = is_callable('pg_connect'); -$datadir = OC_Config::getValue('datadirectory', $SERVERROOT.'/data'); +$datadir = OC_Config::getValue('datadirectory', OC::$SERVERROOT.'/data'); $opts = array( 'hasSQLite' => $hasSQLite, 'hasMySQL' => $hasMySQL, @@ -23,7 +23,7 @@ if(isset($_POST['install']) AND $_POST['install']=='true') { OC_Template::printGuestPage("", "installation", $options); } else { - header("Location: ".$WEBROOT.'/'); + header("Location: ".OC::$WEBROOT.'/'); exit(); } } @@ -270,21 +270,19 @@ class OC_Setup { * create .htaccess files for apache hosts */ private static function createHtaccess() { - $SERVERROOT=OC::$SERVERROOT; - $WEBROOT=OC::$WEBROOT; - $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.= "<IfModule mod_php5.c>\n"; $content.= "php_value upload_max_filesize 512M\n";//upload limit $content.= "php_value post_max_size 512M\n"; $content.= "SetEnv htaccessWorking true\n"; $content.= "</IfModule>\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 $content = "deny from all\n"; $content.= "IndexIgnore *"; - file_put_contents(OC_Config::getValue('datadirectory', $SERVERROOT.'/data').'/.htaccess', $content); - file_put_contents(OC_Config::getValue('datadirectory', $SERVERROOT.'/data').'/index.html', ''); + file_put_contents(OC_Config::getValue('datadirectory', OC::$SERVERROOT.'/data').'/.htaccess', $content); + file_put_contents(OC_Config::getValue('datadirectory', OC::$SERVERROOT.'/data').'/index.html', ''); } } |