X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FDBUpdate.php;h=c1f3b12ef05f40a221abeaae2e1a12eb03fa7707;hb=69d7391f90a45f166ffff6379701d9c58b56c14d;hp=5f85c8ebefbd2ffb00a39cf477a3f0f2b742991c;hpb=29f7ebe307c22b275466390937b82ccb3820fb1c;p=friendica.git diff --git a/src/Worker/DBUpdate.php b/src/Worker/DBUpdate.php index 5f85c8ebef..c1f3b12ef0 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()); + } } }