<commit_before><?php
/**
 * @copyright	Copyright (C) 2007 - 2015 <NAME> and Timble CVBA. (http://www.timble.net)
 * @license		Mozilla Public License, version 2.0
 * @link		http://github.com/joomlatools/joomlatools-console for the canonical source repository
 */

namespace Joomlatools\Console\Command\Plugin;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class Uninstall extends Command
{
    protected function configure()
    {
        $this->setName('plugin:uninstall')
             ->setDescription('Used for uninstalling plugins')
             ->addArgument(
                 'package',
                 InputArgument::REQUIRED,
                 'The composer package containing the plugin to uninstall'
             );
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $plugins = $this->getApplication()->getPlugins();
        $path    = $this->getApplication()->getPluginPath();

        $package = $input->getArgument('package');

        $result = `command -v composer >/dev/null 2>&1 || { echo >&2 "false"; }`;

        if ($result == 'false')
        {
            $output->writeln('<error>Composer was not found. It is either not installed or globally available.</error>');
            return;
        }

        if (!array_key_exists($package, $plugins))
        {
            $output->writeln('<error>Error:</error>The package "' . $package . '" is not installed');
            return;
        }

        passthru("composer --working-dir=$path --update-with-dependencies remove $package");
    }<commit_msg>#57: --update-with-dependencies is now a default option in Composer<commit_after><?php
/**
 * @copyright	Copyright (C) 2007 - 2015 <NAME> and Timble CVBA. (http://www.timble.net)
 * @license		Mozilla Public License, version 2.0
 * @link		http://github.com/joomlatools/joomlatools-console for the canonical source repository
 */

namespace Joomlatools\Console\Command\Plugin;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class Uninstall extends Command
{
    protected function configure()
    {
        $this->setName('plugin:uninstall')
             ->setDescription('Used for uninstalling plugins')
             ->addArgument(
                 'package',
                 InputArgument::REQUIRED,
                 'The composer package containing the plugin to uninstall'
             );
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $plugins = $this->getApplication()->getPlugins();
        $path    = $this->getApplication()->getPluginPath();

        $package = $input->getArgument('package');

        $result = `command -v composer >/dev/null 2>&1 || { echo >&2 "false"; }`;

        if ($result == 'false')
        {
            $output->writeln('<error>Composer was not found. It is either not installed or globally available.</error>');
            return;
        }

        if (!array_key_exists($package, $plugins))
        {
            $output->writeln('<error>Error:</error>The package "' . $package . '" is not installed');
            return;
        }

        passthru("composer --working-dir=$path remove $package");
    }
{'fraction_non_alphanumeric': 0.12991357680512963, 'fraction_numerical': 0.007805965988291051, 'mean_word_length': 2.7219917012448134, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6982209', 'n_tokens_mistral': 994, 'n_tokens_neox': 959, 'n_words': 229}