Commit Graph

128 Commits

Author SHA1 Message Date
Jean-François Simon
51512e633b [Console] application/command as text/xml/whatever decoupling 2013-04-23 18:54:00 +02:00
Fabien Potencier
d9fa16087b merged branch quiqueporta/multiselect (PR #7602)
This PR was squashed before being merged into the master branch (closes #7602).

Discussion
----------

[DialogHelper] Multiselect : added an option to the "select" function that makes the possibility of multiselect options.

When the option list appears, you can select more than one value separated by comma.

 Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

c8a5e02 [DialogHelper] Multiselect : added an option to the "select" function that makes the possibility of multiselect options.
2013-04-21 09:51:24 +02:00
Quique Porta
c8a5e021dc [DialogHelper] Multiselect : added an option to the "select" function that makes the possibility of multiselect options. 2013-04-21 09:51:23 +02:00
Pascal Borreli
173f15c200 Fixed typo 2013-04-21 04:09:58 +00:00
Fabien Potencier
1b2619078d Merge branch '2.2'
* 2.2:
  Fix default value handling for multi-value options
  [HttpKernel] truncate profiler token to 6 chars (see #7665)
  Disabled APC on Travis for PHP 5.5+ as it is not available
  [HttpFoundation] do not use server variable PATH_INFO because it is already decoded and thus symfony is fragile to double encoding of the path
  Fix download over SSL using IE < 8 and binary file response
  [Console] Fix merging of application definition, fixes #7068, replaces #7158
  [HttpKernel] fixed the Kernel when the ClassLoader component is not available (closes #7406)
  fixed output of bag values
  [Yaml] improved boolean naming ($notEOF -> !$EOF)
  [Yaml] fixed handling an empty value
  [Routing][XML Loader] Add a possibility to set a default value to null
  [Console] fixed handling of "0" input on ask
  The /e modifier for preg_replace() is deprecated in PHP 5.5; replace with preg_replace_callback()
  fixed handling of "0" input on ask
  [HttpFoundation] Fixed bug in key searching for NamespacedAttributeBag
  [Form] DateTimeToRfc3339Transformer use proper transformation exteption in reverse transformation
  Update PhpEngine.php
  [PropertyAccess] Add objectives to pluralMap
  [Security] Removed unused var
  [HttpFoundation] getClientIp is fixed.

Conflicts:
	src/Symfony/Component/Console/Tests/Command/CommandTest.php
	src/Symfony/Component/Console/Tests/Input/ArgvInputTest.php
	src/Symfony/Component/HttpFoundation/Request.php
	src/Symfony/Component/HttpKernel/Kernel.php
2013-04-17 07:31:37 +02:00
Rénald Casagraude
383a84b807 fixed handling of "0" input on ask 2013-04-11 07:30:49 +02:00
Fabien Potencier
22adfdf504 merged branch umpirsky/console-helper-table (PR #6368)
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
2013-04-07 16:24:42 +02:00
umpirsky
8de7813cab [2.3] [Console] TableHelper 2013-04-07 16:24:41 +02:00
Dariusz Górecki
7c47e34928 [CS Fix] Consistent coding-style of concatenation operator usage 2013-04-02 10:39:57 +01:00
Fabien Potencier
9fba645cb2 [Console] added a note in the CHANGELOG for the previous merge, fixed some CS 2013-03-23 08:15:46 +01:00
Fabien Potencier
062cce0018 merged branch pkruithof/progress-helper-enhancements (PR #7300)
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
2013-03-23 08:10:00 +01:00
Peter Kruithof
5ae76f0dbf [Console] Progress helper enhancements 2013-03-23 08:10:00 +01:00
Kevin Herrera
633c051409 Fixed invalid file path for hiddeninput.exe on Windows. 2013-03-19 13:48:08 -07:00
Lee McDermott
4d7c895021 Fix bug where backspacing to an empty string and using the arrow keys would fail. Added test to prevent in future 2013-01-08 13:05:24 +01:00
Lee McDermott
cd1def3693 Fix bad unit test with undefined offset (spotted by @stloyd) 2013-01-08 12:58:44 +01:00
Joseph Bielawski
e6574deb40 [Console] Fix stty reset when using DialogHelper#ask() with autocomplete functionality 2013-01-08 12:53:29 +01:00
Lee McDermott
9d94fc7a49 [Console] Autocomplete cleanups/optimisations 2013-01-07 12:16:36 +01:00
Lee McDermott
2b73975023 Add new tests and fix problem with the second option being chosen on down arrow 2013-01-06 04:05:03 +00:00
Lee McDermott
8a0bcfbed2 Use strpos in place of substr 2013-01-06 02:24:44 +00:00
Lee McDermott
9864d9572d Not much use in blanking the array each time 2013-01-06 02:21:42 +00:00
Lee McDermott
a4d711cb2a Enable arrow keys to browse matched autocomplete options 2013-01-05 06:34:01 +00:00
Fabien Potencier
7863f8890f merged branch lmcd/autocomplete (PR #6391)
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
2013-01-03 23:03:04 +01:00
Lee McDermott
7bad0ef691 [Console] Add autocomplete as you type 2013-01-03 23:03:04 +01:00
Florin Patan
c2acc6c2cb Fixed most of the docblocks/unused namespaces 2012-12-19 08:09:49 +01:00
Fabien Potencier
008dc8f1ce [Console] tweaked the select() method in the dialog helper to be more consistent with other method in the same class 2012-12-14 10:43:16 +01:00
Serge Smertin
692b0f41ae [Console] added select() method for DialogHelper 2012-12-14 08:36:07 +01:00
Fabien Potencier
7200703089 fixed CS 2012-12-11 15:06:57 +01:00
Fabien Potencier
8bbc64d3ec merged branch robqu/patch-progressbar (PR #6266)
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
2012-12-11 15:05:51 +01:00
Robert Queck
ea74610723 jumping progress bar fix for windows & unix 2012-12-11 14:31:22 +01:00
Pascal Borreli
a7ce6be3f8 Fixed typos 2012-10-28 23:25:34 +00:00
Jordi Boggiano
94f3ba5236 [Console] Read input in raw mode to avoid processing escape sequences 2012-10-21 17:09:07 +02:00
Thomas Adam
6a0ee27de1 [Console] fixed progress bar jumping 2012-10-17 09:31:31 +02:00
Fabien Potencier
d8f6021fc1 merged branch romainneutron/ConsoleHiddenQuestion (PR #5731)
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
2012-10-16 11:19:25 +02:00
Romain Neutron
aefa49595b Move hiddeninput.exe to Resources/bin 2012-10-16 11:08:11 +02:00
Romain Neutron
c0f8a63e61 Fix CS and typos 2012-10-16 11:04:58 +02:00
Pascal Borreli
61be89ddda [Console] [ProgressHelper] better percentage precision 2012-10-12 23:09:38 +00:00
Romain Neutron
ac01d5d752 Fix tests and CS 2012-10-12 09:30:41 +02:00
Romain Neutron
e396edbdc8 [Console] Add DialogHelper::askHiddenResponse method 2012-10-12 09:27:21 +02:00
Arnaud Kleinpeter
bf9d2be77d [Console] Fixes in ProgressHelper 2012-10-08 17:17:46 +02:00
Fabien Potencier
bf1ab93130 [Console] fixed typo 2012-09-30 16:27:49 +02:00
Fabien Potencier
7b3297621a [Console] added some basic tests for the ProgressHelper class 2012-09-30 00:37:08 +02:00
Fabien Potencier
729e3bfcaf [Console] converted options to proper setters in ProgressHelper 2012-09-29 22:11:59 +02:00
Fabien Potencier
2598323632 merged branch leek/feature/progress-helper (PR #3501)
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);
    }
```
2012-09-29 21:39:42 +02:00
leek
4b89aae98c [2.2][Console] Add ProgressHelper 2012-09-29 21:39:40 +02:00
Fabien Potencier
6782c78b95 merged branch jfsimon/issue-4752 (PR #4832)
Commits
-------

50cf928 [Console] Removed pointless constant.
14bd5ba [Console] 'formatBlock' helper now escape messages.
aaf4950 [Console] Implemented '<' escaping.
8cf82b7 [Console] Added '<' escaping tests.

Discussion
----------

Issue 4752

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #4752

This PR adds possibility to escape `<` chars with `\` to avoid formatting mess.
In addition, `FormatterHelper::formatBlock()` method auto-escapes messages.
2012-07-10 15:25:29 +02:00
jfsimon
14bd5ba37c [Console] 'formatBlock' helper now escape messages. 2012-07-10 12:00:17 +02:00
Fabien Potencier
d100ffaf76 fixed CS 2012-07-09 14:54:20 +02:00
Fabien Potencier
ec36ae7eda merged 2.0 2012-05-18 19:04:58 +02:00
Fabien Potencier
90c26a48cd [Console] fixed some CS 2012-05-16 09:33:59 +02:00
Fabien Potencier
41621e42e9 fixed phpdoc @param alignment 2012-05-15 22:19:31 +02:00
Fabien Potencier
ce9791246b fixed phpdoc @param alignment 2012-05-15 18:56:32 +02:00
Fabien Potencier
cab70f4083 merged 2.0 2011-12-28 20:44:29 +01:00
Javier Eguíluz
855b8af776 [Console][Helper] Added missing PHPDoc and fixed some minor typos and grammatical errors 2011-12-28 10:33:49 +01:00
lenar
0f7bf4155c [Console] Detect if interactive mode is possible at all 2011-09-29 11:37:25 +03:00
Fabien Potencier
e0502b1d69 fixed previous merge, done the same change to other occurences 2011-09-16 14:38:31 +02:00
Michel Salib
1087792f7e -- fix use of STDIN 2011-08-01 02:02:37 +02:00
lenar
07298ac699 Detect EOF when reading input stream
[Console] Change back to fgets() in DialogHelper
2011-07-27 10:47:43 +03:00
Fabien Potencier
6a7359389d removed usage of \Exception as PHPUnit won't allow to catch them anymore in the next major version 2011-07-11 11:54:00 +02:00
Fabien Potencier
59870bfe02 fixed typo 2011-07-07 09:42:47 +02:00
Fabien Potencier
3a5d508766 [Console] replaced fgets by stream_get_line in DialogHelper
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).
2011-07-07 09:41:45 +02:00
Lenar Lõhmus
511a9a1fd7 Edited src/Symfony/Component/Console/Helper/DialogHelper.php via GitHub 2011-07-05 00:19:44 -07:00
Fabien Potencier
5744b520f7 [Console] added unit tests for DialogHelper 2011-06-20 19:05:56 +02:00
Brikou CARRE
597a646347 added mb_detect_encoding when formatting block (usefull when mb_internal_encoding is not properly set) 2011-06-02 13:20:51 +02:00
Pascal Borreli
824e48efa7 [Various] Fixed phpdoc 2011-05-29 23:33:36 +00:00
Fabien Potencier
5ad2ff0595 [Console] added the possibility to pass a default value for DialodHelper::askAndValidate() 2011-05-20 08:24:54 +02:00
Fabien Potencier
b6a8f3a267 [Console] fixed typo 2011-05-17 10:27:02 +02:00
Fabien Potencier
6308f93c64 [Console] added some explanation on how DialogHelper::askAndValidate works 2011-05-17 10:26:33 +02:00
Victor Berchet
f83e92bf44 Make casting scalar to array consistent 2011-04-26 12:16:35 +02:00
Pascal Borreli
8c0beea677 [Phpdoc] Cleaning/fixing 2011-04-23 15:18:47 +00:00
Fabien Potencier
9206af1773 [Console] tagged the guaranteed BC API 2011-03-24 09:39:53 +01:00
Fabien Potencier
49e3494560 [Console] fixed typo 2011-03-14 12:56:59 +01:00
Fabien Potencier
b940cc6f40 moved most protected to private in the Console component 2011-03-11 12:53:42 +01:00
Fabien Potencier
8c423edfef replaced symfony-project.org by symfony.com 2011-03-06 12:40:06 +01:00
Pascal Borreli
46d28ce1b1 [Console] Removed useless else 2011-02-27 18:36:37 +01:00
Tim Nagel
f3b6e1a30c PHPDoc for Console 2011-02-07 01:54:10 +01:00
Dominique Bongiraud
64fb94c725 normalized license messages in PHP files 2011-01-18 08:07:46 +01:00
Kris Wallsmith
f79e23ffb5 Removed all those spaces after @author that were bothering me so… 2010-10-18 16:55:41 +02:00
Fabien Potencier
bf82cf42dd renamed Symfony\Components to Symfony\Component 2010-08-20 23:09:55 +02:00