Created
August 17, 2020 13:10
-
-
Save gartes/a3d83098fff297f718e6d340b0e64395 to your computer and use it in GitHub Desktop.
1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Отменить, если устанавливаемый модуль не новее, чем текущая установленная версия | |
# Abort if the module being installed is not newer than the currently installed version | |
/* if (strtolower($typeExt) === 'update') | |
{ | |
$manifest = $this->getItemArray( Factory::getDbo()->quote($this->extension)); | |
$oldRelease = $manifest['version']; | |
# Кто-то пытается установить более раннюю версию, чем установлена сейчас | |
# Someone is trying to install a lower version than is currently installed | |
if (version_compare($this->release, $oldRelease, '<')) | |
{ | |
# Выдать сообщение об ошибке и вернуть false | |
# Throw some error message and return false | |
$this->app->enqueueMessage('Error msg' , 'error' ) ; | |
return false; | |
} | |
# Устанавливаемая версия выше той, которая установлена в настоящее время | |
# The version being installed is higher than what is currently installed | |
if (version_compare($oldRelease, $this->release, '<')) | |
{ | |
# Здесь вы можете выполнить функцию | |
# You can execute a function here | |
# Если вы хотите сравнить конкретную версию. | |
# If you want to compare a specific version. | |
if (version_compare($oldRelease, '2.0.0', '<=')) | |
{ | |
# Функция обновления для версии 2.0.0 | |
# Update function for version 2.0.0 | |
# $this->updateToVersionTwo(); | |
} | |
} | |
}*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
version_compare - in script.php