From b5c6ff740a179d4f76f058c51546e28103feac5e Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Wed, 7 Dec 2022 23:59:20 +0100 Subject: [PATCH] no more need to set version --- _install.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/_install.php b/_install.php index ff94d8c..be14ef7 100644 --- a/_install.php +++ b/_install.php @@ -14,14 +14,15 @@ if (!defined('DC_CONTEXT_ADMIN')) { return null; } -$new_version = dcCore::app()->plugins->moduleInfo('dcAdvancedCleaner', 'version'); -$old_version = dcCore::app()->getVersion('dcAdvancedCleaner'); - -if (version_compare($old_version, $new_version, '>=')) { - return null; -} - try { + if (version_compare( + dcCore::app()->getVersion('dcAdvancedCleaner'), + dcCore::app()->plugins->moduleInfo('dcAdvancedCleaner', 'version'), + '>=' + )) { + return null; + } + dcCore::app()->blog->settings->addNamespace('dcAdvancedCleaner'); dcCore::app()->blog->settings->dcAdvancedCleaner->put( @@ -41,8 +42,6 @@ try { true ); - dcCore::app()->setVersion('dcAdvancedCleaner', $new_version); - return true; } catch (Exception $e) { dcCore::app()->error->add($e->getMessage());