use dotclear method to check version

This commit is contained in:
Jean-Christian Paul Denis 2022-12-10 15:34:50 +01:00
parent cd0fbd47b0
commit e538e23c93
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951

View File

@ -16,10 +16,9 @@ if (!defined('DC_CONTEXT_ADMIN')) {
try { try {
# Compare versions # Compare versions
if (version_compare( if (!dcCore::app()->newVersion(
dcCore::app()->getVersion('kUtRL'), basename(__DIR__),
dcCore::app()->plugins->moduleInfo('kUtRL', 'version'), dcCore::app()->plugins->moduleInfo(basename(__DIR__), 'version')
'>='
)) { )) {
return null; return null;
} }
@ -47,8 +46,8 @@ try {
$changes = $ti->synchronize($t); $changes = $ti->synchronize($t);
# Settings # Settings
dcCore::app()->blog->settings->addNamespace('kUtRL'); dcCore::app()->blog->settings->addNamespace(basename(__DIR__));
$s = dcCore::app()->blog->settings->kUtRL; $s = dcCore::app()->blog->settings->__get(basename(__DIR__));
$s->put('kutrl_active', false, 'boolean', 'Enabled kutrl plugin', false, true); $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_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); $s->put('kutrl_admin_service', 'local', 'string', 'Service to use to shorten links on admin', false, true);