public function delete($pluginName)
    {
        $plugin = plugin($pluginName); // throws if not exists
        $task = (bool)WebShellDispatcher::run("Installer.plugins uninstall -p {$plugin->name}");

        if ($task) {
            $this->Flash->success(__d('system', 'Plugin was successfully removed!'));
        } else {
            $this->Flash->set(__d('system', 'Plugins could not be removed'), [
                'element' => 'System.installer_errors',
                'params' => ['errors' => WebShellDispatcher::output()],
            ]);
        }

        $this->title(__d('system', 'Uninstall Plugin'));
        header('Location:' . $this->referer());
        exit();
    }
public function delete($pluginName)
    {
        $plugin = plugin($pluginName); // throws if not exists
        $task = (bool)WebShellDispatcher::run("Installer.plugins uninstall -p {$plugin->name}");

        if ($task) {
            $this->Flash->success(__d('system', 'Plugin was successfully removed!'));
        } else {
            $this->Flash->set(__d('system', 'Plugins could not be removed'), [
                'element' => 'System.installer_errors',
                'params' => ['errors' => WebShellDispatcher::output()],
            ]);
        }

        $this->title(__d('system', 'Uninstall Plugin'));
        header('Location:' . $this->referer());
        exit();
    }
public function delete ( $ pluginName ) { $ plugin = plugin ( $ pluginName ) ; // throws if not exists $ task = ( bool ) WebShellDispatcher :: run ( "Installer.plugins uninstall -p {$plugin->name}" ) ; if ( $ task ) { $ this -> Flash -> success ( __d ( 'system' , 'Plugin was successfully removed!' ) ) ; } else { $ this -> Flash -> set ( __d ( 'system' , 'Plugins could not be removed' ) , [ 'element' => 'System.installer_errors' , 'params' => [ 'errors' => WebShellDispatcher :: output ( ) ] , ] ) ; } $ this -> title ( __d ( 'system' , 'Uninstall Plugin' ) ) ; header ( 'Location:' . $ this -> referer ( ) ) ; exit ( ) ; }
Uninstalls the given plugin.

@param string $pluginName Plugin's name
@return void Redirects to previous page
Uninstalls the given plugin .