From 61c905460f51532f84d51095e7746626095a76ae Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Thu, 8 Dec 2022 00:10:29 +0100 Subject: [PATCH] no more need to set version --- _install.php | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/_install.php b/_install.php index 4580adc..6ac3760 100644 --- a/_install.php +++ b/_install.php @@ -14,17 +14,16 @@ if (!defined('DC_CONTEXT_ADMIN')) { return; } -# Get new version -$new_version = dcCore::app()->plugins->moduleInfo('kUtRL', 'version'); -$old_version = dcCore::app()->getVersion('kUtRL'); - -# Compare versions -if (version_compare($old_version, $new_version, '>=')) { - return null; -} - -# Install or update try { + # Compare versions + if (version_compare( + dcCore::app()->getVersion('kUtRL'), + dcCore::app()->plugins->moduleInfo('kUtRL', 'version'), + '>=' + )) { + return null; + } + # Table $t = new dbStruct(dcCore::app()->con, dcCore::app()->prefix); $t->{initkUtRL::KURL_TABLE_NAME} @@ -73,9 +72,6 @@ try { $s->put('kutrl_srv_yourls_username', '', 'string', 'User name to YOURLS service', false, true); $s->put('kutrl_srv_yourls_password', '', 'string', 'User password to YOURLS service', false, true); - # Version - dcCore::app()->setVersion('kUtRL', $new_version); - # Get dcMiniUrl records as this plugin do the same if (dcCore::app()->plugins->moduleExists('dcMiniUrl')) { require_once __DIR__ . '/inc/patch.dcminiurl.php';