Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
In SERVER_DEBUG mode, try to detect if a DB version is necessary, and…
Browse files Browse the repository at this point in the history
… log it both in the Pydio logs and generic error_log.
  • Loading branch information
cdujeu committed Nov 2, 2015
1 parent 8967c6d commit 7a5421d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions core/src/plugins/conf.sql/class.sqlConfDriver.php
Expand Up @@ -58,6 +58,18 @@ public function init($options)
$this->sqlDriver = AJXP_Utils::cleanDibiDriverParameters($options["SQL_DRIVER"]);
try {
dibi::connect($this->sqlDriver);
if(AJXP_SERVER_DEBUG && AJXP_VERSION_DB != "##DB_VERSION##"){
$res = dibi::query("select MAX(db_build) from [ajxp_version]");
if(!empty($res)){
$dbVersion = intval($res->fetchSingle());
$current = intval(AJXP_VERSION_DB);
if($dbVersion > 0 && $dbVersion < $current){
// We need to upgrade now!
error_log("[Pydio] DB Upgrade Required! You may encounter strange issues. Make sure to manually apply the DB update.");
$this->logError("[DB]", "DB Upgrade Required! You may encounter strange issues. Make sure to manually apply the DB update.");
}
}
}
} catch (DibiException $e) {
//throw $e;
echo get_class($e), ': ', $e->getMessage(), "\n";
Expand Down

0 comments on commit 7a5421d

Please sign in to comment.