X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FDBUpdate.php;h=7b7c3b8c92d97c9ac9a6a636bdf98fa05e36150f;hb=4fe278be7d605810c0bb848d10d48344df186747;hp=ed8e409e987ab0a6c942328b9448051e81f58747;hpb=2fa6cc000013089d59d9cc221b544ed1a7a4cd37;p=friendica.git diff --git a/src/Worker/DBUpdate.php b/src/Worker/DBUpdate.php index ed8e409e98..7b7c3b8c92 100644 --- a/src/Worker/DBUpdate.php +++ b/src/Worker/DBUpdate.php @@ -1,22 +1,39 @@ . + * */ + namespace Friendica\Worker; -use Friendica\Core\Config; +use Friendica\Core\Update; +use Friendica\DI; +/** + * This file is called when the database structure needs to be updated + */ class DBUpdate { public static function execute() { - $a = \Friendica\BaseObject::getApp(); - - // We are deleting the latest dbupdate entry. - // This is done to avoid endless loops because the update was interupted. - Config::delete('database', 'dbupdate_'.DB_UPDATE_VERSION); - - update_db($a); + // Just in case the last update wasn't failed + if (DI::config()->get('system', 'update', Update::SUCCESS) != Update::FAILED) { + Update::run(DI::app()->getBasePath()); + } } }