2017-11-18 02:31:33 -05:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @file src/Worker/DBUpdate.php
|
|
|
|
* @brief This file is called when the database structure needs to be updated
|
|
|
|
*/
|
|
|
|
namespace Friendica\Worker;
|
|
|
|
|
|
|
|
use Friendica\Core\Config;
|
|
|
|
|
2018-07-09 22:39:59 -04:00
|
|
|
class DBUpdate
|
|
|
|
{
|
|
|
|
public static function execute()
|
|
|
|
{
|
|
|
|
$a = \Friendica\BaseObject::getApp();
|
2017-11-18 18:46:16 -05:00
|
|
|
|
2017-11-18 02:31:33 -05:00
|
|
|
// 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);
|
|
|
|
}
|
|
|
|
}
|