}
if ($build != DB_UPDATE_VERSION) {
// When we cannot execute the database update via the worker, we will do it directly
- if (!Worker::add(PRIORITY_CRITICAL, 'dbupdate') && $via_worker) {
+ if (!Worker::add(PRIORITY_CRITICAL, 'DBUpdate') && $via_worker) {
update_db(get_app());
}
}
+++ /dev/null
-<?php
-
-use Friendica\Core\Config;
-
-function dbupdate_run(&$argv, &$argc) {
- global $a;
-
- // 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);
-}
<?php
+/**
+ * @file src/Worker/Cron.php
+ */
namespace Friendica\Worker;
use Friendica\Core\Config;
<?php
+/**
+ * @file src/Worker/CronHooks.php
+ */
+
namespace Friendica\Worker;
use Friendica\Core\Config;
* @brief The script is called from time to time to clean the database entries and remove orphaned data.
*/
+namespace Friendica\Worker;
+
use Friendica\Core\Config;
use Friendica\Core\Worker;
use dba;
--- /dev/null
+<?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;
+
+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);
+
+ update_db($a);
+ }
+}