Merge remote-tracking branch 'ryan/use_symfony_command'
Conflicts: bin/composer src/Composer/Command/InstallCommand.phpmain
commit
9b70b06bc8
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\Command;
|
||||
|
||||
use Symfony\Component\Console\Command\Command as BaseCommand;
|
||||
|
||||
/**
|
||||
* Base class for Composer commands
|
||||
*
|
||||
* @author Ryan Weaver <ryan@knplabs.com>
|
||||
*/
|
||||
abstract class Command extends BaseCommand
|
||||
{
|
||||
/**
|
||||
* @return \Composer\Composer
|
||||
*/
|
||||
protected function getComposer()
|
||||
{
|
||||
return $this->getApplication()->getComposer();
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\Console;
|
||||
|
||||
use Symfony\Component\Console\Application as BaseApplication;
|
||||
use Composer\Composer;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Finder\Finder;
|
||||
use Composer\Command\InstallCommand;
|
||||
|
||||
/**
|
||||
* The console application that handles the commands
|
||||
*
|
||||
* @author Ryan Weaver <ryan@knplabs.com>
|
||||
*/
|
||||
class Application extends BaseApplication
|
||||
{
|
||||
private $composer;
|
||||
|
||||
public function __construct(Composer $composer)
|
||||
{
|
||||
parent::__construct('Composer', Composer::VERSION);
|
||||
|
||||
$this->composer = $composer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the current application.
|
||||
*
|
||||
* @param InputInterface $input An Input instance
|
||||
* @param OutputInterface $output An Output instance
|
||||
*
|
||||
* @return integer 0 if everything went fine, or an error code
|
||||
*/
|
||||
public function doRun(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->registerCommands();
|
||||
|
||||
return parent::doRun($input, $output);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Composer
|
||||
*/
|
||||
public function getComposer()
|
||||
{
|
||||
return $this->composer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes all the composer commands
|
||||
*/
|
||||
protected function registerCommands()
|
||||
{
|
||||
$this->add(new InstallCommand());
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
Subproject commit 20df560af4faa32b0925029f46ecf0ecdc435728
|
Loading…
Reference in New Issue