no more need to set version
This commit is contained in:
parent
bd362a6700
commit
61c905460f
1 changed files with 9 additions and 13 deletions
16
_install.php
16
_install.php
|
@ -14,17 +14,16 @@ if (!defined('DC_CONTEXT_ADMIN')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get new version
|
try {
|
||||||
$new_version = dcCore::app()->plugins->moduleInfo('kUtRL', 'version');
|
|
||||||
$old_version = dcCore::app()->getVersion('kUtRL');
|
|
||||||
|
|
||||||
# Compare versions
|
# Compare versions
|
||||||
if (version_compare($old_version, $new_version, '>=')) {
|
if (version_compare(
|
||||||
|
dcCore::app()->getVersion('kUtRL'),
|
||||||
|
dcCore::app()->plugins->moduleInfo('kUtRL', 'version'),
|
||||||
|
'>='
|
||||||
|
)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Install or update
|
|
||||||
try {
|
|
||||||
# Table
|
# Table
|
||||||
$t = new dbStruct(dcCore::app()->con, dcCore::app()->prefix);
|
$t = new dbStruct(dcCore::app()->con, dcCore::app()->prefix);
|
||||||
$t->{initkUtRL::KURL_TABLE_NAME}
|
$t->{initkUtRL::KURL_TABLE_NAME}
|
||||||
|
@ -73,9 +72,6 @@ try {
|
||||||
$s->put('kutrl_srv_yourls_username', '', 'string', 'User name to YOURLS service', false, true);
|
$s->put('kutrl_srv_yourls_username', '', 'string', 'User name to YOURLS service', false, true);
|
||||||
$s->put('kutrl_srv_yourls_password', '', 'string', 'User password to YOURLS service', false, true);
|
$s->put('kutrl_srv_yourls_password', '', 'string', 'User password to YOURLS service', false, true);
|
||||||
|
|
||||||
# Version
|
|
||||||
dcCore::app()->setVersion('kUtRL', $new_version);
|
|
||||||
|
|
||||||
# Get dcMiniUrl records as this plugin do the same
|
# Get dcMiniUrl records as this plugin do the same
|
||||||
if (dcCore::app()->plugins->moduleExists('dcMiniUrl')) {
|
if (dcCore::app()->plugins->moduleExists('dcMiniUrl')) {
|
||||||
require_once __DIR__ . '/inc/patch.dcminiurl.php';
|
require_once __DIR__ . '/inc/patch.dcminiurl.php';
|
||||||
|
|
Loading…
Reference in a new issue