use dotclear method to check version
This commit is contained in:
parent
1f277de153
commit
4ec48f950e
24
_install.php
24
_install.php
@ -81,31 +81,17 @@ $mod_conf = [
|
|||||||
|
|
||||||
# -- Nothing to change below --
|
# -- Nothing to change below --
|
||||||
try {
|
try {
|
||||||
# Grab info
|
|
||||||
$mod_id = basename(__DIR__);
|
|
||||||
$dc_min = dcCore::app()->plugins->moduleInfo($mod_id, 'requires')[0][1];
|
|
||||||
|
|
||||||
# Check module version
|
# Check module version
|
||||||
if (version_compare(
|
if (!dcCore::app()->newVersion(
|
||||||
dcCore::app()->getVersion($mod_id),
|
basename(__DIR__),
|
||||||
dcCore::app()->plugins->moduleInfo($mod_id, 'version'),
|
dcCore::app()->plugins->moduleInfo(basename(__DIR__), 'version')
|
||||||
'>='
|
|
||||||
)) {
|
)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
# Check Dotclear version
|
|
||||||
if (!method_exists('dcUtils', 'versionsCompare')
|
|
||||||
|| dcUtils::versionsCompare(DC_VERSION, $dc_min, '<', false)) {
|
|
||||||
throw new Exception(sprintf(
|
|
||||||
'%s requires Dotclear %s',
|
|
||||||
$mod_id,
|
|
||||||
$dc_min
|
|
||||||
));
|
|
||||||
}
|
|
||||||
# Set module settings
|
# Set module settings
|
||||||
dcCore::app()->blog->settings->addNamespace($mod_id);
|
dcCore::app()->blog->settings->addNamespace(basename(__DIR__));
|
||||||
foreach ($mod_conf as $v) {
|
foreach ($mod_conf as $v) {
|
||||||
dcCore::app()->blog->settings->{$mod_id}->put(
|
dcCore::app()->blog->settings->__get(basename(__DIR__))->put(
|
||||||
$v[0],
|
$v[0],
|
||||||
$v[2],
|
$v[2],
|
||||||
$v[3],
|
$v[3],
|
||||||
|
Loading…
Reference in New Issue
Block a user