2011-10-30 22:15:55 +00:00
|
|
|
<?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 Composer\Autoload\AutoloadGenerator;
|
|
|
|
use Composer\DependencyResolver;
|
|
|
|
use Composer\DependencyResolver\Pool;
|
|
|
|
use Composer\DependencyResolver\Request;
|
|
|
|
use Composer\DependencyResolver\Operation;
|
|
|
|
use Composer\Package\LinkConstraint\VersionConstraint;
|
|
|
|
use Composer\Repository\PlatformRepository;
|
|
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
|
|
use Symfony\Component\Console\Input\InputOption;
|
|
|
|
use Symfony\Component\Console\Output\OutputInterface;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Jordi Boggiano <j.boggiano@seld.be>
|
|
|
|
*/
|
|
|
|
class UpdateCommand extends Command
|
|
|
|
{
|
|
|
|
protected function configure()
|
|
|
|
{
|
|
|
|
$this
|
|
|
|
->setName('update')
|
|
|
|
->setDescription('Updates your dependencies to the latest version, and updates the composer.lock file.')
|
|
|
|
->setDefinition(array(
|
|
|
|
new InputOption('dev', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'),
|
2011-11-21 16:56:21 +00:00
|
|
|
new InputOption('dry-run', null, InputOption::VALUE_NONE, 'Outputs the operations but will not execute anything (implicitly enables --verbose).'),
|
2011-11-25 15:44:50 +00:00
|
|
|
new InputOption('required-only', null, InputOption::VALUE_NONE, 'Installs required packages only.'),
|
|
|
|
new InputOption('include-suggested', null, InputOption::VALUE_NONE, 'Includes suggested packages.'),
|
2011-10-30 22:15:55 +00:00
|
|
|
))
|
|
|
|
->setHelp(<<<EOT
|
|
|
|
The <info>update</info> command reads the composer.json file from the
|
|
|
|
current directory, processes it, and updates, removes or installs all the
|
|
|
|
dependencies.
|
|
|
|
|
|
|
|
<info>php composer.phar update</info>
|
|
|
|
|
|
|
|
EOT
|
|
|
|
)
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function execute(InputInterface $input, OutputInterface $output)
|
|
|
|
{
|
|
|
|
$composer = $this->getComposer();
|
|
|
|
|
|
|
|
$installCommand = $this->getApplication()->find('install');
|
2011-11-21 16:56:21 +00:00
|
|
|
return $installCommand->install($input, $output, true);
|
2011-10-30 22:15:55 +00:00
|
|
|
}
|
|
|
|
}
|