From c094da98cc38c17f7f1b3ae6feb788c6387b4997 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Wed, 7 Dec 2022 23:58:40 +0100 Subject: [PATCH] no more need to set version --- _install.php | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/_install.php b/_install.php index 34cf31c..da2b59f 100644 --- a/_install.php +++ b/_install.php @@ -14,14 +14,15 @@ if (!defined('DC_CONTEXT_ADMIN')) { return null; } -$new_version = dcCore::app()->plugins->moduleInfo('cinecturlink2', 'version'); -$old_version = dcCore::app()->getVersion('cinecturlink2'); - -if (version_compare($old_version, $new_version, '>=')) { - return; -} - try { + if (version_compare( + dcCore::app()->getVersion('cinecturlink2'), + dcCore::app()->plugins->moduleInfo('cinecturlink2', 'version'), + '>=' + )) { + return null; + } + $s = new dbStruct(dcCore::app()->con, dcCore::app()->prefix); $s->{initCinecturlink2::CINECTURLINK_TABLE_NAME} ->link_id('bigint', 0, false) @@ -77,11 +78,6 @@ try { $s->put('cinecturlink2_public_nbrpp', 20, 'integer', 'Number of entries per page on public page', false, true); $s->put('cinecturlink2_public_caturl', 'c2cat', 'string', 'Part of URL for a category list', false, true); - dcCore::app()->setVersion( - 'cinecturlink2', - dcCore::app()->plugins->moduleInfo('cinecturlink2', 'version') - ); - return true; } catch (Exception $e) { dcCore::app()->error->add($e->getMessage());