From 074dc440cc1447493694181cce95cb336476eda3 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Mon, 14 Oct 2024 22:52:13 +0200 Subject: Change DB_Upgrade to a static function instead. No need for this to be an object, since it's never referenced or even kept after construction. Further all the functionality was in the constructor anyways. Also removed some unused properties. --- Zotlabs/Lib/DB_Upgrade.php | 8 +------- boot.php | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Zotlabs/Lib/DB_Upgrade.php b/Zotlabs/Lib/DB_Upgrade.php index 981c354a4..7e1016a73 100644 --- a/Zotlabs/Lib/DB_Upgrade.php +++ b/Zotlabs/Lib/DB_Upgrade.php @@ -6,13 +6,7 @@ use Zotlabs\Lib\Config; class DB_Upgrade { - public $config_name = ''; - public $func_prefix = ''; - - function __construct($db_revision) { - - $this->config_name = 'db_version'; - $this->func_prefix = '_'; + public static function run(int $db_revision): void { $build = Config::Get('system', 'db_version', 0); if(! intval($build)) diff --git a/boot.php b/boot.php index 66dba84c3..6d53f7f25 100644 --- a/boot.php +++ b/boot.php @@ -1545,7 +1545,7 @@ function check_config() { if (!$syschan_exists) create_sys_channel(); - new DB_Upgrade(DB_UPDATE_VERSION); + DB_Upgrade::run(DB_UPDATE_VERSION); plugins_sync(); -- cgit v1.2.3 From e2ae8f0c4d83060b2606f03b1c86d040c3161f18 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Mon, 14 Oct 2024 23:07:42 +0200 Subject: Zotlabs\Lib\DB_Upgrade: Add API documentation. --- Zotlabs/Lib/DB_Upgrade.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Zotlabs/Lib/DB_Upgrade.php b/Zotlabs/Lib/DB_Upgrade.php index 7e1016a73..e11c2eb10 100644 --- a/Zotlabs/Lib/DB_Upgrade.php +++ b/Zotlabs/Lib/DB_Upgrade.php @@ -1,11 +1,34 @@