lazy way to get dc_min
parent
e557293f80
commit
9645614c56
11
_install.php
11
_install.php
|
@ -33,8 +33,6 @@ use Exception;
|
|||
*/
|
||||
class install
|
||||
{
|
||||
/** @var string Dotclear minimal version */
|
||||
private static $dotclear_version = '2.24';
|
||||
/** @var array Improve default settings */
|
||||
private static $default_settings = [[
|
||||
'disabled',
|
||||
|
@ -52,7 +50,7 @@ class install
|
|||
throw new Exception(sprintf(
|
||||
'%s requires Dotclear %s',
|
||||
'improve',
|
||||
self::$dotclear_version
|
||||
self::getDotclearVersion()
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -64,6 +62,11 @@ class install
|
|||
return true;
|
||||
}
|
||||
|
||||
private static function getDotclearVersion(): string
|
||||
{
|
||||
return dcCore::app()->plugins->moduleInfo('improve', 'requires')[0][1];
|
||||
}
|
||||
|
||||
private static function getInstalledVersion(): string
|
||||
{
|
||||
$version = dcCore::app()->getVersion('improve');
|
||||
|
@ -83,7 +86,7 @@ class install
|
|||
private static function checkDotclearVersion(): bool
|
||||
{
|
||||
return method_exists('dcUtils', 'versionsCompare')
|
||||
&& dcUtils::versionsCompare(DC_VERSION, self::$dotclear_version, '>=', false);
|
||||
&& dcUtils::versionsCompare(DC_VERSION, self::getDotclearVersion(), '>=', false);
|
||||
}
|
||||
|
||||
private static function putSettings(): void
|
||||
|
|
Loading…
Reference in New Issue