X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FDBUpdate.php;h=322fa349298bae9da171c7109a1ad2687fc8a0e3;hb=f6faae5bb10299c81ab4ca2e94463246e47cacf7;hp=5f85c8ebefbd2ffb00a39cf477a3f0f2b742991c;hpb=02e4cf2a02ce59af29daf2cfd2f3749d3a68e23a;p=friendica.git diff --git a/src/Worker/DBUpdate.php b/src/Worker/DBUpdate.php index 5f85c8ebef..322fa34929 100644 --- a/src/Worker/DBUpdate.php +++ b/src/Worker/DBUpdate.php @@ -1,20 +1,39 @@ . + * */ -namespace Friendica\Worker; - -use Friendica\Core\Config; -class DBUpdate { - public static function execute() { - $a = get_app(); +namespace Friendica\Worker; - // 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); +use Friendica\Core\Update; +use Friendica\DI; - update_db($a); +/** + * This file is called when the database structure needs to be updated + */ +class DBUpdate +{ + public static function execute() + { + // Just in case the last update wasn't failed + if (DI::config()->get('system', 'update', Update::SUCCESS, true) != Update::FAILED) { + Update::run(DI::app()->getBasePath()); + } } }