X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FDBUpdate.php;h=7b7c3b8c92d97c9ac9a6a636bdf98fa05e36150f;hb=4fe278be7d605810c0bb848d10d48344df186747;hp=0e1c9859bed0b2fd8ff05cd53d7053e7ad224e05;hpb=13f899542d4854d9a4c00632b31fce266f61f773;p=friendica.git diff --git a/src/Worker/DBUpdate.php b/src/Worker/DBUpdate.php index 0e1c9859be..7b7c3b8c92 100644 --- a/src/Worker/DBUpdate.php +++ b/src/Worker/DBUpdate.php @@ -1,18 +1,39 @@ . + * */ -namespace Friendica\Worker; -use Friendica\Core\Config; +namespace Friendica\Worker; -class DBUpdate { - public static function execute() { - // 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) != Update::FAILED) { + Update::run(DI::app()->getBasePath()); + } } }