protected function _disable(PluginPackage $plugin)
    {
        $requiredBy = Plugin::checkReverseDependency($plugin->name);
        if (!empty($requiredBy)) {
            $names = [];
            foreach ($requiredBy as $p) {
                $names[] = $p->name();
            }

            $this->err(__d('installer', 'Plugin "{0}" cannot be disabled as it is required by: {1}', $plugin->humanName, implode(', ', $names)));

            return false;
        }

        if (!$this->params['no-callbacks']) {
            $trigger = $this->_triggerBeforeEvents($plugin);
            if (!$trigger) {
                return false;
            }
        }

        return $this->_finish($plugin);
    }
protected function _disable(PluginPackage $plugin)
    {
        $requiredBy = Plugin::checkReverseDependency($plugin->name);
        if (!empty($requiredBy)) {
            $names = [];
            foreach ($requiredBy as $p) {
                $names[] = $p->name();
            }

            $this->err(__d('installer', 'Plugin "{0}" cannot be disabled as it is required by: {1}', $plugin->humanName, implode(', ', $names)));

            return false;
        }

        if (!$this->params['no-callbacks']) {
            $trigger = $this->_triggerBeforeEvents($plugin);
            if (!$trigger) {
                return false;
            }
        }

        return $this->_finish($plugin);
    }
protected function _disable ( PluginPackage $ plugin ) { $ requiredBy = Plugin :: checkReverseDependency ( $ plugin -> name ) ; if ( ! empty ( $ requiredBy ) ) { $ names = [ ] ; foreach ( $ requiredBy as $ p ) { $ names [ ] = $ p -> name ( ) ; } $ this -> err ( __d ( 'installer' , 'Plugin "{0}" cannot be disabled as it is required by: {1}' , $ plugin -> humanName , implode ( ', ' , $ names ) ) ) ; return false ; } if ( ! $ this -> params [ 'no-callbacks' ] ) { $ trigger = $ this -> _triggerBeforeEvents ( $ plugin ) ; if ( ! $ trigger ) { return false ; } } return $ this -> _finish ( $ plugin ) ; }
Disables the given plugin.

@param \CMS\Core\Package\PluginPackage $plugin The plugin to disable
@return bool True on success
Disables the given plugin .