From: Arthur Schiwon Date: Wed, 6 Jun 2012 15:29:57 +0000 (+0200) Subject: avoid too-early database access and thus make owncloud installable again X-Git-Tag: v4.5.0beta1~74^2~423^2~32 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6ca2b49292b610febf1e867e41f220dfa4e74a1e;p=nextcloud-server.git avoid too-early database access and thus make owncloud installable again --- diff --git a/lib/base.php b/lib/base.php index a439651f4a6..a65a33b166e 100644 --- a/lib/base.php +++ b/lib/base.php @@ -271,7 +271,7 @@ class OC{ ini_set('session.cookie_httponly','1;'); session_start(); } - + public static function loadapp(){ if(file_exists(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/index.php')){ require_once(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/index.php'); @@ -279,7 +279,7 @@ class OC{ trigger_error('The requested App was not found.', E_USER_ERROR);//load default app instead? } } - + public static function loadfile(){ if(file_exists(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE)){ if(substr(OC::$REQUESTEDFILE, -3) == 'css'){ @@ -289,7 +289,7 @@ class OC{ exit; }elseif(substr(OC::$REQUESTEDFILE, -3) == 'php'){ require_once(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE); - } + } }else{ header('HTTP/1.0 404 Not Found'); exit; @@ -300,7 +300,7 @@ class OC{ // register autoloader spl_autoload_register(array('OC','autoload')); setlocale(LC_ALL, 'en_US.UTF-8'); - + // set some stuff //ob_start(); error_reporting(E_ALL | E_STRICT); @@ -320,7 +320,7 @@ class OC{ //try to configure php to enable big file uploads. //this doesn´t work always depending on the webserver and php configuration. //Let´s try to overwrite some defaults anyways - + //try to set the maximum execution time to 60min @set_time_limit(3600); @ini_set('max_execution_time',3600); @@ -350,7 +350,7 @@ class OC{ $_SERVER['PHP_AUTH_USER'] = strip_tags($name); $_SERVER['PHP_AUTH_PW'] = strip_tags($password); } - + self::initPaths(); // register the stream wrappers @@ -368,7 +368,7 @@ class OC{ if(isset($refererhost['host'])) $refererhost=$refererhost['host']; else $refererhost=''; $server=OC_Helper::serverHost(); $serverhost=explode(':',$server); - $serverhost=$serverhost['0']; + $serverhost=$serverhost['0']; if(!self::$CLI){ if(($_SERVER['REQUEST_METHOD']=='POST') and ($refererhost<>$serverhost)) { $url = OC_Helper::serverProtocol().'://'.$server.OC::$WEBROOT.'/index.php'; @@ -419,16 +419,18 @@ class OC{ OC_App::loadApps(); } } - + // Check for blacklisted files OC_Hook::connect('OC_Filesystem','write','OC_Filesystem','isBlacklisted'); //make sure temporary files are cleaned up register_shutdown_function(array('OC_Helper','cleanTmp')); - if (!OC_AppConfig::getValue('core', 'remote_core.css', false)) { - OC_AppConfig::setValue('core', 'remote_core.css', '/core/minimizer.php'); - OC_AppConfig::setValue('core', 'remote_core.js', '/core/minimizer.php'); + if (OC_Config::getValue('installed', false)) { + if (!OC_AppConfig::getValue('core', 'remote_core.css', false)) { + OC_AppConfig::setValue('core', 'remote_core.css', '/core/minimizer.php'); + OC_AppConfig::setValue('core', 'remote_core.js', '/core/minimizer.php'); + } } //parse the given parameters @@ -482,7 +484,7 @@ if(!function_exists('get_temp_dir')) { return dirname($temp); } if( $temp=sys_get_temp_dir()) return $temp; - + return null; } }