From e538e23c932a00ff8f7221e4fdb56a7b00f9c3d6 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sat, 10 Dec 2022 15:34:50 +0100 Subject: [PATCH] use dotclear method to check version --- _install.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/_install.php b/_install.php index 6ac3760..8c2f505 100644 --- a/_install.php +++ b/_install.php @@ -16,10 +16,9 @@ if (!defined('DC_CONTEXT_ADMIN')) { try { # Compare versions - if (version_compare( - dcCore::app()->getVersion('kUtRL'), - dcCore::app()->plugins->moduleInfo('kUtRL', 'version'), - '>=' + if (!dcCore::app()->newVersion( + basename(__DIR__), + dcCore::app()->plugins->moduleInfo(basename(__DIR__), 'version') )) { return null; } @@ -47,8 +46,8 @@ try { $changes = $ti->synchronize($t); # Settings - dcCore::app()->blog->settings->addNamespace('kUtRL'); - $s = dcCore::app()->blog->settings->kUtRL; + dcCore::app()->blog->settings->addNamespace(basename(__DIR__)); + $s = dcCore::app()->blog->settings->__get(basename(__DIR__)); $s->put('kutrl_active', false, 'boolean', 'Enabled kutrl plugin', false, true); $s->put('kutrl_plugin_service', 'default', 'string', 'Service to use to shorten links on third part plugins', false, true); $s->put('kutrl_admin_service', 'local', 'string', 'Service to use to shorten links on admin', false, true);