public function uninstallPlugin($pluginSlug, Errors $errors, $purge = false)
    {

        $log = "";

        $plugin = $this->PluginService->getBySlug($pluginSlug);

        if (empty($plugin) || !$plugin->isInstalled()) {
            $log .= "Plugin not installed.";
            return array($log,'fail');
        }

        $pluginPath = $plugin->getPath();

        $log .= "Uninstalling plugin: {$pluginSlug}\n";

        $plugin->Enabled = false;
        $plugin->Installed = false;

        $this->PluginService->edit($plugin);

        $log .= "Plugin uninstalled...\n";
        $log .= "ID: {$plugin->PluginID}\n";
        $log .= "Slug: {$plugin->Slug}\n";
        $log .= "Title: {$plugin->Title}\n";
        $log .= "Description: {$plugin->Description}\n";
        $log .= "Md5: {$plugin->Md5}\n";
        $log .= "\n";


        if ($purge) {
            $this->uninstallAspects($plugin);
            $this->uninstallCMSNavItems($plugin);
        }

        //SUCCESS!

        $this->ApplicationContext->clearContextFiles();

        $log .= "\nSUCCESS!\n\n";
        return array($log, strpos($log, 'WARNING')=== FALSE?'success':'warn');

    }
public function uninstallPlugin($pluginSlug, Errors $errors, $purge = false)
    {

        $log = "";

        $plugin = $this->PluginService->getBySlug($pluginSlug);

        if (empty($plugin) || !$plugin->isInstalled()) {
            $log .= "Plugin not installed.";
            return array($log,'fail');
        }

        $pluginPath = $plugin->getPath();

        $log .= "Uninstalling plugin: {$pluginSlug}\n";

        $plugin->Enabled = false;
        $plugin->Installed = false;

        $this->PluginService->edit($plugin);

        $log .= "Plugin uninstalled...\n";
        $log .= "ID: {$plugin->PluginID}\n";
        $log .= "Slug: {$plugin->Slug}\n";
        $log .= "Title: {$plugin->Title}\n";
        $log .= "Description: {$plugin->Description}\n";
        $log .= "Md5: {$plugin->Md5}\n";
        $log .= "\n";


        if ($purge) {
            $this->uninstallAspects($plugin);
            $this->uninstallCMSNavItems($plugin);
        }

        //SUCCESS!

        $this->ApplicationContext->clearContextFiles();

        $log .= "\nSUCCESS!\n\n";
        return array($log, strpos($log, 'WARNING')=== FALSE?'success':'warn');

    }
public function uninstallPlugin ( $ pluginSlug , Errors $ errors , $ purge = false ) { $ log = "" ; $ plugin = $ this -> PluginService -> getBySlug ( $ pluginSlug ) ; if ( empty ( $ plugin ) || ! $ plugin -> isInstalled ( ) ) { $ log .= "Plugin not installed." ; return array ( $ log , 'fail' ) ; } $ pluginPath = $ plugin -> getPath ( ) ; $ log .= "Uninstalling plugin: {$pluginSlug}\n" ; $ plugin -> Enabled = false ; $ plugin -> Installed = false ; $ this -> PluginService -> edit ( $ plugin ) ; $ log .= "Plugin uninstalled...\n" ; $ log .= "ID: {$plugin->PluginID}\n" ; $ log .= "Slug: {$plugin->Slug}\n" ; $ log .= "Title: {$plugin->Title}\n" ; $ log .= "Description: {$plugin->Description}\n" ; $ log .= "Md5: {$plugin->Md5}\n" ; $ log .= "\n" ; if ( $ purge ) { $ this -> uninstallAspects ( $ plugin ) ; $ this -> uninstallCMSNavItems ( $ plugin ) ; } //SUCCESS! $ this -> ApplicationContext -> clearContextFiles ( ) ; $ log .= "\nSUCCESS!\n\n" ; return array ( $ log , strpos ( $ log , 'WARNING' ) === FALSE ? 'success' : 'warn' ) ; }
Removes the specified plugin

@param string  $pluginSlug The slug of the plugin to remove
@param Errors  $errors     An errors object to update if things go wrong
@param boolean $purge      If true, then uninstall all elements and aspects from the plugin as well

@return array 2 items in this array. First, the log, second is a boolean indicating success (true on successful install)
Removes the specified plugin