1
1
Fork 0

moved check_db($via_worker) to Update::check($via_worker)

This commit is contained in:
Philipp Holzer 2018-10-14 13:26:53 +02:00
commit ffbad2dc81
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
3 changed files with 29 additions and 28 deletions

View file

@ -413,33 +413,6 @@ function defaults() {
return $return;
}
/**
* @brief Function to check if request was an AJAX (xmlhttprequest) request.
*
* @param boolean $via_worker boolean Is the check run via the worker?
*/
function check_db($via_worker)
{
$build = Config::get('system', 'build');
if (empty($build)) {
Config::set('system', 'build', DB_UPDATE_VERSION - 1);
$build = DB_UPDATE_VERSION - 1;
}
// We don't support upgrading from very old versions anymore
if ($build < NEW_UPDATE_ROUTINE_VERSION) {
die('You try to update from a version prior to database version 1170. The direct upgrade path is not supported. Please update to version 3.5.4 before updating to this version.');
}
if ($build < DB_UPDATE_VERSION) {
// When we cannot execute the database update via the worker, we will do it directly
if (!Worker::add(PRIORITY_CRITICAL, 'DBUpdate') && $via_worker) {
Update::run();
}
}
}
/**
* @brief Automatic database updates
* @param object $a App