no more need to set version

This commit is contained in:
Jean-Christian Denis 2022-12-07 23:58:40 +01:00
parent c5a341a106
commit c094da98cc
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951

View file

@ -14,14 +14,15 @@ if (!defined('DC_CONTEXT_ADMIN')) {
return null; return null;
} }
$new_version = dcCore::app()->plugins->moduleInfo('cinecturlink2', 'version'); try {
$old_version = dcCore::app()->getVersion('cinecturlink2'); if (version_compare(
dcCore::app()->getVersion('cinecturlink2'),
if (version_compare($old_version, $new_version, '>=')) { dcCore::app()->plugins->moduleInfo('cinecturlink2', 'version'),
return; '>='
)) {
return null;
} }
try {
$s = new dbStruct(dcCore::app()->con, dcCore::app()->prefix); $s = new dbStruct(dcCore::app()->con, dcCore::app()->prefix);
$s->{initCinecturlink2::CINECTURLINK_TABLE_NAME} $s->{initCinecturlink2::CINECTURLINK_TABLE_NAME}
->link_id('bigint', 0, false) ->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_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); $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; return true;
} catch (Exception $e) { } catch (Exception $e) {
dcCore::app()->error->add($e->getMessage()); dcCore::app()->error->add($e->getMessage());