Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-01-16 04:13:54 +0400
committerRobin Appelman <icewind@owncloud.com>2012-01-16 04:15:43 +0400
commit907dd4d24da80fa4f4ad5d6d469cd11d7c215f02 (patch)
tree19dfba573847083e1e8e282dcd43c6537b38ad3c /lib
parentda33229dab7aefee6f2de0ac6f128feaf767388b (diff)
some aditional feedback during database upgrade
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php6
-rw-r--r--lib/db.php11
2 files changed, 13 insertions, 4 deletions
diff --git a/lib/base.php b/lib/base.php
index 9531f7ed74f..ab7cb2990ed 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -156,7 +156,11 @@ class OC{
$installedVersion=OC_Config::getValue('version','0.0.0');
$currentVersion=implode('.',OC_Util::getVersion());
if (version_compare($currentVersion, $installedVersion, '>')) {
- OC_DB::updateDbFromStructure(OC::$SERVERROOT.'/db_structure.xml');
+ $result=OC_DB::updateDbFromStructure(OC::$SERVERROOT.'/db_structure.xml');
+ if(!$result){
+ echo 'Error while upgrading the database';
+ die();
+ }
OC_Config::setValue('version',implode('.',OC_Util::getVersion()));
}
diff --git a/lib/db.php b/lib/db.php
index f6eddf7825c..1a5f9874bd5 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -361,6 +361,11 @@ class OC_DB {
$content = file_get_contents( $file );
$previousSchema = self::$schema->getDefinitionFromDatabase();
+ if (PEAR::isError($previousSchema)) {
+ $error = $previousSchema->getMessage();
+ OC_Log::write('core','Failed to get existing database structure for upgrading ('.$error.')',OC_Log::FATAL);
+ return false;
+ }
// Make changes and save them to a temporary file
$file2 = tempnam( get_temp_dir(), 'oc_db_scheme_' );
@@ -376,9 +381,9 @@ class OC_DB {
unlink( $file2 );
if (PEAR::isError($op)) {
- $error = $op->getMessage();
- OC_Log::write('core','Failed to update database structure ('.$error.')',OC_Log::FATAL);
- return false;
+ $error = $op->getMessage();
+ OC_Log::write('core','Failed to update database structure ('.$error.')',OC_Log::FATAL);
+ return false;
}
return true;
}