]> git.mxchange.org Git - friendica.git/commitdiff
dbupdate now moved as well
authorMichael <heluecht@pirati.ca>
Sat, 18 Nov 2017 07:31:33 +0000 (07:31 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 18 Nov 2017 07:31:33 +0000 (07:31 +0000)
boot.php
include/dbupdate.php [deleted file]
src/Worker/Cron.php
src/Worker/CronHooks.php
src/Worker/DBClean.php
src/Worker/DBUpdate.php [new file with mode: 0644]

index 8492701a0c2db1ff9b97d9d2d42f7db4376ab955..52026a7fb31cc52dc6c8e9710b8063b4eb42a567 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -630,7 +630,7 @@ function check_db($via_worker)
        }
        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());
                }
        }
diff --git a/include/dbupdate.php b/include/dbupdate.php
deleted file mode 100644 (file)
index 799ca26..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<?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);
-}
index 1893a862e81793cda0ee3a8bbf01246ea8ebf0a8..21b76903bbfdfa83370a1555c9a576b2ac775fd8 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+/**
+ * @file src/Worker/Cron.php
+ */
 namespace Friendica\Worker;
 
 use Friendica\Core\Config;
index 42670eb2380f514dfe559c362c4ce1c2da21a537..22109931feb75703215573ed36b6c5dd6f94fc26 100644 (file)
@@ -1,4 +1,8 @@
 <?php
+/**
+ * @file src/Worker/CronHooks.php
+ */
+
 namespace Friendica\Worker;
 
 use Friendica\Core\Config;
index 94295b053ef26fa5f498afd9daeb8352e0c8d618..7030081dc98d5ab17608c2a05c8daf62f91a2330 100644 (file)
@@ -4,6 +4,8 @@
  * @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;
diff --git a/src/Worker/DBUpdate.php b/src/Worker/DBUpdate.php
new file mode 100644 (file)
index 0000000..0e1c985
--- /dev/null
@@ -0,0 +1,18 @@
+<?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);
+       }
+}