use dotclear method to check version
parent
6f9334cbbf
commit
9bd94e05c1
14
_install.php
14
_install.php
|
@ -15,14 +15,10 @@ if (!defined('DC_CONTEXT_ADMIN')) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
# Grab info
|
|
||||||
$mod_id = basename(__DIR__);
|
|
||||||
|
|
||||||
# check installed version
|
# check installed 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;
|
||||||
}
|
}
|
||||||
|
@ -69,8 +65,8 @@ try {
|
||||||
);
|
);
|
||||||
|
|
||||||
# Transfert records from old table to the new one
|
# Transfert records from old table to the new one
|
||||||
if (dcCore::app()->getVersion($mod_id) !== null
|
if (dcCore::app()->getVersion(basename(__DIR__)) !== null
|
||||||
&& version_compare(dcCore::app()->getVersion($mod_id), '0.5', '<')
|
&& version_compare(dcCore::app()->getVersion(basename(__DIR__)), '0.5', '<')
|
||||||
) {
|
) {
|
||||||
require_once __DIR__ . '/inc/patch.0.5.php';
|
require_once __DIR__ . '/inc/patch.0.5.php';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue