This PR was squashed before being merged into the master branch (closes#6368).
Discussion
----------
[2.3] [Console] TableHelper
When building a console application it may be useful to display tabular data.
`TableHelper` can display table header and rows, customizable alignment of columns, cell padding and colors.
Basic usage example:
```php
$table = $app->getHelperSet()->get('table');
$table
->setHeaders(array('ISBN', 'Title', 'Author'))
->setRows(array(
array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),
array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'),
array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'),
array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'),
))
;
$table->render($output);
```
Output:
![table](https://f.cloud.github.com/assets/208957/14955/6fb4f500-46ca-11e2-8435-0f6b22f96e58.png)
If this PR gets merged I will submit doc PR as well.
I'm sure there is a plenty of room for improvements so any feedback is welcome.
Commits
-------
8de7813 [2.3] [Console] TableHelper
This PR was merged into the master branch.
Discussion
----------
Console dispatcher
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #3889, #6124
| License | MIT
| Doc PR | symfony/symfony-docs#2352
refs #1884, #1929
This is an alternative implementation for adding events to console applications.
This implementation has the following features:
* Available for anyone using the Console component and it is not tied to
FrameworkBundle (this is important as one thing we are trying to solve is
email sending from a command, and frameworks like Silex using the Console
component needs a solution too);
* Non-intrusive as the current code has not been changed (except for renaming
an internal variable that was wrongly named -- so that's not strictly needed
for this PR)
* The new DispatchableApplication class also works without a dispatcher,
falling back to the regular behavior. That makes easy to create applications
that can benefit from a dispatcher when available, but can still work
otherwise.
* Besides the *before* and *after* events, there is also an *exception* event
that is dispatched whenever an exception is thrown.
* Each event is quite powerful and can manipulate the input, the output, but
also the command to be executed.
Commits
-------
4f9a55a refactored the implementation of how a console application can handle events
4edf29d added helperSet to console event objects
f224102 Added events for CLI commands
This PR was squashed before being merged into the master branch (closes#7300).
Discussion
----------
[Console] Progress helper enhancements
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | ~
| License | MIT
| Doc PR | ~
Two enhancements:
1. The progress bar clears the current line before writing the current progress. This can cause some flickering in the terminal. I've modified the write method to append whitespace to the line to be written, so it matches the previous line's length.
2. Added a `setCurrent` method to set the current progress. Rather than advancing by 1 or more steps, sometimes you want to just set the current state. For example if you are downloading a file, and a callback provides you with the current download status. A workaround for this could be to keep track of the previous event, calculate the difference, and advancing by the diff. But it's easier to just set the current progress.
Sidenotes:
* The [`overwrite`](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Console/Helper/ProgressHelper.php#L387) method copied documentation of the Output's [`write`](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Console/Output/Output.php#L139) method. The difference is, the overwrite method does not handle an array of messages. I've updated the documentation for this.
* The helper uses `strlen` to calculate line lengths. This could cause a problem when using multibyte strings. I'd change it to `mb_strlen`, but I'm not sure if the `mb_string` extension is required by Symfony.
Commits
-------
5ae76f0 [Console] Progress helper enhancements
* 2.2: (70 commits)
change wrapped exception message to be more usefull
updated VERSION for 2.0.23
update CONTRIBUTORS for 2.0.23
updated CHANGELOG for 2.0.23
[Form] fixed failing test
[DomCrawler] added support for query string with slash
Fixed invalid file path for hiddeninput.exe on Windows.
fix xsd definition for strict-requirements
[WebProfilerBundle] Fixed the toolbar styles to apply them in IE8
[ClassLoader] fixed heredocs handling
fixed handling of heredocs
Add a public modifier to an interface method
removing xdebug extension
[HttpRequest] fixes Request::getLanguages() bug
[HttpCache] added a test (cached content should be kept after purging)
[DoctrineBridge] Fixed non-utf-8 recognition
[Security] fixed HttpUtils class tests
replaced new occurences of 'Request::create()' with '::create()'
changed sub-requests creation to '::create()'
fixed merge issue
...
Conflicts:
src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig
src/Symfony/Component/DomCrawler/Link.php
src/Symfony/Component/Translation/Translator.php
* 2.2: (26 commits)
[FrameworkBundle] Fixes invalid serialized objects in cache
remove dead code in yaml component
Fixed typo in UPGRADE-2.2
fixed typo
RedisProfilerStorage wrong db-number/index-number selected
[DependencyInjection] added a test for the previous merge (refs #7261)
Unset loading[$id] in ContainerBuilder on exception
Default validation message translation fix.
remove() should not use deprecated getParent() so it does not trigger deprecation internally
adjust routing tests to not use prefix in addCollection
add test for uniqueness of resources
added tests for addDefaults, addRequirements, addOptions
adjust RouteCollectionTest for the addCollection change and refactor the tests to only skip the part that really needs the config component
added tests for remove() that wasnt covered yet and special route name
refactor interator test that was still assuming a tree
adjust tests to no use addPrefix with options
adjusted tests to not use RouteCollection::getPrefix
[Routing] trigger deprecation warning for deprecated features that will be removed in 2.3
[Console] fixed StringInput binding
[Console] added string input test
...
* 2.2: (24 commits)
Options small typo
[Console] fixed unparsed StringInput tokens
Mask PHP_AUTH_PW header in profiler
[TwigBridge] fixed trans twig extractor
[Finder] adds adapter selection/unselection capabilities
[DomCrawler] fix handling of schemes by Link::getUri()
[Console] Fixed comment
[TwigBridge] fixed the translator extractor that were not trimming the text in trans tags (closes#7056)
Fixed handling absent href attribute in base tag
fixed paths/notPaths regex for shell adapters
fix issue 4911
Adds expandable globs support to shell adapters
[HttpFoundation] Fixed messed up headers
Fixes AppCache + ESI + Stopwatch problem
added a DebuClassLoader::findFile() method to make the wrapping less invasive
bumped Symfony version to 2.2.0-RC4-DEV
updated VERSION for 2.2.0-RC3
updated CHANGELOG for 2.2.0-RC3
fixed CHANGELOG
bumped Symfony version to 2.1.9-DEV
...
* 2.1:
Options small typo
[Console] fixed unparsed StringInput tokens
[TwigBridge] fixed trans twig extractor
[DomCrawler] fix handling of schemes by Link::getUri()
[Console] Fixed comment
[TwigBridge] fixed the translator extractor that were not trimming the text in trans tags (closes#7056)
Fixed handling absent href attribute in base tag
added a DebuClassLoader::findFile() method to make the wrapping less invasive
fixed CHANGELOG
bumped Symfony version to 2.1.9-DEV
updated VERSION for 2.1.8
updated CHANGELOG for 2.1.8
StringInput resets the given options.
Conflicts:
src/Symfony/Component/HttpKernel/Kernel.php
This PR was merged into the 2.1 branch.
Commits
-------
5b19c89 [Console] fixed unparsed StringInput tokens
635b1fc StringInput resets the given options.
Discussion
----------
[Console] fixes unparsed StringInput tokens
`StringInput` instances call `setToken` after constructor, `parse` method is called in constructor, so `StringInput` tokens where never parsed.
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #6749
This PR was squashed before being merged into the master branch (closes#6789).
Commits
-------
917f473 [Console] Removing unnecessary sprintf in Application->getHelp
Discussion
----------
[Console] Removing unnecessary sprintf in Application->getHelp
Minor change of the `Symfony\Component\Console\Application->getHelp()` method.
I have spotted:
1. an unnecessary `sprintf` call (no `args` arguments);
2. two ways of adding a new line in the help (an empty string as new entry of the array and a `\n` at the end of the string).
It seems to be there since the begining and it looks like a forgoten change to me, so I fixed them by removing the `sprintf` call and using a new array entry (empty string) instead of the `\n`.
| Q | A
| ------------- | ---
| License | MIT
* 2.1:
[Yaml] fixed default value
Added Yaml\Dumper::setIndentation() method to allow a custom indentation level of nested nodes.
added a way to enable/disable object support when parsing/dumping
added a way to enable/disable PHP support when parsing a YAML input via Yaml::parse()
fixed CS
[Process] Fix docblocks, remove `return` from `PhpProcess#start()` as parent returns nothing, cleaned up `ExecutableFinder`
fixes a bug when output/error output contains a % character
[Console] fixed input bug when the value of an option is empty (closes#6649, closes#6689)
[Profiler] [Redis] Fix sort of profiler rows.
Fix version_compare() calls for PHP 5.5.
Removed underscores from test method names to be consistent with other components.
[Process] In edge cases `getcwd()` can return `false`, then `proc_open()` should get `null` to use default value (the working dir of the current PHP process)
Fix version_compare() calls for PHP 5.5.
Handle the deprecation of IntlDateFormatter::setTimeZoneId() in PHP 5.5.
removed the .gitattributes files (closes#6605, reverts #5674)
[HttpKernel] Clarify misleading comment in ExceptionListener
Conflicts:
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_style.html.twig
src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php
src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php
src/Symfony/Component/Form/Tests/Util/PropertyPathTest.php
src/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php
src/Symfony/Component/Process/Process.php
* 2.0:
[Yaml] fixed default value
Added Yaml\Dumper::setIndentation() method to allow a custom indentation level of nested nodes.
added a way to enable/disable object support when parsing/dumping
added a way to enable/disable PHP support when parsing a YAML input via Yaml::parse()
[Console] fixed input bug when the value of an option is empty (closes#6649, closes#6689)
Conflicts:
src/Symfony/Component/Yaml/Dumper.php
src/Symfony/Component/Yaml/Parser.php
src/Symfony/Component/Yaml/Tests/DumperTest.php
src/Symfony/Component/Yaml/Tests/ParserTest.php
src/Symfony/Component/Yaml/Yaml.php
* 2.1:
[Console] Fix style escaping parsing
[Console] Make style formatter matching less greedy to avoid having to escape when not needed
[Bundle] [FrameworkBundle] fixed indentation in esi.xml services file.
[Component] [Security] fixed PSR-2 coding violation in ClassUtilsTest class.
[Form] Fixed EntityChoiceList when loading objects with negative integer IDs
[TwigBundle] There is no CSS visibility of display, should be visible instead
[Form] corrected source node for a Danish translation
[DependencyInjection] fixed a bug where the strict flag on references were lost (closes#6607)
[HttpFoundation] Check if required shell functions for `FileBinaryMimeTypeGuesser` are not disabled
[CssSelector] added css selector with empty string
[HttpFoundation] Docblock for Request::isXmlHttpRequest() now points to Wikipedia
[DependencyInjection] refactored code to avoid logic duplication
[Form] Deleted references in FormBuilder::getFormConfig() to improve performance
[HttpFoundation] Update docblock for non-working method
Conflicts:
src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.html.twig
src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.html.twig
This PR was merged into the master branch.
Commits
-------
2b73975 Add new tests and fix problem with the second option being chosen on down arrow
8a0bcfb Use strpos in place of substr
9864d95 Not much use in blanking the array each time
a4d711c Enable arrow keys to browse matched autocomplete options
Discussion
----------
[Console] Enable arrow keys to browse matched autocomplete options
See notes in original autocomplete pull request: #6391
See also @bamarni's pull request implementing more or less the same stuff: #6561
---------------------------------------------------------------------------
by fabpot at 2013-01-05T10:12:47Z
Looks good to me. Can you add some unit tests?
---------------------------------------------------------------------------
by bamarni at 2013-01-05T12:51:51Z
1 line addition... you definitely got me on the diff!
That's what I had mind too, excepted for the default highlight, but as you said it's usually displayed in the question so it 's not necessary. 👍
---------------------------------------------------------------------------
by lmcd at 2013-01-06T04:07:02Z
@fabpot Added tests
* 2.1:
[Console] made Application::getTerminalDimensions() public
Revert "merged branch egeloen/f-2.0-terminal-width (PR #6571)"
[2.1] [Console] Added getTerminalDimensions() with fix for osx/freebsd
Restrict Monolog version to be in version `<1.3`. Because of conflict between `HttpKernel/Log/LoggerInterface` and `Psr\Log\LoggerInterface` (PSR-3)
Conflicts:
composer.json
* 2.1:
Restrict Monolog version to be in version <1.3
[Console] Make getTerminalWith & getTerminalHeight public
[DependencyInjection] fixed PhpDumper optimizations when an inlined service depends on the current one indirectly
[DependencyInjection] fixed PhpDumper when an inlined service definition has some properties
[DependencyInjection] added some tests for PhpDumper when the container is compiled
[DependencyInjection] fixed CS
[Process] Do not reset stdout/stderr pipes on Interrupted system call
[Locale] Adjust `StubIntlDateFormatter` to have new methods added in PHP 5.5
use the right RequestMatcherInterface
[Locale] Fix failing `StubIntlDateFormatter` tests in PHP 5.5
[Locale] Fix failing `StubIntlDateFormatter` in PHP 5.5
[Form] Fix failing `MonthChoiceList` in PHP 5.5
Update .travis.yml
Conflicts:
src/Symfony/Bridge/Monolog/composer.json
src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php
* 2.0:
Restrict Monolog version to be in version <1.3
[Console] Make getTerminalWith & getTerminalHeight public
[DependencyInjection] fixed PhpDumper optimizations when an inlined service depends on the current one indirectly
[DependencyInjection] fixed PhpDumper when an inlined service definition has some properties
[DependencyInjection] added some tests for PhpDumper when the container is compiled
[DependencyInjection] fixed CS
[Locale] Adjust `StubIntlDateFormatter` to have new methods added in PHP 5.5
[Locale] Fix failing `StubIntlDateFormatter` tests in PHP 5.5
[Locale] Fix failing `StubIntlDateFormatter` in PHP 5.5
[Form] Fix failing `MonthChoiceList` in PHP 5.5
Update .travis.yml
Conflicts:
src/Symfony/Bridge/Monolog/composer.json
src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php
src/Symfony/Component/Form/Extension/Core/ChoiceList/MonthChoiceList.php
tests/Symfony/Tests/Component/DependencyInjection/Fixtures/yaml/services9.yml
This PR was merged into the 2.0 branch.
Commits
-------
f299bd0 [Console] Make getTerminalWith & getTerminalHeight public
Discussion
----------
[Console] Make getTerminalWith & getTerminalHeight public
Bug fix: yes
Feature addition: yes
Backwards compatibility break: no
Fixes the following tickets: ~
Todo: -
License of the code: MIT
Documentation PR: ~
After demand in #6567, I open an other one on the 2.0 branch.
* 2.1: (24 commits)
updated license year
Update src/Symfony/Component/HttpFoundation/Response.php
[Form] Fixed inheritance of "error_bubbling" in RepeatedType
[Form] Fixed DateType when used with the intl extension disabled.
[HttpFoundation] fix return types and handling of zero in Response
[HttpFoundation] better fix for non-parseable Expires header date
Fixed missing plural message in portuguese validator
Fix Expires when the header is -1
[DoctrineBridge] Allowing memcache port to be 0 to support memcache unix domain sockets.
[Console] fixed unitialized properties (closes#5935)
[Process] Prevented test from failing when pcntl extension is not enabled.
Revert "[DoctrineBridge] Improved performance of the EntityType when used with the "query_builder" option"
[Form] Fixed failing tests for DateTimeToStringTransformer.
[Locale] Fixed the StubLocaleTest for ICU versions lower than 4.8.
[Bundle] [FrameworkBundle] fixed typo in phpdoc of the SessionListener.
[Form] Fixed test regression introduced in #6440
[Tests] Fix namespaces
Fixed php doc of GenericEvent::__construct
HttpUtils must handle RequestMatcher too
use preferred_choices in favor of preferred_query
...
Conflicts:
src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php
* 2.0:
updated license year
Update src/Symfony/Component/HttpFoundation/Response.php
[Console] fixed unitialized properties (closes#5935)
[Bundle] [FrameworkBundle] fixed typo in phpdoc of the SessionListener.
bumped Symfony version to 2.0.21-DEV
updated VERSION for 2.0.21
updated CHANGELOG for 2.0.21
Conflicts:
src/Symfony/Bundle/SwiftmailerBundle/LICENSE
src/Symfony/Component/Filesystem/LICENSE
src/Symfony/Component/HttpFoundation/Response.php
src/Symfony/Component/HttpKernel/Kernel.php
This PR was squashed before being merged into the master branch (closes#6391).
Commits
-------
7bad0ef [Console] Add autocomplete as you type
Discussion
----------
[Console] Add autocomplete as you type
Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
License of the code: MIT
Finally got around to reviving the console autocomplete code.
Is now up to date with Symfony master. Also changed backspace behaviour to remove one character instead of two.
stty stuff is a mystery to a lot of people, so I've commented verbosely.
See also: https://github.com/symfony/symfony/pull/2364
---------------------------------------------------------------------------
by lmcd at 2012-12-17T10:11:16Z
@stof - updated with a better solution
---------------------------------------------------------------------------
by Seldaek at 2012-12-17T10:25:15Z
Seems pretty cool, but could you replace all `/usr/bin/env stty` calls by simply `stty`? That way it would also work on windows - if you have mingw or cygwin installed and stty is in the path at least. I don't see the benefit of doing the /usr/bin/env trick here. That's good for shebang lines because you need an absolute path, but in an exec/shell_exec call, you can rely on the PATH and just type the command name.
---------------------------------------------------------------------------
by lmcd at 2012-12-17T18:33:06Z
@Seldaek makes sense. Changed.
---------------------------------------------------------------------------
by lmcd at 2012-12-17T21:32:17Z
Tested on Mac OS X 10.8 and Ubuntu 12.04. Would be great to hear from people on Windows, cygwin and those with exotic terminal setups.
I'll update my fork of SensioGeneratorBundle a little later with support for this.
@fabpot - is there still time for this to land in 2.2?
---------------------------------------------------------------------------
by fabpot at 2012-12-17T21:34:23Z
If we have good feedback from Windows users, yes it can land in 2.2. ping @pborreli
---------------------------------------------------------------------------
by michelsalib at 2012-12-17T23:39:50Z
A am about to try on windows 7 with cmd, powershell and cygwin. Any other way to test without writing a new command using the helper ?
---------------------------------------------------------------------------
by michelsalib at 2012-12-18T00:01:42Z
I tried on Windows 7 with cmd, powershell and cygwin and got this error: `Le chemin d'accès spécifié est introuvable.`. You can translate it to `The specified path could not be found`.
---------------------------------------------------------------------------
by lmcd at 2012-12-18T00:01:43Z
I've updated SensioGeneratorBundle to support autocompletion on the `generate:doctrine:entity` command. It autocompletes bundle names, configuration formats and field types. See here: c627c67ce7
@michelsalib ping
---------------------------------------------------------------------------
by lmcd at 2012-12-18T00:03:43Z
@michelsalib - hmm. I imagine it's either a problem locating stty or some configuration issue on your end. Do you have file/line number?
---------------------------------------------------------------------------
by michelsalib at 2012-12-18T00:04:41Z
Verbose mode did not help. Let me try with some dirty line by line check to see if I can give you a line.
---------------------------------------------------------------------------
by michelsalib at 2012-12-18T00:09:54Z
My bad, I should have guessed that line 144 `exec('/usr/bin/env stty', $output, $exitcode);` cannot work on regular Windows environment. This should at least fails silently for users using cmd or powershell. Apparently cygwin users can activate stty. Let me investigate.
---------------------------------------------------------------------------
by michelsalib at 2012-12-18T00:16:30Z
Ok, cygwin comes pre-bundled with stty. I applied the fix recommended by @Seldaek and it fixed the cygwin command.
The only remaining problem is that your redirect the output of the exec call to the console, in this case cmd and powershell output the error telling that stty is not defined in the system: `'stty' n'est pas reconnu en tant que commande interne ou externe, un programme exécutable ou un fichier de commandes.`.
---------------------------------------------------------------------------
by lmcd at 2012-12-18T00:17:41Z
Ah, I see you're running the unit tests. The `hasSttyAvailable` method was lifted from `DialogHelper` where it is also used in `askHiddenResponse`. Question: is `defined('PHP_WINDOWS_VERSION_BUILD')` true for cygwin?
---------------------------------------------------------------------------
by michelsalib at 2012-12-18T00:22:14Z
I am not running test, I am actually running a homemade command:
```
$dialog = $this->getHelper('dialog');
$ask = $dialog->ask($output, 'Autocomplete example', null, array(
'French', 'English', 'Chineese',
));
$output->writeln($ask);
```
`hasSttyAvailable` is called in the ask function at line 80. The incriminated function is here : 9ebcd4bac9/src/Symfony/Component/Console/Helper/DialogHelper.php (L411).
Also `defined('PHP_WINDOWS_VERSION_BUILD')` is true in the three of my consoles.
---------------------------------------------------------------------------
by lmcd at 2012-12-18T00:27:16Z
@michelsalib see 7be142481c
---------------------------------------------------------------------------
by michelsalib at 2012-12-18T00:28:20Z
Why keeping `/usr/bin/env` in your calls ? Cygwin cannot interpret it as long a stty is not in this folder.
---------------------------------------------------------------------------
by lmcd at 2012-12-18T00:29:30Z
@michelsalib `/usr/bin/env` was put there by someone else for the `askHiddenResponse` method. I can remove it, so long as it doesn't break something else.
---------------------------------------------------------------------------
by michelsalib at 2012-12-18T00:34:11Z
IMO users who want's to use stty should have it configured in the PATH, as @Seldaek said. Prefixing the folder where the stty "should" be is a nonsense to me. Moreover it might work well on *nix systems, but will never be compatible with cygwin.
I tested it locally (without the `/usr/bin/env` prefix) and now I have a nice autocomplete on Cygwin, and nothing on cmd or powershell. Which is just what I expected.
@lmcd very nice work :)
---------------------------------------------------------------------------
by lmcd at 2012-12-18T05:17:32Z
For anyone interested, you can scroll through available autocomplete options that match typed characters by using up and down arrow keys. This has been implemented in a seperate branch here: https://github.com/lmcd/symfony/tree/autocomplete-arrows
---------------------------------------------------------------------------
by drak at 2012-12-18T19:13:34Z
@lmcd - The console PRs never cease to amaze me. Really well done!
---------------------------------------------------------------------------
by fabpot at 2012-12-19T13:58:33Z
@lmcd Is it mergeable now?
---------------------------------------------------------------------------
by lmcd at 2012-12-19T17:59:09Z
@fabpot Yes.
---------------------------------------------------------------------------
by lmcd at 2012-12-19T20:03:31Z
Edit: commits squashed
---------------------------------------------------------------------------
by lmcd at 2012-12-19T21:29:07Z
@stloyd I have addressed the two things mentioned. I'm now using $i in place of strlen($ret) as it held the same value.
---------------------------------------------------------------------------
by fabpot at 2012-12-20T07:09:27Z
@lmcd: Thanks a lot for finishing this in time for 2.2. Before I can merge, there are two remaining tasks:
* add a note about the new feature in the CHANGELOG file of the Console component;
* create a PR on `symfony/symfony-docs` to explain the new feature.
Can you take care of that?
---------------------------------------------------------------------------
by lmcd at 2012-12-20T07:11:15Z
@fabpot sure
---------------------------------------------------------------------------
by stloyd at 2012-12-29T09:15:23Z
@lmcd You should squash your "merge" commit.
---------------------------------------------------------------------------
by lmcd at 2012-12-29T13:49:37Z
Well that screwed up. File Changed: 216 :S
Edit: hard reset to an earlier hash and reapplied the CHANGELOG commit. Should be good now ping @stloyd
---------------------------------------------------------------------------
by stloyd at 2012-12-29T14:33:58Z
@lmcd `ask()` method is quite long now, but in overall looks ok =)
---------------------------------------------------------------------------
by lmcd at 2013-01-02T20:49:49Z
Anything preventing this being merged? Ping @fabpot
* 2.1:
[Console] Add support for parsing terminal width/height on localized windows, fixes#5742
[Form] Fixed treatment of countables and traversables in Form::isEmpty()
refactor ControllerNameParser
[Form] Fixed FileType not to throw an exception when bound empty
- Test undefined index #
Maintain array structure
Check if key # is defined in $value
Update src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf
This PR was merged into the master branch.
Commits
-------
ea74610 jumping progress bar fix for windows & unix
6a0ee27 [Console] fixed progress bar jumping
Discussion
----------
[Console] fixed progress bar jumping for windows & unix env
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -
---------------------------------------------------------------------------
by pborreli at 2012-12-11T13:58:25Z
Good implementation but could you please check http://symfony.com/doc/current/contributing/code/standards.html
* 2.1:
fixed CS
fixed CS
[Security] fixed path info encoding (closes#6040, closes#5695)
[HttpFoundation] added some tests for the previous merge and removed dead code (closes#6037)
Improved Cache-Control header when no-cache is sent
removed unneeded comment
Fix to allow null values in labels array
fix date in changelog
removed the Travis icon (as this is not stable enough -- many false positive, closes#6186)
Revert "merged branch gajdaw/finder_splfileinfo_fpassthu (PR #4751)" (closes#6224)
Fixed a typo
Fixed: HeaderBag::parseCacheControl() not parsing quoted zero correctly
[Form] Fix const inside an anonymous function
[Config] Loader::import must return imported data
[DoctrineBridge] Fixed caching in DoctrineType when "choices" or "preferred_choices" is passed
[Form] Fixed the default value of "format" in DateType to DateType::DEFAULT_FORMAT if "widget" is not "single_text"
[HttpFoundation] fixed a small regression
Conflicts:
src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
This PR was squashed before being merged into the master branch (closes#5888).
Commits
-------
2379d86 CS Fixes - Replaced "array of type" by "Type[]" in PHPDoc block
Discussion
----------
CS Fixes - Replaced "array of type" by "Type[]" in PHPDoc block
Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: no (but tests doesn't pass on master too). See Travis.
License of the code: MIT
Documentation PR: Not Applicable
Status: Finished
To improve support of the eclipse PDT pluggin (for autocompletion), I propose to change the array notation in PHPDoc blocks to match the phpDocumentor notation for "array of type".
Modifications are made for the following components:
- BrowserKit
- ClassLoader
- Config
- Console
- CssSelector
- DependencyInjection
- DomCrawler
- EventDispatcher (no changes)
- Filesystem (no changes)
- Finder
- Form
- HttpFoundation
- HttpKernel
- Locale
- OptionResolver (no changes)
- Process (no changes)
- Routing (no changes)
- Serializer (no changes)
- Templating
- Translation
- Validator
- Yaml (no changes)
- Security
- Stopwatch (no changes)
See Proposal https://github.com/symfony/symfony/pull/5852
---------------------------------------------------------------------------
by pborreli at 2012-11-01T15:19:27Z
will you make a PR for each component ? why not only one PR with one commit for each component instead ?
---------------------------------------------------------------------------
by raziel057 at 2012-11-01T15:32:39Z
Ok, I'm going try to do it.
---------------------------------------------------------------------------
by raziel057 at 2012-11-01T16:12:56Z
I would like to rename my branch from COMPONENT_Form to changes-phpdoc (as all modifications would be commited in only one branch), so I tried to execute the following command but I have an error.
git remote rename COMPONENT_Form changes-phpdoc
error: Could not rename config section 'remote.COMPONENT_Form' to 'remote.changes-phpdoc'
Do you know how to do it?
---------------------------------------------------------------------------
by pborreli at 2012-11-01T16:14:26Z
don't rename it, you will have to close and make another PR which is useless here, just edit the title.
---------------------------------------------------------------------------
by stof at 2012-11-01T16:16:17Z
and ``git remote rename`` is about renaming a remote repo, not a branch
---------------------------------------------------------------------------
by raziel057 at 2012-11-03T11:36:02Z
Is it normal that all my commit are duplicated? I would like just update my master and merge with my branch.
---------------------------------------------------------------------------
by fabpot at 2012-11-06T10:22:55Z
@raziel057 Can you rebase on master? That should fix your problem.
---------------------------------------------------------------------------
by fabpot at 2012-11-09T13:28:53Z
@raziel057 Can you finish this PR?
---------------------------------------------------------------------------
by Tobion at 2012-11-09T13:34:45Z
I'll do it for the routing component this evening because I know it by heart. ^^
---------------------------------------------------------------------------
by raziel057 at 2012-11-09T15:06:26Z
@Tobion ok Thanks!
@fabpot Yes, I will try to finish it this week end.
---------------------------------------------------------------------------
by raziel057 at 2012-11-11T13:04:07Z
@Tobion Did you already change PHPDoc in the Routing component?
---------------------------------------------------------------------------
by Tobion at 2012-11-11T15:21:18Z
@raziel057 Yes I'm working on it.
---------------------------------------------------------------------------
by Tobion at 2012-11-12T15:16:31Z
@raziel057 Done. See #5994
* 2.1: (24 commits)
forced Travis to use source to workaround their not-up-to-date Composer on PHP 5.3.3
[Routing] removed irrelevant string cast in Route
Fixed typo
Make YamlFileLoader and XmlFileLoader file loading extensible
[HttpKernel] fix typo
Fixed singularization of "prices"
[Form] Removed an exception that prevented valid formats from being passed, e.g. "h" for the hour, "L" for the month etc.
[HttpKernel] fixed Client when using StreamedResponses (closes#5370)
fixed PDO session handler for Oracle (closes#5829)
[HttpFoundation] fixed PDO session handler for Oracle (closes#5829)
[Locale] removed a check that is done too early (and it is done twice anyways)
Update src/Symfony/Component/Validator/Resources/translations/validators.fa.xlf
Adding new localized strings for farsi validation.
[HttpFoundation] moved the HTTP protocol check from StreamedResponse to Response (closes#5937)
[Form] Fixed forms not to be marked invalid if their children are already marked invalid
[Form] Excluded some tests in NumberToLocalizedStringTransformerTest which fail on ICU 4.4, but work on ICU 4.8
added missing tests from previous merge
[Form] Fixed NumberToLocalizedStringTransformer to accept both comma and dot as decimal separator, if possible
Fix export-ignore on Windows
Show correct class name InputArgument in error message
...
Conflicts:
.travis.yml
src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php
This PR was merged into the 2.1 branch.
Commits
-------
646a714 Fix export-ignore on Windows
Discussion
----------
Fix export-ignore on Windows
Rules:
Tests/ export-ignore
don't work on Windows. My proposition is:
/Tests export-ignore
* 2.0:
[Form] Fixed NumberToLocalizedStringTransformer to accept both comma and dot as decimal separator, if possible
Show correct class name InputArgument in error message
shows correct class name InputOption in error message
The exception message should say which field is not mapped
[HttpFoundation] Fix name sanitization after perfoming move
Add check to Store::unlock to ensure file exists
Conflicts:
src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php
src/Symfony/Component/HttpFoundation/File/UploadedFile.php
tests/Symfony/Tests/Component/Console/Input/InputArgumentTest.php
tests/Symfony/Tests/Component/Console/Input/InputOptionTest.php
tests/Symfony/Tests/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php
tests/Symfony/Tests/Component/HttpFoundation/File/FileTest.php
tests/Symfony/Tests/Component/HttpKernel/HttpCache/StoreTest.php
When setting the process isolation of a shell to true:
`setProcessIsolation(true)` throw a `\RuntimeException` if the Process component isn't available.
* 2.1:
removed unused use statements
[Form] Adapted HTML5 format in DateTimeType as response to a closed ICU ticket
[2.1][HttpFoundation] Fixed Php doc in Request::get
bumped Symfony version to 2.1.4-DEV
updated VERSION for 2.1.3
update CONTRIBUTORS for 2.1.3
updated CHANGELOG for 2.1.3
merged branch jakzal/yamlDoubleQuotesDumperFix (PR #4320)
Conflicts:
src/Symfony/Component/HttpKernel/Kernel.php
This PR was squashed before being merged into the master branch (closes#5638).
Commits
-------
98b68c2 [2.2][Console] Add possibility to add new input options to console application
Discussion
----------
[2.2][Console] Add possibility to add new input options to console application
Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -
At the moment it is not possible to overwrite the input arguments of a console application to not have the default ones. Adding is possible with:
$cli->getDefinition()->addOption(new InputOption('--custom', '-c', InputOption::VALUE_NONE, 'Use custom option.'));
Also added some simple tests for adding a custom HelperSet.
---------------------------------------------------------------------------
by dirkaholic at 2012-10-04T06:29:57Z
OK, is a bit inconsistent with what it's done with the helper set then, where you can use both ways. New PR for the tests is the referenced one.
---------------------------------------------------------------------------
by stof at 2012-10-04T18:57:42Z
@dirkaholic Can you rebase your branch (it conflicts with master) and squash your commit together ?
http://symfony.com/doc/current/contributing/code/patches.html#rework-your-patch may help you if you don't know how to do it
---------------------------------------------------------------------------
by dirkaholic at 2012-10-04T19:53:09Z
Done.
---------------------------------------------------------------------------
by stof at 2012-10-04T21:40:53Z
@dirkaholic the rebase worked fine but you have not squashed the commits together.
---------------------------------------------------------------------------
by dirkaholic at 2012-10-05T05:35:30Z
What do you mean ? Only the setDefinition function plus test is left here. The rest was already merged with https://github.com/symfony/symfony/issues/5668
---------------------------------------------------------------------------
by stof at 2012-10-05T10:48:53Z
@dirkaholic Squashing is about making the PR use only 1 commit instead of 2 (the second one changing only some whitespaces, which is not what its message says). But @fabpot told me that he improved his merging tool and so he can squash it when merging so it is OK.
* 2.1: (28 commits)
Delete use of CreationExeption
[Form] Fixed error message in PropertyPath to not advice to use a non-existing feature
[Form] Fixed creation of multiple money fields with different currencies
[Form] Fixed setting the "data" option to an object in "choice" and "entity" type
Fixed Serbian plural translations.
Fixed IPv6 Check in RequestMatcher
Fix typo
change what I think is a typo
[Console] Fix error when mode is not in PATH
[WebProfilerBundle] fixed macro usage (to be forward compatible with Twig 2.x)
Change monolog require-dev to use the branch alias instead of dev-master
[FrameworkBundle] partially reverted previous merge
[2.1] Added missing error return codes in commands
Made the router lazy when setting the context
[WebProfilerBundle] fixed typos
Fix incorrect variable in FileProfilerStorage
UnitTest fix
UnitTest fix
added a unit test
fixed#5384
...
This PR was merged into the master branch.
Commits
-------
aefa495 Move `hiddeninput.exe` to Resources/bin
c0f8a63 Fix CS and typos
26c35e0 Skip askHiddenResponse test on windows
e2eaf5a Update Changelog, add Readme note about hidden input third party
ac01d5d Fix tests and CS
e396edb [Console] Add DialogHelper::askHiddenResponse method
Discussion
----------
[Console] Add DialogHelper::askHiddenResponse method
Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT
It adds a method to `DialogHelper` to ask a question and hide the response. It's pretty cool when working with passwords.
This code is more than largely inspired by Composer, see [ConsoleIO.php at line 140](https://github.com/composer/composer/blob/master/src/Composer/IO/ConsoleIO.php#L140)
You will notice that this PR embeds a Windows Executable binary for windows support. This windows binary is provided by @Seldaek (see https://github.com/Seldaek/hidden-input)
This dependency is not yet available via composer.
If this is a problem to embed this file, we can think of other way to provide this support (make a package from HiddenInput and add composer recommandation for example).
---------------------------------------------------------------------------
by stof at 2012-10-11T17:20:11Z
The link to the hiddeninput source code should be added in the readme.
And you should also update the changelog.
Btw, adding composer for hiddeninput does not make sense. Compsoer is about installing PHP code, not about downloading the source of a C++ program.
---------------------------------------------------------------------------
by romainneutron at 2012-10-11T17:22:58Z
This proposition comes from a discussion I had with Jordi , nothing more :)
Romain
On 11 oct. 2012, at 19:20, Christophe Coevoet <notifications@github.com>
wrote:
The link to the hiddeninput source code should be added in the readme.
And you should also update the changelog.
Btw, adding composer for hiddeninput does not make sense. Compsoer is about
installing PHP code, not about downloading the source of a C++ program.
—
Reply to this email directly or view it on
GitHub<https://github.com/symfony/symfony/pull/5731#issuecomment-9349736>.
---------------------------------------------------------------------------
by romainneutron at 2012-10-12T07:33:00Z
Changelog updated, Readme note added, CS fixed
---------------------------------------------------------------------------
by stof at 2012-10-13T22:09:24Z
the missing point is now the PR to the doc for this new feature
---------------------------------------------------------------------------
by romainneutron at 2012-10-16T00:33:59Z
@stof documentation added
---------------------------------------------------------------------------
by romainneutron at 2012-10-16T09:10:35Z
@fabpot what you asked is now fixed
This PR was squashed before being merged into the master branch (closes#5725).
Commits
-------
d6be69a [i5669][Console] Adding a note about the list command in the help command
Discussion
----------
[i5669][Console] Adding a note about the list command in the help command
In order to fix the issue #5669.
---------------------------------------------------------------------------
by gnugat at 2012-10-11T09:45:45Z
This PR is ready for a first code review.
---------------------------------------------------------------------------
by stof at 2012-10-13T22:25:15Z
@fabpot 👍
This PR was merged into the master branch.
Commits
-------
63b480e [Console] fixed#5316
Discussion
----------
[Console] [Enhancement] fixes#5316
Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #5316
---------------------------------------------------------------------------
by marfillaster at 2012-10-05T02:14:55Z
I simplified the change. And the reason why tests for text help do not need changes is because in CommandTest, the commands are executed first which also merges app definition before invoking asText or asXml . While in ApplicationTest, commands are never run therefore app definition is not being merged.
---------------------------------------------------------------------------
by stof at 2012-10-13T23:13:52Z
@fabpot This looks ready to me. Anything left ?
* 2.1:
fixed CS
added doc comments
added doc comments
[Validator] Updated swedish translation
Update src/Symfony/Component/Validator/Resources/translations/validators.de.xlf
[2.1] Exclude tests from zips via gitattributes
[HttpKernel][Translator] Fixed type-hints
Updated lithuanian validation translation
[DomCrawler] Allows using multiselect through Form::setValues().
[Translation] forced the catalogue to be regenerated when a resource is added (closes symfony/Translation#1)
Unit test for patched method OptionsResolver::validateOptionValues().
validateOptionValues throw a notice if an allowed value is set and the corresponding option isn't.
[Form] Hardened code of ViolationMapper against errors
[HttpFoundation] Fixed#5611 - Request::splitHttpAcceptHeader incorrect result order.
[Form] Fixed negative index access in PropertyPathBuilder
Update src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf
Conflicts:
src/Symfony/Component/DomCrawler/Form.php
src/Symfony/Component/Process/Process.php
This PR was squashed before being merged into the master branch (closes#5668).
Commits
-------
1117499 [2.2][Console] Test default input defintion and default helper set
Discussion
----------
[2.2][Console] Test default input defintion and default helper set
Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -
See: https://github.com/symfony/symfony/pull/5638
* 2.1:
[2.1] Fix SessionHandlerInterface autoloading
Remove executable bit from HttpKernel/DependencyInjection/ConfigurableExtension.php
[2.0][http-foundation] Fix Response::getDate method
[DoctrineBridge] Require class option for DoctrineType
[HttpFoundation] fixed the path to the SensioHandlerInterface class in composer.json
Support the new Microsoft URL Rewrite Module for IIS 7.0. @see http://framework.zend.com/issues/browse/ZF-4491 @see http://framework.zend.com/code/revision.php?repname=Zend+Framework&rev=24842
fixed undefined variable
hasColorSupport does not take an argument
Improve FilterResponseEvent docblocks Response ref
This PR was squashed before being merged into the master branch (closes#3501).
Commits
-------
4f3ded7 Actually this is worse
72a1c65 * Coding standards fixes * Changed `started` to `startTime` * Other fixes/edits
8249928 * Weeks/months/years is probably unrealistic * Set some sensible padding defaults * Use isset() instead of is_array()
37b62bf Fixing bug for elapsed time between 1 and 2 seconds
8fe4568 Special formatting for when there is no maximum set
75f532f Minor docblock updates
e436e1a Adding ProgressHelper for Console Component
Discussion
----------
[2.2][Console] Add ProgressHelper
[![Build Status](https://secure.travis-ci.org/leek/symfony.png?branch=feature/progress-helper)](http://travis-ci.org/leek/symfony)
Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: Yes
Fixes the following tickets: -
Todo:
- Add unit tests
- Add documentation
--
I find myself needing some sort of progress indicator in most of my Console applications.
If this is something that could possibly be apart of Symfony, that would be great.
**Example:**
![Progress Example](http://i.imgur.com/a0wGQ.gif)
---------------------------------------------------------------------------
by jmikola at 2012-03-05T03:08:24Z
Do you have an example of this being used within a console command?
I'd be curious what the performance overhead is. My earliest console commands (nearly 2 years ago) would print status during each iteration (for a database migration) and I found the impact noticeable. After some time, I revised it to only print each X iterations, which often matched up with the batch size inserts/updates.
But for the last year, I've been using [declare(ticks=X)](http://php.net/manual/en/control-structures.declare.php) and have been quite happy with the results. By tuning the tick interrupt, the performance overhead is very small. It's especially helpful when dealing with processing code that is difficult to interrupt with a manual call to update the progress display, as PHP takes care of invoking the tick handler for me. I've thought about making such a console component helper for it, but I think the implementation is too invasive to abstract into a helper.
Here's an example of it being used in OrnicarMessageBundle's [MongoDBMigrateMetadataCommand](https://github.com/ornicar/OrnicarMessageBundle/blob/master/Command/MongoDBMigrateMetadataCommand.php).
---------------------------------------------------------------------------
by leek at 2012-03-05T04:05:29Z
@jmikola: Here is a simple example:
```php
<?php
// ...
protected function execute(InputInterface $input, OutputInterface $output)
{
$progress = $this->getHelperSet()->get('progress');
$progress->start($output, 50);
$i = 0;
while ($i++ < 50) {
usleep(mt_rand(20000, 200000));
$progress->advance();
}
$progress->finish();
}
```
The performance overhead shouldn't be much more than a standard `$output->write()` call. When used with a loop doing 1000's of iterations, you can set the `redrawFreq` option to something more appropriate to control how often the progress indicator is redrawn to the console.
---------------------------------------------------------------------------
by leek at 2012-03-10T10:05:32Z
Added some minor updates along with an example GIF of 2 of the progress bars (see edited PR).
---------------------------------------------------------------------------
by jmikola at 2012-03-10T15:22:29Z
Why does `1 sec` flash over to `1 secs` before `2 secs` is rendered?
---------------------------------------------------------------------------
by henrikbjorn at 2012-03-10T15:26:08Z
👍
---------------------------------------------------------------------------
by leek at 2012-03-10T16:07:08Z
@jmikola: Thanks! I didn't even notice that. Fixed.
---------------------------------------------------------------------------
by drak at 2012-03-11T09:04:58Z
What an amazing PR. I feel like I just have to write some code that uses this feature just because it's there!
---------------------------------------------------------------------------
by henrikbjorn at 2012-03-11T09:55:50Z
This is needed a lot, we have a bunch of import scripts where this is useful.
@fabpot what are your thoughts on this?
---------------------------------------------------------------------------
by francoispluchino at 2012-03-14T12:34:38Z
👍
---------------------------------------------------------------------------
by vicb at 2012-03-14T13:00:42Z
could you please order the properties & methods by visibility according to the Sf2 CS.
---------------------------------------------------------------------------
by leek at 2012-03-14T19:08:52Z
No problem - I'll make the requested changes tonight.
---------------------------------------------------------------------------
by stof at 2012-04-03T22:48:45Z
@fabpot ping
---------------------------------------------------------------------------
by stloyd at 2012-04-14T09:46:31Z
@fabpot Any hope to get this in 2.1 ?
---------------------------------------------------------------------------
by mvriel at 2012-05-15T19:28:34Z
👍
Tried it out by manually including it in my project and works like a charm
---------------------------------------------------------------------------
by blaugueux at 2012-05-23T18:46:15Z
Up ! It will be great to have this feature in the next release.
@fabpot ping
---------------------------------------------------------------------------
by guilhermeblanco at 2012-05-28T22:58:35Z
@fabpot tried on my app and everything works fine.
Any plans to merge this one into 2.1?
---------------------------------------------------------------------------
by damonjones at 2012-05-29T02:31:39Z
+1
This would be a very nice feature to have in 2.1.
---------------------------------------------------------------------------
by fabpot at 2012-05-29T06:18:57Z
This is scheduled for 2.2.
---------------------------------------------------------------------------
by Burgov at 2012-08-16T13:04:34Z
I have a service which downloads a file using wget though the console component, and reads the progress from stderr. Rather than advancing in steps, i'd like to be able to set the current progress. Something like this method might be a nice addition:
```php
public function setCurrent($value, $redraw = false)
{
$this->advance($value - $this->current, $redraw);
}
```
* 2.1:
Added Base64 encoding, decoding to MongoDBProfilerStorage
Fix duplicated code and a field name
refactor src/Symfony/Component/Translation/Loader/MoFileLoader.php
fixed typo
Update src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf
fixed issue #5596 (Broken DOM with the profiler's toolbar set in position top)
[Form] Fixed the testsuite for PHPUnit 3.6 as travis still uses it
added dirs generated by build-data.php in locale component to .gitignore
[Process] Fixed bug introduced by 7bafc69f38.
[Process][Tests] Prove process fail (Add more test case)
[Process][Tests] Prove process fail
[HttpFoundation] Fixed the tests
[DomCrawler] Added test for supported encodings by mbstring
[Config] Fixed preserving keys in associative arrays
[Console] Fixed return value for Command::run
[Locale] Fixed tests
[Console] Fix some input tests
[Filesystem] Fixed tests on Windows
[Config] Fixed tests on Windows
Commits
-------
c869a65 [Console] Fixed return value for Command::run
Discussion
----------
[2.1][Console] Fixed return value for Command::run
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT
API says that Command::run returns integer. This is also necessary if I want to run nested commands.
* 2.1:
fixed stringification of array objects in RequestDataCollector (closes#5295)
[HttpFoundation] removed the username and password from generated URL as generated by the Request class (closes#5555)
[Console] fixed default argument display (closes#5563)
Fixing config normalisation example in docblock
Commits
-------
bb2566c [Console] Console colorization is also provided by ConEmu on Windows
Discussion
----------
[Console] Console colorization is also provided by ConEmu on Windows
Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT
See http://code.google.com/p/conemu-maximus5/wiki/AnsiEscapeCodes#Переменная_окружения
---------------------------------------------------------------------------
by fabpot at 2012-09-16T07:43:55Z
Can you add a note about it in the changelog of the component? thanks
Commits
-------
c2207da [Console] Removed unused phpunit annotation.
c0c61da [Console] Added current style appliance for all styled text.
696a653 [Console] Removed text transformation for empty styles.
c7e324a [Console] Added test for non style tag formatting.
Discussion
----------
[Console] Non style tags dont disturb formatting anymore
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes issue #5196.
---------------------------------------------------------------------------
by travisbot at 2012-08-06T19:35:20Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/2050455) (merged c0c61da0 into 842b599c).
---------------------------------------------------------------------------
by travisbot at 2012-08-07T07:47:31Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/2055153) (merged c2207da6 into 842b599c).
Commits
-------
5f328de [console] Fixed docblock.
c80e156 [console] Added style stack getter in formatter.
0ae5a45 [console] Removed hardcoded empty style from styles stack.
Discussion
----------
[console] Removed hardcoded style formatter from style stack.
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
This PR make it possible to replace OutputFormatter again.
Fixes issue #4495.
---------------------------------------------------------------------------
by travisbot at 2012-06-06T15:29:44Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1531654) (merged c80e156f into 1541fe26).
---------------------------------------------------------------------------
by travisbot at 2012-06-06T15:29:53Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1533586) (merged 5f328dee into 1541fe26).
Commits
-------
2c19b3c Empty shortcut check in the constructor
cf9039e Added a unit test for the shortcut name of the InputOption class
Discussion
----------
[Console] Single dash for option shortcuts
See https://github.com/symfony/symfony/pull/4062
---------------------------------------------------------------------------
by travisbot at 2012-05-20T13:09:18Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1380389) (merged 02290da4 into f433f6b0).
---------------------------------------------------------------------------
by stof at 2012-05-20T13:16:34Z
please rebase your branch to get rid of these merge commits
btw, you should use feature branches to send your next pull requests instead of using your master branch each time, which limits you to a single PR.
---------------------------------------------------------------------------
by Nanocom at 2012-05-20T13:39:32Z
Sorry for the mess, cleaning it
---------------------------------------------------------------------------
by travisbot at 2012-05-20T13:41:46Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1380549) (merged 63129657 into f433f6b0).
---------------------------------------------------------------------------
by travisbot at 2012-05-20T13:43:07Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1380553) (merged 2c19b3c7 into f433f6b0).
Commits
-------
c195957 [Components] Tests/Autoloading fixes
Discussion
----------
Fix components
See #4141
----
This PR:
* configures each component to use composer to manage "dev" dependencies instead of env variables;
* adds phpunit configuration file on Filesystem component;
* fixes READMEs.
It's mergeable without any problems, but I would recommend to wait a fix in Composer in order to use `self.version` in `require`/`require-dev` sections.
Note: I kept `suggest` sections because it makes sense but this PR doesn't aim to provide useful explanations for each entry. It could be another PR, not that one.
---------------------------------------------------------------------------
by willdurand at 2012-04-30T20:43:13Z
@fabpot I reviewed each component, one by one. Now `phpunit` always works, even if tests are skipped. A simple `composer install --dev` allows to run the complete test suite. Each commit is well separated from the others. I guess, everything is ok now.
---------------------------------------------------------------------------
by Tobion at 2012-04-30T20:47:00Z
Please squash, as it makes no sense to have the same commit for each component.
---------------------------------------------------------------------------
by fabpot at 2012-05-01T14:26:11Z
Can you squash your commits before I merge? Thanks.
---------------------------------------------------------------------------
by willdurand at 2012-05-01T14:29:38Z
done
---------------------------------------------------------------------------
by fabpot at 2012-05-01T15:48:25Z
It does not seem that the commits are squashed.
---------------------------------------------------------------------------
by willdurand at 2012-05-01T15:54:08Z
done
* Switched to Composer to manage "dev" dependencies
* Fixed READMEs
* Excluded vendor in phpunit.xml.dist files
* Fixed message in bootstrap.php files
* Added autoloader for the component itself
Addresses issues with writing console output for IBM i5 Series (OS400).
The normal QP2TERM shell outputs garbage text when attempting to write
directly to STDOUT, likely because of EBCDIC character-encoding used
on IBM platforms. Writing to the OUTPUT mimics using 'echo' or 'print'
and prints properly in the console.
Fixes#1434
Commits
-------
2a90871 [Console] Removed previously introduced BC break.
90a2a6e [Console] Undecorated formatter must update style stack too.
bd7e01a [Console] Fixed output formatter test broken by new implementation.
a1add4b [Console] Updated output formatter to use style stack.
4f298dd [Console] Added formatter style stack.
93ffe54 [Console] Added getters to output formatter style (and its interface).
48e6b49 [Console] Updated formatter test to match styles bug fix.
ad334b6 [Console] Fixed empty style appliance.
31d5fe5 [Console] Fixed output formatter docblock.
Discussion
----------
[Console] Fixes formatter nested style appliance.
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
When outputing styled text in the console, you sometimes face to a confusing behavior: style tags cannot be nested. If tou try something like `<fg=blue>Hello <fg=red>world</fg=red>!</fg=blue>`, the trailing `!` will not be styled.
This PR introduce a new FormatterOutputStyleStack to keep open/closed styles informations up-to-date. It slightly changes OutputFormatter implementation which no longer uses `OutputFormatterStyle::apply()` method, but the new `OutputFormatterStyle::getTerminalSequence()`.
**Question:** I don't une `OutputFormatterStyleInterface` but `OutputFormatterStyle` to type `OutputFormatterStyleStack` methods arguments (to avoid BC break on the interface). Do you think it's right?
**Notice:** I also needed to fix some tests broken by new implementation.
---------------------------------------------------------------------------
by stof at 2012-03-16T10:27:56Z
Adding new methods in an interface is a BC break for people implementing it
---------------------------------------------------------------------------
by jfsimon at 2012-03-16T10:33:21Z
@stof indeed... this is a problem, should I remove them? If I do so, I should use `OutputFormatterStyle` instead of the interface to type arguments in `OutputFormatterStyleStack` right?
Bug fix: no
BC break: no
Feature addition: yes
Symfony2 test pass: yes
Fixes the following tickets: #2848#2847
Todo: -
See tickets for reference, need help with testing, because I don't know how to test this :)
Commits
-------
c7ab9ba [Console] Allow redefinition of application options descriptions
Discussion
----------
[Console] Allow redefinition of application options descriptions
Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
This allows you to redefine an `InputOption` as long as it keeps the same semantic (same default, same name, same alias, same modes). There are two purposes:
- Modifying the description with a more accurate one
- Making sure the option appears in your commands' help
Concrete example: I often want to provide a verbose version of commands. It's an elegant and very common pattern, but I basically can't document what is going to happen if you do `--verbose` since the base Application already defines `--verbose`. Also the `--verbose` option does not appear when you do `console <command> --help`, which means people probably won't think of using that option.
Commits
-------
e417153 [BugFix][Console] Fix type hint for output formatter
Discussion
----------
[BugFix][Console] Fix type hint for OutputFormatter in OutputStream constructors
I consider this as a bug, cause it disables ability to change formatter implementation
BugFix: yes
Feature addition: no
Sysmfony2 test pass: yes
---------------------------------------------------------------------------
by fabpot at 2011/12/18 00:23:05 -0800
It's not a bug fix as existing code that extend these classes will now fail.
---------------------------------------------------------------------------
by stof at 2011/12/18 03:51:38 -0800
@fabpot does the constructor enforces its signature for child classes ? I don't think so.
Commits
-------
2181f6c Fixed space
5f98b73 Raw output of commands in app/console list
Discussion
----------
Raw output of commands in app/console list
Breaks compatibility: no
Feature addition: yes
Symfony test pass: yes, with appropriate modifications
Simply, it adds ```--raw``` parameter to ```app/console list``` command. With this key, ```list``` returns simply command names.
This is mainly useful in command completion / embedding, like https://github.com/andrewtch/oh-my-zsh/tree/symfony2-completion/plugins/symfony2 ; I know about the presence of --xml, but in some environments (like shell scripts) parsing XML could be a problem.
This is an unobtrusive feature addition that is not likely to add problems in future.
---------------------------------------------------------------------------
by andrewtch at 2011/12/18 04:09:58 -0800
fixed
Commits
-------
1e370d7 typo fix
93d8d44 added some more infos about Config
27efd59 added READMEs for the bridges
34fc866 cosmetic tweaks
d6af3f1 fixed README for Console
6a72b8c added basic README files for all components
Discussion
----------
added basic README files for all components and bridges
heavily based on http://fabien.potencier.org/article/49/what-is-symfony2 and the official Symfony2 documentation
---------------------------------------------------------------------------
by jmikola at 2011/11/03 13:36:07 -0700
Great work. For syntax highlighting on the PHP snippets, you could add "php" after the three backticks.
---------------------------------------------------------------------------
by lsmith77 at 2011/11/03 13:41:29 -0700
done
---------------------------------------------------------------------------
by stealth35 at 2011/11/03 13:49:31 -0700
Nice job, but you also need to add `<?php`
ex :
``` php
<?php
use Symfony\Component\DomCrawler\Crawler;
$crawler = new Crawler();
$crawler->addContent('<html><body><p>Hello World!</p></body></html>');
print $crawler->filter('body > p')->text();
```
---------------------------------------------------------------------------
by lsmith77 at 2011/11/03 13:56:57 -0700
done
---------------------------------------------------------------------------
by ericclemmons at 2011/11/03 19:57:57 -0700
@lsmith77 Well done! This makes consumption of individual components that much easier, *especially* now that `composer.json` files have been added.
---------------------------------------------------------------------------
by lsmith77 at 2011/11/04 01:18:23 -0700
ok .. fixed the issues you mentioned @fabpot
---------------------------------------------------------------------------
by lsmith77 at 2011/11/11 15:00:27 -0800
@fabpot anything else left? seems like an easy merge .. and imho there is considerable benefit for our efforts to spread the word about the components with this PR merged.
---------------------------------------------------------------------------
by drak at 2011/11/11 18:54:13 -0800
You know, it might be a nice idea to put a link to the documentation for each component if there is some at symfony.com
---------------------------------------------------------------------------
by lsmith77 at 2011/11/12 00:59:14 -0800
i did that in some. but i might have missed a few places.
On 12.11.2011, at 03:54, Drak <reply@reply.github.com> wrote:
> You know, it might be a nice idea to put a link to the documentation for each component if there is some at symfony.com
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/2561#issuecomment-2715762
---------------------------------------------------------------------------
by breerly at 2011/11/21 10:28:36 -0800
Pretty excited with this.
---------------------------------------------------------------------------
by dbu at 2011/11/24 00:02:50 -0800
is there anything we can help with to make this ready to be merged?
---------------------------------------------------------------------------
by lsmith77 at 2011/12/18 02:39:23 -0800
@fabpot: seriously .. if you are not going to deliver something "better" and don't provide a reason what is wrong with this .. then its beyond frustrating. i obviously do not claim that these README's are perfect (and certainly still no replacement for proper documentation), but I do claim that in their current form they are a radical step forward to potential users of the Symfony2 components.
Bug fix: no
Feature addition: yes
BC break: no
Symfony2 test pass: yes, but some tests had to be modified
Now all error messages goes to stdout, we cannot separate error
from normal behaviour, this enables writing to stderr stream,
so scripts ran e.g. from cron, can benefit from this well known concept.
There are 2 much nicer implememntations, but:
1) First requires to break the `@api` tagged interfaces.
2) Second requires rewrite of `execute` command declatarion all commands in bundles.
* 2.0:
[FrameworkBundle] Added functional tests.
[Form] Added missing use statements (closes#2880)
[Console] Improve input definition output for Boolean defaults
[SecurityBundle] Changed environment to something unique.
2879: missing space between catch and the brace
#2688: Entities are generated in wrong folder (doctrine:generate:entities Namespace)
[TwigBundle] Fix the exception message escaping
Previously, Boolean defaults were printed as strings, which lead to true and false being printed as "1" and "", respectively. With this change, they are now printed as "true" and "false".
Commits
-------
060d75d [Console] fixed CS and simplified code
a5ff635 [Console] added support for interactive shell without readline extension
Discussion
----------
[2.1] [Console] added support for interactive shell without readline extension
---------------------------------------------------------------------------
by lmcd at 2011/06/30 15:12:56 -0700
Very useful! Pre-installed PHP on OS X ships without readline.
---------------------------------------------------------------------------
by stof at 2011/06/30 15:24:47 -0700
@lmcd You can already use the console, just not the shell.
---------------------------------------------------------------------------
by lmcd at 2011/06/30 15:27:00 -0700
@stof Yep I know, but it would be nice to use the shell :)
---------------------------------------------------------------------------
by hason at 2011/07/01 01:54:34 -0700
@stof Interactive generators will not work on Windows and Mac OS X without these simple changes. I think this is bad news.
---------------------------------------------------------------------------
by Seldaek at 2011/07/01 01:58:59 -0700
Yup, it's definitely a good addition.
---------------------------------------------------------------------------
by Seldaek at 2011/07/01 01:59:26 -0700
@fabpot: I'm not sure why this is tagged 2.1, but IMO this should go in now.
---------------------------------------------------------------------------
by stof at 2011/07/01 01:59:44 -0700
@hason This is not true. The shell is only used when running the console with the ``-s`` option. A command can be interactive without using the shell (I'm on Windows)
---------------------------------------------------------------------------
by lmcd at 2011/07/01 02:08:17 -0700
@stof Yea true, the interactive generators are fine without readline, however I don't think this dependancy should prevent people using the shell on Win/Mac.
---------------------------------------------------------------------------
by hason at 2011/07/01 02:28:10 -0700
@stof This is good news :) I was hasty.
---------------------------------------------------------------------------
by lmcd at 2011/07/04 02:03:36 -0700
I'm feeling inclined to remove readline entirely for 2.1 and roll our own solution to support things like this in the shell: http://lmcd.me/v/sf-autocomplete-2.mov
---------------------------------------------------------------------------
by stof at 2011/09/04 04:55:37 -0700
what is the status of this PR ?
Commits
-------
d675c28 [FrameworkBundle] Use Router instead of RouterInterface
ae7ae8d [FrameworkBundle] Moved router_listener from web to router.xml since it depends on the router
35a9023 [FrameworkBundle] Added isEnabled to Router commands, fixes#1467536d979 [Console] Added Command::isEnabled method that defines whether to add the command or not
Discussion
----------
[2.1] [Console] Added Command::isEnabled method
This addresses #1467.
The idea is to allow commands to evaluate whether they can run or not, since they are automatically registered.
- It's useful for the two router:* commands since they're optional (router can be disabled), but part of the FrameworkBundle that is not really optional.
- It could be useful for third party code as well.
- It's BC.
- aa95bb0d395810b29a3e654673e130736d9d1080 should address the issue in #1467, while the other commits just make sure the command is not registered at all if the router isn't standard.
One issue remains though:
- A few other services like twig helpers get the `ròuter` injected, this means that if there is really **no** router service defined, there is still an error. I'm not sure how to fix those beyond adding `on-invalid="null"` but I'm not sure if that's desirable. I guess we could argue that the router is a big candidate for replacement/suppression, and as such it should be truly optional, but if we do it I don't know where it'll lead. I don't want to end up in a situation where half the dependencies are optional to support every possible combination. @fabpot wdyt?
---------------------------------------------------------------------------
by kriswallsmith at 2011/06/28 16:19:46 -0700
I'd rather see us not register a command instead of register and then disable it. Can we do the same thing you've done here in the bundle's registerCommands() method?
---------------------------------------------------------------------------
by Seldaek at 2011/06/28 16:51:36 -0700
Note that it's never really registered. During the registration it's checked and skipped if not enabled.
However, doing it as you suggest means overriding/copy-pasting all the code from the core Bundle class, which I don't like so much. It also means adding code specific to those two commands in a somewhat unrelated place, which I also don't like.
I'm not saying the current solution is perfect, but from the alternatives I considered, it's the best I have found.
---------------------------------------------------------------------------
by stof at 2011/09/04 04:58:04 -0700
@Seldaek your branch conflicts with master. could you rebase it ?
@fabpot what do you think about this PR ?
---------------------------------------------------------------------------
by Seldaek at 2011/09/04 08:39:05 -0700
Rebased
* 2.0:
[HttpKernel] fixed typo
fixed previous merge, done the same change to other occurences
fixes usage of mb_*
Profiler session import fixed.
[Process] workaround a faulty implementation of is_executable on Windows
Swedish translation fix.
[Locale] Fix#2179 StubIntlDateFormatter support yy format
Fixed fourth argument of Filesystem->mirror()
Check that $mode in InputArgument::__construct() is not below 1 to actually look if any of the flags are set.
Check that $mode in InputOption::__construct() is not below 1 to actually look if any of the flags are set.
Check for the correct parameter type, as in InputOption (integer).
InputArgumentTest: Added test for negative integer $mode parameter input in constructor.
InputOptionTest: Added test for negative integer $mode parameter input in constructor.
Problem with fgets is that false means two things: an error or the end of the stream.
That's ok for STDIN, but it becomes a problem when using another stream (in a unit test for instance).
* The command names have now full support for nested namespaces. It means
that abbreviations work for each sub-namespace:
./app/console doctrine:mapping:info
# worked before
./app/console doctrine:map:in
# works now
./app/console doc:map:in
* Aliases are now first class citizen. They can have their own namespace,
like the main name. So, now, there is no difference between an alias and a
name.
* As names and aliases can be namespaced, the Command::getFullName() and
Command::getNamespace() method have been removed.
The current code was broken when a style was defined inline:
<bg=black>Foo</bg=black>
When creatin a new style formatter, it's better to let the formatter
apply the style to the text.
* everzet/console-privatisation-errors:
if we moved definition under private area, than we need to use only public API for that, to be able to redefine it is subclasses
start => finish, begin => end. Mixing them is a bad choice.
ability to define custom regex's for style placeholders
we need ability to get style parameters same way we set them with setStyle
sometimes, developers like me want to redefine style placeholders
in their applications. From this patch, they can acchieve this from
simple get...Regex() method redefine.
from last privatisation update $styles now private. So,
user can set style with public setter (setStyle), but can't
get this value later, which is very stupid behavior!
To keep language consistent, three methods were changed in InputOption:
* `InputOption::acceptParameter()` -> `InputOption::acceptValue()`
* `InputOption::isParameterRequired()` -> InputOption::isValueRequired()`
* `InputOption::isParameterOptional()` -> `InputOption::isValueOptional()`
The InputDefinition::asXml() method was also modified to update the `accept_value` and `is_value_required` attributes.
When an object has a "main" many relation with related "things" (objects,
parameters, ...), the method names are normalized:
* get()
* set()
* all()
* replace()
* remove()
* clear()
* isEmpty()
* add()
* register()
* count()
* keys()
The classes below follow this method naming convention:
* BrowserKit\CookieJar -> Cookie
* BrowserKit\History -> Request
* Console\Application -> Command
* Console\Application\Helper\HelperSet -> HelperInterface
* DependencyInjection\Container -> services
* DependencyInjection\ContainerBuilder -> services
* DependencyInjection\ParameterBag\ParameterBag -> parameters
* DependencyInjection\ParameterBag\FrozenParameterBag -> parameters
* DomCrawler\Form -> FormField
* EventDispatcher\Event -> parameters
* Form\FieldGroup -> Field
* HttpFoundation\HeaderBag -> headers
* HttpFoundation\ParameterBag -> parameters
* HttpFoundation\Session -> attributes
* HttpKernel\Profiler\Profiler -> DataCollectorInterface
* Routing\RouteCollection -> Route
* Security\Authentication\AuthenticationProviderManager -> AuthenticationProviderInterface
* Templating\Engine -> HelperInterface
* Translation\MessageCatalogue -> messages
The usage of these methods are only allowed when it is clear that there is a
main relation:
* a CookieJar has many Cookies;
* a Container has many services and many parameters (as services is the main
relation, we use the naming convention for this relation);
* a Console Input has many arguments and many options. There is no "main"
relation, and so the naming convention does not apply.
For many relations where the convention does not apply, the following methods
must be used instead (where XXX is the name of the related thing):
* get() -> getXXX()
* set() -> setXXX()
* all() -> getXXXs()
* replace() -> setXXXs()
* remove() -> removeXXX()
* clear() -> clearXXX()
* isEmpty() -> isEmptyXXX()
* add() -> addXXX()
* register() -> registerXXX()
* count() -> countXXX()
* keys()