aboutsummaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-11-13 16:16:21 +0100
committerRobin Appelman <icewind1991@gmail.com>2011-11-13 16:16:21 +0100
commitb2f1429b75085eaa3dc2be37df43283b47cd1e39 (patch)
tree2d3ee5c8117d84d459993122e38d5713e8bbde49 /lib/base.php
parentaa7c5a971ce9431c0a51e1110046f211fa446c11 (diff)
downloadnextcloud-server-b2f1429b75085eaa3dc2be37df43283b47cd1e39.tar.gz
nextcloud-server-b2f1429b75085eaa3dc2be37df43283b47cd1e39.zip
automatically upgrade the main database on version number increase (doesnt work with sqlite for now)
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/base.php b/lib/base.php
index c52b4493e01..554036164e6 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -119,6 +119,12 @@ class OC{
}
}
+ $installedVersion=OC_Config::getValue('version','0.0.0');
+ $currentVersion=implode('.',OC_Util::getVersion());
+ if (version_compare($currentVersion, $installedVersion, '>')) {
+ OC_DB::updateDbFromStructure('../db_structure.xml');
+ }
+
ini_set('session.cookie_httponly','1;');
session_start();
@@ -187,8 +193,6 @@ if( !isset( $RUNTIME_NOAPPS )){
$RUNTIME_NOAPPS = false;
}
-OC::init();
-
if(!function_exists('get_temp_dir')) {
function get_temp_dir() {
if( $temp=ini_get('upload_tmp_dir') ) return $temp;
@@ -204,6 +208,8 @@ if(!function_exists('get_temp_dir')) {
}
}
+OC::init();
+
require_once('fakedirstream.php');
// FROM search.php