Update to Drupal 8.0-dev-2015-11-17. Commits through da81cd220, Tue Nov 17 15:53:49 2015 +0000, Issue #2617224 by Wim Leers: Move around/fix some documentation.
This commit is contained in:
parent
4afb23bbd3
commit
7784f4c23d
929 changed files with 19798 additions and 5304 deletions
40
vendor/symfony/console/Application.php
vendored
40
vendor/symfony/console/Application.php
vendored
|
@ -54,8 +54,6 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
|||
* $app->run();
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class Application
|
||||
{
|
||||
|
@ -77,8 +75,6 @@ class Application
|
|||
*
|
||||
* @param string $name The name of the application
|
||||
* @param string $version The version of the application
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN')
|
||||
{
|
||||
|
@ -107,8 +103,6 @@ class Application
|
|||
* @return int 0 if everything went fine, or an error code
|
||||
*
|
||||
* @throws \Exception When doRun returns Exception
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function run(InputInterface $input = null, OutputInterface $output = null)
|
||||
{
|
||||
|
@ -202,8 +196,6 @@ class Application
|
|||
* Set a helper set to be used with the command.
|
||||
*
|
||||
* @param HelperSet $helperSet The helper set
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setHelperSet(HelperSet $helperSet)
|
||||
{
|
||||
|
@ -214,8 +206,6 @@ class Application
|
|||
* Get the helper set associated with the command.
|
||||
*
|
||||
* @return HelperSet The HelperSet instance associated with this command
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getHelperSet()
|
||||
{
|
||||
|
@ -226,8 +216,6 @@ class Application
|
|||
* Set an input definition set to be used with this application.
|
||||
*
|
||||
* @param InputDefinition $definition The input definition
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setDefinition(InputDefinition $definition)
|
||||
{
|
||||
|
@ -258,8 +246,6 @@ class Application
|
|||
* Sets whether to catch exceptions or not during commands execution.
|
||||
*
|
||||
* @param bool $boolean Whether to catch exceptions or not during commands execution
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setCatchExceptions($boolean)
|
||||
{
|
||||
|
@ -270,8 +256,6 @@ class Application
|
|||
* Sets whether to automatically exit after a command execution or not.
|
||||
*
|
||||
* @param bool $boolean Whether to automatically exit after a command execution or not
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setAutoExit($boolean)
|
||||
{
|
||||
|
@ -282,8 +266,6 @@ class Application
|
|||
* Gets the name of the application.
|
||||
*
|
||||
* @return string The application name
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
|
@ -294,8 +276,6 @@ class Application
|
|||
* Sets the application name.
|
||||
*
|
||||
* @param string $name The application name
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
|
@ -306,8 +286,6 @@ class Application
|
|||
* Gets the application version.
|
||||
*
|
||||
* @return string The application version
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getVersion()
|
||||
{
|
||||
|
@ -318,8 +296,6 @@ class Application
|
|||
* Sets the application version.
|
||||
*
|
||||
* @param string $version The application version
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setVersion($version)
|
||||
{
|
||||
|
@ -330,8 +306,6 @@ class Application
|
|||
* Returns the long version of the application.
|
||||
*
|
||||
* @return string The long application version
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getLongVersion()
|
||||
{
|
||||
|
@ -348,8 +322,6 @@ class Application
|
|||
* @param string $name The command name
|
||||
*
|
||||
* @return Command The newly created command
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function register($name)
|
||||
{
|
||||
|
@ -360,8 +332,6 @@ class Application
|
|||
* Adds an array of command objects.
|
||||
*
|
||||
* @param Command[] $commands An array of commands
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function addCommands(array $commands)
|
||||
{
|
||||
|
@ -378,8 +348,6 @@ class Application
|
|||
* @param Command $command A Command object
|
||||
*
|
||||
* @return Command The registered command
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function add(Command $command)
|
||||
{
|
||||
|
@ -412,8 +380,6 @@ class Application
|
|||
* @return Command A Command object
|
||||
*
|
||||
* @throws \InvalidArgumentException When command name given does not exist
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function get($name)
|
||||
{
|
||||
|
@ -441,8 +407,6 @@ class Application
|
|||
* @param string $name The command name or alias
|
||||
*
|
||||
* @return bool true if the command exists, false otherwise
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function has($name)
|
||||
{
|
||||
|
@ -520,8 +484,6 @@ class Application
|
|||
* @return Command A Command instance
|
||||
*
|
||||
* @throws \InvalidArgumentException When command name is incorrect or ambiguous
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function find($name)
|
||||
{
|
||||
|
@ -577,8 +539,6 @@ class Application
|
|||
* @param string $namespace A namespace name
|
||||
*
|
||||
* @return Command[] An array of Command instances
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function all($namespace = null)
|
||||
{
|
||||
|
|
49
vendor/symfony/console/Command/Command.php
vendored
49
vendor/symfony/console/Command/Command.php
vendored
|
@ -26,8 +26,6 @@ use Symfony\Component\Console\Helper\HelperSet;
|
|||
* Base class for all commands.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class Command
|
||||
{
|
||||
|
@ -52,8 +50,6 @@ class Command
|
|||
* @param string|null $name The name of the command; passing null means it must be set in configure()
|
||||
*
|
||||
* @throws \LogicException When the command name is empty
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct($name = null)
|
||||
{
|
||||
|
@ -84,8 +80,6 @@ class Command
|
|||
* Sets the application instance for this command.
|
||||
*
|
||||
* @param Application $application An Application instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setApplication(Application $application = null)
|
||||
{
|
||||
|
@ -121,8 +115,6 @@ class Command
|
|||
* Gets the application instance for this command.
|
||||
*
|
||||
* @return Application An Application instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getApplication()
|
||||
{
|
||||
|
@ -214,8 +206,6 @@ class Command
|
|||
*
|
||||
* @see setCode()
|
||||
* @see execute()
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function run(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
|
@ -251,6 +241,13 @@ class Command
|
|||
$this->interact($input, $output);
|
||||
}
|
||||
|
||||
// The command name argument is often omitted when a command is executed directly with its run() method.
|
||||
// It would fail the validation if we didn't make sure the command argument is present,
|
||||
// since it's required by the application.
|
||||
if ($input->hasArgument('command') && null === $input->getArgument('command')) {
|
||||
$input->setArgument('command', $this->getName());
|
||||
}
|
||||
|
||||
$input->validate();
|
||||
|
||||
if ($this->code) {
|
||||
|
@ -275,8 +272,6 @@ class Command
|
|||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @see execute()
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setCode($code)
|
||||
{
|
||||
|
@ -322,8 +317,6 @@ class Command
|
|||
* @param array|InputDefinition $definition An array of argument and option instances or a definition instance
|
||||
*
|
||||
* @return Command The current instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setDefinition($definition)
|
||||
{
|
||||
|
@ -342,8 +335,6 @@ class Command
|
|||
* Gets the InputDefinition attached to this Command.
|
||||
*
|
||||
* @return InputDefinition An InputDefinition instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getDefinition()
|
||||
{
|
||||
|
@ -374,8 +365,6 @@ class Command
|
|||
* @param mixed $default The default value (for InputArgument::OPTIONAL mode only)
|
||||
*
|
||||
* @return Command The current instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function addArgument($name, $mode = null, $description = '', $default = null)
|
||||
{
|
||||
|
@ -394,8 +383,6 @@ class Command
|
|||
* @param mixed $default The default value (must be null for InputOption::VALUE_REQUIRED or InputOption::VALUE_NONE)
|
||||
*
|
||||
* @return Command The current instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function addOption($name, $shortcut = null, $mode = null, $description = '', $default = null)
|
||||
{
|
||||
|
@ -417,8 +404,6 @@ class Command
|
|||
* @return Command The current instance
|
||||
*
|
||||
* @throws \InvalidArgumentException When the name is invalid
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
|
@ -452,8 +437,6 @@ class Command
|
|||
* Returns the command name.
|
||||
*
|
||||
* @return string The command name
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
|
@ -466,8 +449,6 @@ class Command
|
|||
* @param string $description The description for the command
|
||||
*
|
||||
* @return Command The current instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
|
@ -480,8 +461,6 @@ class Command
|
|||
* Returns the description for the command.
|
||||
*
|
||||
* @return string The description for the command
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
|
@ -494,8 +473,6 @@ class Command
|
|||
* @param string $help The help for the command
|
||||
*
|
||||
* @return Command The current instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setHelp($help)
|
||||
{
|
||||
|
@ -508,12 +485,10 @@ class Command
|
|||
* Returns the help for the command.
|
||||
*
|
||||
* @return string The help for the command
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getHelp()
|
||||
{
|
||||
return $this->help ?: $this->description;
|
||||
return $this->help;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -535,7 +510,7 @@ class Command
|
|||
$_SERVER['PHP_SELF'].' '.$name,
|
||||
);
|
||||
|
||||
return str_replace($placeholders, $replacements, $this->getHelp());
|
||||
return str_replace($placeholders, $replacements, $this->getHelp() ?: $this->getDescription());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -546,8 +521,6 @@ class Command
|
|||
* @return Command The current instance
|
||||
*
|
||||
* @throws \InvalidArgumentException When an alias is invalid
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setAliases($aliases)
|
||||
{
|
||||
|
@ -568,8 +541,6 @@ class Command
|
|||
* Returns the aliases for the command.
|
||||
*
|
||||
* @return array An array of aliases for the command
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getAliases()
|
||||
{
|
||||
|
@ -628,8 +599,6 @@ class Command
|
|||
* @return mixed The helper value
|
||||
*
|
||||
* @throws \InvalidArgumentException if the helper is not defined
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getHelper($name)
|
||||
{
|
||||
|
|
|
@ -136,15 +136,17 @@ class ApplicationDescription
|
|||
private function sortCommands(array $commands)
|
||||
{
|
||||
$namespacedCommands = array();
|
||||
$globalCommands = array();
|
||||
foreach ($commands as $name => $command) {
|
||||
$key = $this->application->extractNamespace($name, 1);
|
||||
if (!$key) {
|
||||
$key = '_global';
|
||||
$globalCommands['_global'][$name] = $command;
|
||||
} else {
|
||||
$namespacedCommands[$key][$name] = $command;
|
||||
}
|
||||
|
||||
$namespacedCommands[$key][$name] = $command;
|
||||
}
|
||||
ksort($namespacedCommands);
|
||||
$namespacedCommands = array_merge($globalCommands, $namespacedCommands);
|
||||
|
||||
foreach ($namespacedCommands as &$commandsSet) {
|
||||
ksort($commandsSet);
|
||||
|
|
|
@ -15,8 +15,6 @@ namespace Symfony\Component\Console\Formatter;
|
|||
* Formatter class for console output.
|
||||
*
|
||||
* @author Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class OutputFormatter implements OutputFormatterInterface
|
||||
{
|
||||
|
@ -41,8 +39,6 @@ class OutputFormatter implements OutputFormatterInterface
|
|||
*
|
||||
* @param bool $decorated Whether this formatter should actually decorate strings
|
||||
* @param OutputFormatterStyleInterface[] $styles Array of "name => FormatterStyle" instances
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct($decorated = false, array $styles = array())
|
||||
{
|
||||
|
@ -64,8 +60,6 @@ class OutputFormatter implements OutputFormatterInterface
|
|||
* Sets the decorated flag.
|
||||
*
|
||||
* @param bool $decorated Whether to decorate the messages or not
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setDecorated($decorated)
|
||||
{
|
||||
|
@ -76,8 +70,6 @@ class OutputFormatter implements OutputFormatterInterface
|
|||
* Gets the decorated flag.
|
||||
*
|
||||
* @return bool true if the output will decorate messages, false otherwise
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function isDecorated()
|
||||
{
|
||||
|
@ -89,8 +81,6 @@ class OutputFormatter implements OutputFormatterInterface
|
|||
*
|
||||
* @param string $name The style name
|
||||
* @param OutputFormatterStyleInterface $style The style instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setStyle($name, OutputFormatterStyleInterface $style)
|
||||
{
|
||||
|
@ -103,8 +93,6 @@ class OutputFormatter implements OutputFormatterInterface
|
|||
* @param string $name
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function hasStyle($name)
|
||||
{
|
||||
|
@ -119,8 +107,6 @@ class OutputFormatter implements OutputFormatterInterface
|
|||
* @return OutputFormatterStyleInterface
|
||||
*
|
||||
* @throws \InvalidArgumentException When style isn't defined
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getStyle($name)
|
||||
{
|
||||
|
@ -137,8 +123,6 @@ class OutputFormatter implements OutputFormatterInterface
|
|||
* @param string $message The message to style
|
||||
*
|
||||
* @return string The styled message
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function format($message)
|
||||
{
|
||||
|
|
|
@ -15,8 +15,6 @@ namespace Symfony\Component\Console\Formatter;
|
|||
* Formatter interface for console output.
|
||||
*
|
||||
* @author Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
interface OutputFormatterInterface
|
||||
{
|
||||
|
@ -24,8 +22,6 @@ interface OutputFormatterInterface
|
|||
* Sets the decorated flag.
|
||||
*
|
||||
* @param bool $decorated Whether to decorate the messages or not
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setDecorated($decorated);
|
||||
|
||||
|
@ -33,8 +29,6 @@ interface OutputFormatterInterface
|
|||
* Gets the decorated flag.
|
||||
*
|
||||
* @return bool true if the output will decorate messages, false otherwise
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function isDecorated();
|
||||
|
||||
|
@ -43,8 +37,6 @@ interface OutputFormatterInterface
|
|||
*
|
||||
* @param string $name The style name
|
||||
* @param OutputFormatterStyleInterface $style The style instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setStyle($name, OutputFormatterStyleInterface $style);
|
||||
|
||||
|
@ -54,8 +46,6 @@ interface OutputFormatterInterface
|
|||
* @param string $name
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function hasStyle($name);
|
||||
|
||||
|
@ -65,8 +55,6 @@ interface OutputFormatterInterface
|
|||
* @param string $name
|
||||
*
|
||||
* @return OutputFormatterStyleInterface
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getStyle($name);
|
||||
|
||||
|
@ -76,8 +64,6 @@ interface OutputFormatterInterface
|
|||
* @param string $message The message to style
|
||||
*
|
||||
* @return string The styled message
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function format($message);
|
||||
}
|
||||
|
|
|
@ -15,8 +15,6 @@ namespace Symfony\Component\Console\Formatter;
|
|||
* Formatter style class for defining styles.
|
||||
*
|
||||
* @author Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class OutputFormatterStyle implements OutputFormatterStyleInterface
|
||||
{
|
||||
|
@ -60,8 +58,6 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
|||
* @param string|null $foreground The style foreground color name
|
||||
* @param string|null $background The style background color name
|
||||
* @param array $options The style options
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct($foreground = null, $background = null, array $options = array())
|
||||
{
|
||||
|
@ -82,8 +78,6 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
|||
* @param string|null $color The color name
|
||||
*
|
||||
* @throws \InvalidArgumentException When the color name isn't defined
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setForeground($color = null)
|
||||
{
|
||||
|
@ -110,8 +104,6 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
|||
* @param string|null $color The color name
|
||||
*
|
||||
* @throws \InvalidArgumentException When the color name isn't defined
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setBackground($color = null)
|
||||
{
|
||||
|
@ -138,8 +130,6 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
|||
* @param string $option The option name
|
||||
*
|
||||
* @throws \InvalidArgumentException When the option name isn't defined
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setOption($option)
|
||||
{
|
||||
|
|
|
@ -15,8 +15,6 @@ namespace Symfony\Component\Console\Formatter;
|
|||
* Formatter style interface for defining styles.
|
||||
*
|
||||
* @author Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
interface OutputFormatterStyleInterface
|
||||
{
|
||||
|
@ -24,8 +22,6 @@ interface OutputFormatterStyleInterface
|
|||
* Sets style foreground color.
|
||||
*
|
||||
* @param string $color The color name
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setForeground($color = null);
|
||||
|
||||
|
@ -33,8 +29,6 @@ interface OutputFormatterStyleInterface
|
|||
* Sets style background color.
|
||||
*
|
||||
* @param string $color The color name
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setBackground($color = null);
|
||||
|
||||
|
@ -42,8 +36,6 @@ interface OutputFormatterStyleInterface
|
|||
* Sets some specific style option.
|
||||
*
|
||||
* @param string $option The option name
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setOption($option);
|
||||
|
||||
|
|
|
@ -15,8 +15,6 @@ namespace Symfony\Component\Console\Helper;
|
|||
* HelperInterface is the interface all helpers must implement.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
interface HelperInterface
|
||||
{
|
||||
|
@ -24,8 +22,6 @@ interface HelperInterface
|
|||
* Sets the helper set associated with this helper.
|
||||
*
|
||||
* @param HelperSet $helperSet A HelperSet instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setHelperSet(HelperSet $helperSet = null);
|
||||
|
||||
|
@ -33,8 +29,6 @@ interface HelperInterface
|
|||
* Gets the helper set associated with this helper.
|
||||
*
|
||||
* @return HelperSet A HelperSet instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getHelperSet();
|
||||
|
||||
|
@ -42,8 +36,6 @@ interface HelperInterface
|
|||
* Returns the canonical name of this helper.
|
||||
*
|
||||
* @return string The canonical name
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getName();
|
||||
}
|
||||
|
|
44
vendor/symfony/console/Helper/ProgressBar.php
vendored
44
vendor/symfony/console/Helper/ProgressBar.php
vendored
|
@ -27,7 +27,8 @@ class ProgressBar
|
|||
private $barChar;
|
||||
private $emptyBarChar = '-';
|
||||
private $progressChar = '>';
|
||||
private $format = null;
|
||||
private $format;
|
||||
private $internalFormat;
|
||||
private $redrawFreq = 1;
|
||||
|
||||
/**
|
||||
|
@ -72,8 +73,6 @@ class ProgressBar
|
|||
}
|
||||
}
|
||||
|
||||
$this->setFormat($this->determineBestFormat());
|
||||
|
||||
$this->startTime = time();
|
||||
}
|
||||
|
||||
|
@ -310,16 +309,8 @@ class ProgressBar
|
|||
*/
|
||||
public function setFormat($format)
|
||||
{
|
||||
// try to use the _nomax variant if available
|
||||
if (!$this->max && null !== self::getFormatDefinition($format.'_nomax')) {
|
||||
$this->format = self::getFormatDefinition($format.'_nomax');
|
||||
} elseif (null !== self::getFormatDefinition($format)) {
|
||||
$this->format = self::getFormatDefinition($format);
|
||||
} else {
|
||||
$this->format = $format;
|
||||
}
|
||||
|
||||
$this->formatLineCount = substr_count($this->format, "\n");
|
||||
$this->format = null;
|
||||
$this->internalFormat = $format;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -441,6 +432,10 @@ class ProgressBar
|
|||
return;
|
||||
}
|
||||
|
||||
if (null === $this->format) {
|
||||
$this->setRealFormat($this->internalFormat ?: $this->determineBestFormat());
|
||||
}
|
||||
|
||||
// these 3 variables can be removed in favor of using $this in the closure when support for PHP 5.3 will be dropped.
|
||||
$self = $this;
|
||||
$output = $this->output;
|
||||
|
@ -475,9 +470,32 @@ class ProgressBar
|
|||
return;
|
||||
}
|
||||
|
||||
if (null === $this->format) {
|
||||
$this->setRealFormat($this->internalFormat ?: $this->determineBestFormat());
|
||||
}
|
||||
|
||||
$this->overwrite(str_repeat("\n", $this->formatLineCount));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the progress bar format.
|
||||
*
|
||||
* @param string $format The format
|
||||
*/
|
||||
private function setRealFormat($format)
|
||||
{
|
||||
// try to use the _nomax variant if available
|
||||
if (!$this->max && null !== self::getFormatDefinition($format.'_nomax')) {
|
||||
$this->format = self::getFormatDefinition($format.'_nomax');
|
||||
} elseif (null !== self::getFormatDefinition($format)) {
|
||||
$this->format = self::getFormatDefinition($format);
|
||||
} else {
|
||||
$this->format = $format;
|
||||
}
|
||||
|
||||
$this->formatLineCount = substr_count($this->format, "\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the progress bar maximal steps.
|
||||
*
|
||||
|
|
4
vendor/symfony/console/Input/ArgvInput.php
vendored
4
vendor/symfony/console/Input/ArgvInput.php
vendored
|
@ -35,8 +35,6 @@ namespace Symfony\Component\Console\Input;
|
|||
*
|
||||
* @see http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
|
||||
* @see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class ArgvInput extends Input
|
||||
{
|
||||
|
@ -48,8 +46,6 @@ class ArgvInput extends Input
|
|||
*
|
||||
* @param array $argv An array of parameters from the CLI (in the argv format)
|
||||
* @param InputDefinition $definition A InputDefinition instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct(array $argv = null, InputDefinition $definition = null)
|
||||
{
|
||||
|
|
4
vendor/symfony/console/Input/ArrayInput.php
vendored
4
vendor/symfony/console/Input/ArrayInput.php
vendored
|
@ -19,8 +19,6 @@ namespace Symfony\Component\Console\Input;
|
|||
* $input = new ArrayInput(array('name' => 'foo', '--bar' => 'foobar'));
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class ArrayInput extends Input
|
||||
{
|
||||
|
@ -31,8 +29,6 @@ class ArrayInput extends Input
|
|||
*
|
||||
* @param array $parameters An array of parameters
|
||||
* @param InputDefinition $definition A InputDefinition instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct(array $parameters, InputDefinition $definition = null)
|
||||
{
|
||||
|
|
11
vendor/symfony/console/Input/Input.php
vendored
11
vendor/symfony/console/Input/Input.php
vendored
|
@ -73,8 +73,15 @@ abstract class Input implements InputInterface
|
|||
*/
|
||||
public function validate()
|
||||
{
|
||||
if (count($this->arguments) < $this->definition->getArgumentRequiredCount()) {
|
||||
throw new \RuntimeException('Not enough arguments.');
|
||||
$definition = $this->definition;
|
||||
$givenArguments = $this->arguments;
|
||||
|
||||
$missingArguments = array_filter(array_keys($definition->getArguments()), function ($argument) use ($definition, $givenArguments) {
|
||||
return !array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired();
|
||||
});
|
||||
|
||||
if (count($missingArguments) > 0) {
|
||||
throw new \RuntimeException(sprintf('Not enough arguments (missing: "%s").', implode(', ', $missingArguments)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,8 +15,6 @@ namespace Symfony\Component\Console\Input;
|
|||
* Represents a command line argument.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class InputArgument
|
||||
{
|
||||
|
@ -38,8 +36,6 @@ class InputArgument
|
|||
* @param mixed $default The default value (for self::OPTIONAL mode only)
|
||||
*
|
||||
* @throws \InvalidArgumentException When argument mode is not valid
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct($name, $mode = null, $description = '', $default = null)
|
||||
{
|
||||
|
|
30
vendor/symfony/console/Input/InputDefinition.php
vendored
30
vendor/symfony/console/Input/InputDefinition.php
vendored
|
@ -26,8 +26,6 @@ use Symfony\Component\Console\Output\BufferedOutput;
|
|||
* ));
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class InputDefinition
|
||||
{
|
||||
|
@ -42,8 +40,6 @@ class InputDefinition
|
|||
* Constructor.
|
||||
*
|
||||
* @param array $definition An array of InputArgument and InputOption instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct(array $definition = array())
|
||||
{
|
||||
|
@ -54,8 +50,6 @@ class InputDefinition
|
|||
* Sets the definition of the input.
|
||||
*
|
||||
* @param array $definition The definition array
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setDefinition(array $definition)
|
||||
{
|
||||
|
@ -77,8 +71,6 @@ class InputDefinition
|
|||
* Sets the InputArgument objects.
|
||||
*
|
||||
* @param InputArgument[] $arguments An array of InputArgument objects
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setArguments($arguments = array())
|
||||
{
|
||||
|
@ -93,8 +85,6 @@ class InputDefinition
|
|||
* Adds an array of InputArgument objects.
|
||||
*
|
||||
* @param InputArgument[] $arguments An array of InputArgument objects
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function addArguments($arguments = array())
|
||||
{
|
||||
|
@ -111,8 +101,6 @@ class InputDefinition
|
|||
* @param InputArgument $argument An InputArgument object
|
||||
*
|
||||
* @throws \LogicException When incorrect argument is given
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function addArgument(InputArgument $argument)
|
||||
{
|
||||
|
@ -149,8 +137,6 @@ class InputDefinition
|
|||
* @return InputArgument An InputArgument object
|
||||
*
|
||||
* @throws \InvalidArgumentException When argument given doesn't exist
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getArgument($name)
|
||||
{
|
||||
|
@ -169,8 +155,6 @@ class InputDefinition
|
|||
* @param string|int $name The InputArgument name or position
|
||||
*
|
||||
* @return bool true if the InputArgument object exists, false otherwise
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function hasArgument($name)
|
||||
{
|
||||
|
@ -183,8 +167,6 @@ class InputDefinition
|
|||
* Gets the array of InputArgument objects.
|
||||
*
|
||||
* @return InputArgument[] An array of InputArgument objects
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getArguments()
|
||||
{
|
||||
|
@ -230,8 +212,6 @@ class InputDefinition
|
|||
* Sets the InputOption objects.
|
||||
*
|
||||
* @param InputOption[] $options An array of InputOption objects
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setOptions($options = array())
|
||||
{
|
||||
|
@ -244,8 +224,6 @@ class InputDefinition
|
|||
* Adds an array of InputOption objects.
|
||||
*
|
||||
* @param InputOption[] $options An array of InputOption objects
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function addOptions($options = array())
|
||||
{
|
||||
|
@ -260,8 +238,6 @@ class InputDefinition
|
|||
* @param InputOption $option An InputOption object
|
||||
*
|
||||
* @throws \LogicException When option given already exist
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function addOption(InputOption $option)
|
||||
{
|
||||
|
@ -293,8 +269,6 @@ class InputDefinition
|
|||
* @return InputOption A InputOption object
|
||||
*
|
||||
* @throws \InvalidArgumentException When option given doesn't exist
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getOption($name)
|
||||
{
|
||||
|
@ -311,8 +285,6 @@ class InputDefinition
|
|||
* @param string $name The InputOption name
|
||||
*
|
||||
* @return bool true if the InputOption object exists, false otherwise
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function hasOption($name)
|
||||
{
|
||||
|
@ -323,8 +295,6 @@ class InputDefinition
|
|||
* Gets the array of InputOption objects.
|
||||
*
|
||||
* @return InputOption[] An array of InputOption objects
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getOptions()
|
||||
{
|
||||
|
|
4
vendor/symfony/console/Input/InputOption.php
vendored
4
vendor/symfony/console/Input/InputOption.php
vendored
|
@ -15,8 +15,6 @@ namespace Symfony\Component\Console\Input;
|
|||
* Represents a command line option.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class InputOption
|
||||
{
|
||||
|
@ -41,8 +39,6 @@ class InputOption
|
|||
* @param mixed $default The default value (must be null for self::VALUE_REQUIRED or self::VALUE_NONE)
|
||||
*
|
||||
* @throws \InvalidArgumentException If option mode is invalid or incompatible
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct($name, $shortcut = null, $mode = null, $description = '', $default = null)
|
||||
{
|
||||
|
|
4
vendor/symfony/console/Input/StringInput.php
vendored
4
vendor/symfony/console/Input/StringInput.php
vendored
|
@ -19,8 +19,6 @@ namespace Symfony\Component\Console\Input;
|
|||
* $input = new StringInput('foo --bar="foobar"');
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class StringInput extends ArgvInput
|
||||
{
|
||||
|
@ -34,8 +32,6 @@ class StringInput extends ArgvInput
|
|||
* @param InputDefinition $definition A InputDefinition instance
|
||||
*
|
||||
* @deprecated The second argument is deprecated as it does not work (will be removed in 3.0), use 'bind' method instead
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct($input, InputDefinition $definition = null)
|
||||
{
|
||||
|
|
12
vendor/symfony/console/Output/ConsoleOutput.php
vendored
12
vendor/symfony/console/Output/ConsoleOutput.php
vendored
|
@ -25,8 +25,6 @@ use Symfony\Component\Console\Formatter\OutputFormatterInterface;
|
|||
* $output = new StreamOutput(fopen('php://stdout', 'w'));
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
|
||||
{
|
||||
|
@ -41,8 +39,6 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
|
|||
* @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface)
|
||||
* @param bool|null $decorated Whether to decorate messages (null for auto-guessing)
|
||||
* @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter)
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
|
||||
{
|
||||
|
@ -129,7 +125,13 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
|
|||
*/
|
||||
private function isRunningOS400()
|
||||
{
|
||||
return 'OS400' === php_uname('s');
|
||||
$checks = array(
|
||||
function_exists('php_uname') ? php_uname('s') : '',
|
||||
getenv('OSTYPE'),
|
||||
PHP_OS,
|
||||
);
|
||||
|
||||
return false !== stristr(implode(';', $checks), 'OS400');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
2
vendor/symfony/console/Output/NullOutput.php
vendored
2
vendor/symfony/console/Output/NullOutput.php
vendored
|
@ -21,8 +21,6 @@ use Symfony\Component\Console\Formatter\OutputFormatterInterface;
|
|||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Tobias Schultze <http://tobion.de>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class NullOutput implements OutputInterface
|
||||
{
|
||||
|
|
4
vendor/symfony/console/Output/Output.php
vendored
4
vendor/symfony/console/Output/Output.php
vendored
|
@ -26,8 +26,6 @@ use Symfony\Component\Console\Formatter\OutputFormatter;
|
|||
* * quiet: -q (no output)
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
abstract class Output implements OutputInterface
|
||||
{
|
||||
|
@ -40,8 +38,6 @@ abstract class Output implements OutputInterface
|
|||
* @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface)
|
||||
* @param bool $decorated Whether to decorate messages
|
||||
* @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter)
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = false, OutputFormatterInterface $formatter = null)
|
||||
{
|
||||
|
|
|
@ -17,8 +17,6 @@ use Symfony\Component\Console\Formatter\OutputFormatterInterface;
|
|||
* OutputInterface is the interface implemented by all Output classes.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
interface OutputInterface
|
||||
{
|
||||
|
@ -40,8 +38,6 @@ interface OutputInterface
|
|||
* @param int $type The type of output (one of the OUTPUT constants)
|
||||
*
|
||||
* @throws \InvalidArgumentException When unknown output type is given
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL);
|
||||
|
||||
|
@ -52,8 +48,6 @@ interface OutputInterface
|
|||
* @param int $type The type of output (one of the OUTPUT constants)
|
||||
*
|
||||
* @throws \InvalidArgumentException When unknown output type is given
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function writeln($messages, $type = self::OUTPUT_NORMAL);
|
||||
|
||||
|
@ -61,8 +55,6 @@ interface OutputInterface
|
|||
* Sets the verbosity of the output.
|
||||
*
|
||||
* @param int $level The level of verbosity (one of the VERBOSITY constants)
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setVerbosity($level);
|
||||
|
||||
|
@ -70,8 +62,6 @@ interface OutputInterface
|
|||
* Gets the current verbosity of the output.
|
||||
*
|
||||
* @return int The current level of verbosity (one of the VERBOSITY constants)
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getVerbosity();
|
||||
|
||||
|
@ -79,8 +69,6 @@ interface OutputInterface
|
|||
* Sets the decorated flag.
|
||||
*
|
||||
* @param bool $decorated Whether to decorate the messages
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setDecorated($decorated);
|
||||
|
||||
|
@ -88,8 +76,6 @@ interface OutputInterface
|
|||
* Gets the decorated flag.
|
||||
*
|
||||
* @return bool true if the output will decorate messages, false otherwise
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function isDecorated();
|
||||
|
||||
|
@ -97,8 +83,6 @@ interface OutputInterface
|
|||
* Sets output formatter.
|
||||
*
|
||||
* @param OutputFormatterInterface $formatter
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setFormatter(OutputFormatterInterface $formatter);
|
||||
|
||||
|
@ -106,8 +90,6 @@ interface OutputInterface
|
|||
* Returns current output formatter instance.
|
||||
*
|
||||
* @return OutputFormatterInterface
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getFormatter();
|
||||
}
|
||||
|
|
|
@ -25,8 +25,6 @@ use Symfony\Component\Console\Formatter\OutputFormatterInterface;
|
|||
* $output = new StreamOutput(fopen('/path/to/output.log', 'a', false));
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class StreamOutput extends Output
|
||||
{
|
||||
|
@ -41,8 +39,6 @@ class StreamOutput extends Output
|
|||
* @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter)
|
||||
*
|
||||
* @throws \InvalidArgumentException When first argument is not a real stream
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct($stream, $verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
|
||||
{
|
||||
|
@ -87,7 +83,7 @@ class StreamOutput extends Output
|
|||
*
|
||||
* Colorization is disabled if not supported by the stream:
|
||||
*
|
||||
* - Windows without Ansicon and ConEmu
|
||||
* - Windows without Ansicon, ConEmu or Mintty
|
||||
* - non tty consoles
|
||||
*
|
||||
* @return bool true if the stream supports colorization, false otherwise
|
||||
|
@ -95,7 +91,7 @@ class StreamOutput extends Output
|
|||
protected function hasColorSupport()
|
||||
{
|
||||
if (DIRECTORY_SEPARATOR === '\\') {
|
||||
return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI');
|
||||
return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') || 'xterm' === getenv('TERM');
|
||||
}
|
||||
|
||||
return function_exists('posix_isatty') && @posix_isatty($this->stream);
|
||||
|
|
4
vendor/symfony/console/Question/Question.php
vendored
4
vendor/symfony/console/Question/Question.php
vendored
|
@ -217,7 +217,7 @@ class Question
|
|||
*
|
||||
* The normalizer can be a callable (a string), a closure or a class implementing __invoke.
|
||||
*
|
||||
* @param string|\Closure $normalizer
|
||||
* @param callable $normalizer
|
||||
*
|
||||
* @return Question The current instance
|
||||
*/
|
||||
|
@ -233,7 +233,7 @@ class Question
|
|||
*
|
||||
* The normalizer can ba a callable (a string), a closure or a class implementing __invoke.
|
||||
*
|
||||
* @return string|\Closure
|
||||
* @return callable
|
||||
*/
|
||||
public function getNormalizer()
|
||||
{
|
||||
|
|
|
@ -164,7 +164,7 @@ class SymfonyStyle extends OutputStyle
|
|||
*/
|
||||
public function success($message)
|
||||
{
|
||||
$this->block($message, 'OK', 'fg=white;bg=green', ' ', true);
|
||||
$this->block($message, 'OK', 'fg=black;bg=green', ' ', true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
1
vendor/symfony/console/composer.json
vendored
1
vendor/symfony/console/composer.json
vendored
|
@ -19,7 +19,6 @@
|
|||
"php": ">=5.3.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/phpunit-bridge": "~2.7",
|
||||
"symfony/event-dispatcher": "~2.1",
|
||||
"symfony/process": "~2.1",
|
||||
"psr/log": "~1.0"
|
||||
|
|
Reference in a new issue