1
0
Fork 0

Add support for new verbosity levels, and initial debug output

pull/1828/merge
Jordi Boggiano 2013-04-26 23:23:35 +02:00
parent 3aa7843146
commit 3b97e2e260
9 changed files with 65 additions and 15 deletions

View File

@ -25,7 +25,7 @@
"php": ">=5.3.2", "php": ">=5.3.2",
"justinrainbow/json-schema": "1.1.*", "justinrainbow/json-schema": "1.1.*",
"seld/jsonlint": "1.*", "seld/jsonlint": "1.*",
"symfony/console": "~2.1@dev", "symfony/console": "~2.3@dev",
"symfony/finder": "~2.1", "symfony/finder": "~2.1",
"symfony/process": "~2.1@dev" "symfony/process": "~2.1@dev"
}, },

18
composer.lock generated
View File

@ -3,7 +3,7 @@
"This file locks the dependencies of your project to a known state", "This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
], ],
"hash": "38828459a269ef0e409883721853d7fe", "hash": "01e4c62c851ae821a789f70484fed8a6",
"packages": [ "packages": [
{ {
"name": "justinrainbow/json-schema", "name": "justinrainbow/json-schema",
@ -84,12 +84,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Console.git", "url": "https://github.com/symfony/Console.git",
"reference": "f22b036677ee58fdb256f2404c95a9f401b767cf" "reference": "7bcef9e062cc89b893a35c67a7456d41cb50113d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Console/zipball/f22b036677ee58fdb256f2404c95a9f401b767cf", "url": "https://api.github.com/repos/symfony/Console/zipball/7bcef9e062cc89b893a35c67a7456d41cb50113d",
"reference": "f22b036677ee58fdb256f2404c95a9f401b767cf", "reference": "7bcef9e062cc89b893a35c67a7456d41cb50113d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -125,7 +125,7 @@
], ],
"description": "Symfony Console Component", "description": "Symfony Console Component",
"homepage": "http://symfony.com", "homepage": "http://symfony.com",
"time": "2013-04-23 16:54:01" "time": "2013-04-25 13:33:44"
}, },
{ {
"name": "symfony/finder", "name": "symfony/finder",
@ -181,12 +181,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Process.git", "url": "https://github.com/symfony/Process.git",
"reference": "a2a22e359c8c6c6a44ec2d158d0865e9a94348b1" "reference": "d55770ab111a89ee92773eb16f8acef9b09870f5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Process/zipball/a2a22e359c8c6c6a44ec2d158d0865e9a94348b1", "url": "https://api.github.com/repos/symfony/Process/zipball/d55770ab111a89ee92773eb16f8acef9b09870f5",
"reference": "a2a22e359c8c6c6a44ec2d158d0865e9a94348b1", "reference": "d55770ab111a89ee92773eb16f8acef9b09870f5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -219,7 +219,7 @@
], ],
"description": "Symfony Process Component", "description": "Symfony Process Component",
"homepage": "http://symfony.com", "homepage": "http://symfony.com",
"time": "2013-04-23 20:53:10" "time": "2013-04-25 13:23:11"
} }
], ],
"packages-dev": [ "packages-dev": [

View File

@ -38,7 +38,7 @@ class InstallCommand extends Command
new InputOption('no-custom-installers', null, InputOption::VALUE_NONE, 'Disables all custom installers.'), new InputOption('no-custom-installers', null, InputOption::VALUE_NONE, 'Disables all custom installers.'),
new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'), new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'),
new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'), new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'),
new InputOption('verbose', 'v', InputOption::VALUE_NONE, 'Shows more details including new commits pulled in when updating packages.'), new InputOption('verbose', 'v|vv|vvv', InputOption::VALUE_NONE, 'Shows more details including new commits pulled in when updating packages.'),
new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump') new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump')
)) ))
->setHelp(<<<EOT ->setHelp(<<<EOT

View File

@ -29,7 +29,7 @@ class StatusCommand extends Command
->setName('status') ->setName('status')
->setDescription('Show a list of locally modified packages') ->setDescription('Show a list of locally modified packages')
->setDefinition(array( ->setDefinition(array(
new InputOption('verbose', 'v', InputOption::VALUE_NONE, 'Show modified files for each directory that contains changes.'), new InputOption('verbose', 'v|vv|vvv', InputOption::VALUE_NONE, 'Show modified files for each directory that contains changes.'),
)) ))
->setHelp(<<<EOT ->setHelp(<<<EOT
The status command displays a list of dependencies that have The status command displays a list of dependencies that have

View File

@ -38,7 +38,7 @@ class UpdateCommand extends Command
new InputOption('no-custom-installers', null, InputOption::VALUE_NONE, 'Disables all custom installers.'), new InputOption('no-custom-installers', null, InputOption::VALUE_NONE, 'Disables all custom installers.'),
new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'), new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'),
new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'), new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'),
new InputOption('verbose', 'v', InputOption::VALUE_NONE, 'Shows more details including new commits pulled in when updating packages.'), new InputOption('verbose', 'v|vv|vvv', InputOption::VALUE_NONE, 'Shows more details including new commits pulled in when updating packages.'),
new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump') new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump')
)) ))
->setHelp(<<<EOT ->setHelp(<<<EOT

View File

@ -71,7 +71,23 @@ class ConsoleIO implements IOInterface
*/ */
public function isVerbose() public function isVerbose()
{ {
return $this->output->getVerbosity() === OutputInterface::VERBOSITY_VERBOSE; return $this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE;
}
/**
* {@inheritDoc}
*/
public function isVeryVerbose()
{
return $this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE;
}
/**
* {@inheritDoc}
*/
public function isDebug()
{
return $this->output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG;
} }
/** /**

View File

@ -27,12 +27,26 @@ interface IOInterface
public function isInteractive(); public function isInteractive();
/** /**
* Is this input verbose? * Is this output verbose?
* *
* @return bool * @return bool
*/ */
public function isVerbose(); public function isVerbose();
/**
* Is the output very verbose?
*
* @return bool
*/
public function isVeryVerbose();
/**
* Is the output in debug verbosity?
*
* @return bool
*/
public function isDebug();
/** /**
* Is this output decorated? * Is this output decorated?
* *

View File

@ -35,6 +35,22 @@ class NullIO implements IOInterface
return false; return false;
} }
/**
* {@inheritDoc}
*/
public function isVeryVerbose()
{
return false;
}
/**
* {@inheritDoc}
*/
public function isDebug()
{
return false;
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */

View File

@ -18,6 +18,7 @@ use Composer\Downloader\TransportException;
/** /**
* @author François Pluchino <francois.pluchino@opendisplay.com> * @author François Pluchino <francois.pluchino@opendisplay.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
*/ */
class RemoteFilesystem class RemoteFilesystem
{ {
@ -101,6 +102,9 @@ class RemoteFilesystem
$this->lastProgress = null; $this->lastProgress = null;
$options = $this->getOptionsForUrl($originUrl, $additionalOptions); $options = $this->getOptionsForUrl($originUrl, $additionalOptions);
if ($this->io->isDebug()) {
$this->io->write('Downloading '.$fileUrl);
}
if (isset($options['github-token'])) { if (isset($options['github-token'])) {
$fileUrl .= (false === strpos($fileUrl, '?') ? '?' : '&') . 'access_token='.$options['github-token']; $fileUrl .= (false === strpos($fileUrl, '?') ? '?' : '&') . 'access_token='.$options['github-token'];
unset($options['github-token']); unset($options['github-token']);