no more need to set version
parent
d9c2a2bab5
commit
57776fbe09
14
_install.php
14
_install.php
|
@ -15,12 +15,12 @@ if (!defined('DC_CONTEXT_ADMIN')) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
# Grab info
|
if (version_compare(
|
||||||
$mod_id = basename(__DIR__);
|
dcCore::app()->getVersion(basename(__DIR__)),
|
||||||
$version = dcCore::app()->plugins->moduleInfo($mod_id, 'version');
|
dcCore::app()->plugins->moduleInfo(basename(__DIR__), 'version'),
|
||||||
|
'>='
|
||||||
if (version_compare(dcCore::app()->getVersion($mod_id), $version, '>=')) {
|
)) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$s = new dbStruct(dcCore::app()->con, dcCore::app()->prefix);
|
$s = new dbStruct(dcCore::app()->con, dcCore::app()->prefix);
|
||||||
|
@ -42,8 +42,6 @@ try {
|
||||||
$si = new dbStruct(dcCore::app()->con, dcCore::app()->prefix);
|
$si = new dbStruct(dcCore::app()->con, dcCore::app()->prefix);
|
||||||
$changes = $si->synchronize($s);
|
$changes = $si->synchronize($s);
|
||||||
|
|
||||||
dcCore::app()->setVersion($mod_id, $version);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
dcCore::app()->error->add($e->getMessage());
|
dcCore::app()->error->add($e->getMessage());
|
||||||
|
|
Loading…
Reference in New Issue