@param InstalledRepositoryInterface $repo
@param PackageInterface $package

@return void
428529
protected function removeStandards(InstalledRepositoryInterface $repo, PackageInterface $package)
    {
        $srcStandards = $this->getSourceStandards($package);
        $dstStandards = $this->getDestinationStandards($repo);
        $this->io->writeError('    Removing PHP-CodeSniffer Standards:', false);
        foreach ($srcStandards as $srcStandard) {
            if (! $dstStandards->hasStandard($srcStandard)) {
                continue;
            }
            $this->io->writeError(sprintf(' <info>%s</info>', $srcStandard->getName()));
            $dstStandard = $dstStandards->getStandard($srcStandard);

            $this->filesystem->removeDirectory($dstStandard->getPath());
        }
    }
1106386
public function delete(Repo $repo)
    {
        $rows = array();

        foreach ($this->getRows() as $row) {
            if ($row['id'] == $repo->getId()) {
                continue;
            }
            $rows[] = $row;
        }

        file_put_contents($this->filename, Yaml::dump($rows));
    }
586054
public function uninstall(\Composer\Repository\InstalledRepositoryInterface $repo, \Composer\Package\PackageInterface $package) {
    	$this->moveBackResources($package);
    	
    	if (!$this->isTmplPackage($package)) {
    		$pattern = '/' . $this->getModuleName($package);
	    	$this->removeFromGitIgnore($this->getVarDestDirPath() . DIRECTORY_SEPARATOR . self::ETC_DIR,
	    			$pattern);
	    	$this->removeFromGitIgnore($this->getPublicDestDirPath() . DIRECTORY_SEPARATOR . self::ASSETS_DIR,
	    			$pattern);
			parent::uninstall($repo, $package);
    	} else {
    		$repo->removePackage($package);
    	}
		
	}
983312
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
    {
        $extra = $package->getExtra();
        if (array_key_exists('pxb-config', $extra)) {
            $this->unloadModule($package, $extra['pxb-config']);
        }
        parent::uninstall($repo, $package);
    }
1236433
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $packages = explode(',', $input->getArgument('package'));
        $type = $input->getOption('type');

        foreach ($packages as $package) {
            $output->writeln('### Orchestrator::installComposerPackage() for '.$package.' and type: '.$type.'  ###');
            Orchestrator::installComposerPackage($package, $type);
        }
    }
675549
public function delete(Repo $repo)
    {
        $this->_em->remove($repo);
        $this->_em->flush();
    }
1012276
protected function removePackageVendorSymlink(PackageInterface $package)
    {
        if (
            $this->config->isSymlinkEnabled()
            && $this->filesystem->removeSymlink($this->getPackageVendorSymlink($package))
        ) {
            $this->io->write(array(
                '  - Deleting symlink for <info>' . $package->getPrettyName() . '</info> '
                . '(<fg=yellow>' . $package->getPrettyVersion() . '</fg=yellow>)',
                ''
            ));

            $symlinkParentDirectory = dirname($this->getPackageVendorSymlink($package));
            $this->filesystem->removeEmptyDirectory($symlinkParentDirectory);
        }
    }
308912
private function getPackages(RepositoryInterface $repo)
    {
        $packages = [];

        if ($this->hasFilterForPackages()) {
            // apply package filter if defined
            foreach ($this->packagesFilter as $filter) {
                $packages += $repo->findPackages($filter);
            }
        } else {
            // process other repos directly
            $packages = $repo->getPackages();
        }

        return $packages;
    }
155485
public function resetPackage(WritableRepositoryInterface $repository, PackageInterface $package)
    {
        $verbosityLevel = OutputUtils::resetVerbosity($this->appIO, OutputInterface::VERBOSITY_QUIET);

        $operation = new ResetOperation($package, 'Package reset due to changes in patches configuration');

        if (!$this->packageResetStrategy->shouldAllowReset($package)) {
            OutputUtils::resetVerbosity($this->appIO, $verbosityLevel);

            throw new \Vaimo\ComposerPatches\Exceptions\PackageResetException(
                sprintf('Package reset halted due to encountering local changes: %s', $package->getName())
            );
        }

        try {
            $this->installer->install($repository, $operation);
        } catch (\Exception $exception) {
            OutputUtils::resetVerbosity($this->appIO, $verbosityLevel);

            throw $exception;
        }

        OutputUtils::resetVerbosity($this->appIO, $verbosityLevel);
    }
1326850
public void addRepository(RepositoryAdmin repositoryAdmin, String repository)
    {
        try {
            if (repository != null)
            {
                boolean duplicate = false;
                for (Repository repo : repositoryAdmin.listRepositories())
                {
                    if (repository.equalsIgnoreCase(repo.getURI()))
                        duplicate = true;
                }
                if (!duplicate)
                {
                    Repository repo = repositoryAdmin.addRepository(repository);
                    if (repo == null)
                        repositoryAdmin.removeRepository(repository);   // Ignore repos not found
                }
            }
        } catch (Exception e) {
            // Ignore exception e.printStackTrace();
        }
    }
230528
public static function enablePackage(PackageInterface $package)
    {
        $packageRepository = Factory::makePackageRepository($package);
        $bundleFactory = Factory::makeBundleFactory();
        $kernelManipulator = Factory::makeKernelManipulator();

        $composerPackage = $packageRepository->findOneByName($package->getName());
        $bundle = $bundleFactory->make($composerPackage->namespace);

        $kernelManipulator->addBundle($bundle->fullyQualifiedClassname);
    }
501689
protected function installGitignore(PackageInterface $package)
    {
        $installPath = $this->getInstallPath($package) . '/.gitignore';
        $templatePath = $this->getTempPath($package) . '/.gitignore.template';
        
        $data = ['APP_PUBLIC' => $this->plugin->getPublicDirectory()];
        
        if (! file_exists($installPath)) {
            return $this->compileTemplate($templatePath, $installPath, $data);
        }
        
        $downloadGitignore = $this->compileTemplate($templatePath, $data);
        $installGitignore = file_get_contents($installPath);
        
        $gitignore = preg_split('/\r?\n/', $downloadGitignore . PHP_EOL . '# User rules' . PHP_EOL . $installGitignore);
        $group = 'user rules';
        $groups = [];
        $rules = [];
        
        $groups['user rules'] = [];
        
        foreach ($gitignore as $rule) {
            if (preg_match('/^#\s*(.*)/', $rule, $matches)) {
                $group = strtolower($matches[1]);
                
                if (! isset($groups[$group])) {
                    $groups[$group] = [];
                }
            } elseif (! preg_match('/^\s*$/', $rule) && ! in_array($rule, $rules)) {
                $groups[$group][] = $rules[] = $rule;
            }
        }
        
        $gitignore = [];
        
        foreach ($groups as $group => $rules) {
            if (! count($rules) || $group == 'user rules') {
                continue;
            }
            
            $this->sortRules($rules);
            
            $gitignore[] = '# ' . ucfirst($group);
            $gitignore = array_merge($gitignore, $rules);
            $gitignore[] = '';
        }
        
        $this->sortRules($groups['user rules']);
        
        $gitignore[] = '# User rules';
        $gitignore = array_merge($gitignore, $groups['user rules']);
        $gitignore[] = '';
        
        file_put_contents($installPath, implode(PHP_EOL, $gitignore));
    }
1370129
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
    {
        new Textpattern();
        parent::install($repo, $package);
        $plugin = new $this->textpatternPackager($this->getInstallPath($package), $package);
        $plugin->install();
    }
126733
protected function removeLoader(PackageInterface $package)
    {
        $target = $this->getLoaderFileInstallPath($package);

        if (!$this->filesystem->remove($target)) {
            throw new \RuntimeException('Could not completely delete ' . $target . ', aborting.');
        }
    }
216238
public function gitHubInitRepo(InputInterface $input, OutputInterface $output)
    {
        $this->output = $output;
        $this->runGitInit();
        $this->runGitAdd();
        $this->runGitCommit();
        $this->runGitCreateRepo();
        $this->runGitRemoteAddOrigin($this->getRepoURL($input,$output));
        $this->runGitPull();
        $this->runGitPush();
    }
348937
public function boot(RepositoryInterface $modules, Container $container)
    {
        $this->modules = $modules;
        $this->container = $container;

        App::booted(function ($app) {
            $this->defineMenuBuilder();
        });
    }
679475
protected function installEntryFiles(PackageInterface $package)
    {
        foreach ($this->getEntryFileLocations($package) as $src => $dest) {
            $copied = $this->filesystem->copyFile($src, $dest);

            $this->io->notice(
                sprintf(
                    '    <fg=default>Copying <fg=magenta>%1$s</> to <fg=magenta>%2$s</> -</> %3$s',
                    $src,
                    $dest,
                    $copied ? '<fg=green>OK</>' : '<fg=red>FAILED</>'
                )
            );

            if (! $copied) {
                throw new RuntimeException(sprintf('Cannot copy %s to %s', $src, $dest));
            }
        }
    }