It did not work...
Code
- /**
- * Register a callback for the given event(s).
- *
- * @param iMSCP_Events_Manager_Interface $controller
- */
- public function register(iMSCP_Events_Manager_Interface $controller)
- {
- $controller->registerListener(
- array(
- iMSCP_Events::onBeforeActivatePlugin,
- iMSCP_Events::onBeforePluginsRoute,
- iMSCP_Events::onResellerScriptStart,
- iMSCP_Events::onClientScriptStart,
- iMSCP_Events::onAfterDeleteCustomer,
- iMSCP_Events::onAfterAddDomainAlias,
- iMSCP_Events::onAfterDeleteDomainAlias,
- iMSCP_Events::onAfterEditDomain
- ),
- $this
- );
- }
- /**
- * onBeforeActivatePlugin event listener
- *
- * @param iMSCP_Events_Event $event
- */
- public function onBeforeActivatePlugin($event)
- {
- /** @var iMSCP_Config_Handler_File $cfg */
- $cfg = iMSCP_Registry::get('config');
- $stopPropagation = FALSE;
- if($event->getParam('action') == 'install') {
- if($cfg->Version <= 20130723) {
- set_page_message(
- tr('Your i-MSCP version is not compatible with this plugin. Try with a newer version'), 'error'
- );
- $stopPropagation = TRUE;
- }
- }
- }
I'd removed "$cfg->Version != 'Git Master'", because i wanted to rise up the error.
The plugin ignores this in my version.