Commit Graph

2652 Commits

Author SHA1 Message Date
Jordi Boggiano
7ce22f0cef [Console] Add docblocks 2012-04-06 18:25:51 +02:00
Fabien Potencier
85535de74b moved a fixture file 2012-04-06 14:27:17 +02:00
Fabien Potencier
b9daae2847 merged 2.0 2012-04-06 14:21:18 +02:00
Jordi Boggiano
595cc11251 [Console] Wrap exception messages to the terminal width to avoid ugly output 2012-04-06 13:54:54 +02:00
Jordi Boggiano
97f7b29783 [Console] Avoid outputing \r's in exception messages 2012-04-06 13:51:32 +02:00
Fabien Potencier
479d808e6e Revert "merged branch jfsimon/master (PR #3613)"
This reverts commit 959158f9b9, reversing
changes made to b9de0be349.
2012-04-04 08:53:58 +02:00
Fabien Potencier
959158f9b9 merged branch jfsimon/master (PR #3613)
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?
2012-04-03 12:02:29 +02:00
Victor Berchet
234ce4df9e [PhpUnit] Fix the path to the boostrap files in the components 2012-03-30 13:49:28 +02:00
Oscar Cubo Medina
aac6ad8018 [Console] avoid warning parsing empty string argument 2012-03-29 21:02:51 +02:00
Fabien Potencier
fea6b79acd moved component and bridge unit tests to the src/ directory
This is the first step to make each Symfony Component and Bridge self-contained.
2012-03-29 08:37:22 +02:00
Tobias Schultze
11585c3b67 fix Command:asXml to use processed help 2012-03-21 05:32:51 +01:00
Tobias Schultze
304e13daa3 replaced command names with supported placeholders in help texts 2012-03-21 05:31:52 +01:00
Jeremy Mikola
4d4ef24c47 [Console] Stop parsing options after encountering "--" token
This enables support for arguments with leading dashes (e.g. "-1"), as supported by getopt in other languages.
2012-03-16 15:53:13 -04:00
Jean-François Simon
2a908711cd [Console] Removed previously introduced BC break. 2012-03-16 14:00:53 +01:00
Jean-François Simon
90a2a6e556 [Console] Undecorated formatter must update style stack too. 2012-03-16 10:22:20 +01:00
Jean-François Simon
a1add4b8d5 [Console] Updated output formatter to use style stack. 2012-03-16 09:44:39 +01:00
Jean-François Simon
4f298dd7c7 [Console] Added formatter style stack. 2012-03-16 09:39:23 +01:00
Jean-François Simon
93ffe54886 [Console] Added getters to output formatter style (and its interface). 2012-03-16 09:09:42 +01:00
Jean-François Simon
ad334b68a3 [Console] Fixed empty style appliance. 2012-03-16 07:29:46 +01:00
Jean-François Simon
31d5fe58fe [Console] Fixed output formatter docblock. 2012-03-16 07:27:13 +01:00
Fabien Potencier
7a54fe41ca merged 2.0 2012-03-15 15:47:03 +01:00
Andreas Hucks
705e46018e provided unmerged definition for correct help generation 2012-03-12 01:11:44 +01:00
Andreas Hucks
45bbb5be01 added getNativeDefinition() to allow specifying an alternate InputDefinition for help generation 2012-03-12 01:10:54 +01:00
Fabien Potencier
70532ca4a7 merged 2.0 2012-03-08 19:29:37 +01:00
Fabien Potencier
3f948fb484 [Console] added some missing method in InputInterface (closes #3098) 2012-03-02 23:21:35 +01:00
Fabien Potencier
8fe6ee3d62 [Console] fixed help command when used from the shell (closes #3480) 2012-03-02 23:14:57 +01:00
Jordi Boggiano
bafcaafbe6 Removed version field 2012-02-27 09:59:20 +01:00
Jordi Boggiano
f9d9dc7ce9 Add branch-alias for composer 2012-02-25 03:26:20 +01:00
Fabien Potencier
f373085928 merged 2.0 2012-02-22 18:59:56 +01:00
marc.weistroff
89868f7901 Updated LICENSE files copyright 2012-02-22 10:10:37 +01:00
Adrien BRAULT
ae8704cdce [Console] Fix wrong ref in phpdoc 2012-02-16 22:26:30 +01:00
Grégoire Pineau
e5edf5ab86 [Console] Fixed CS 2012-02-13 00:29:28 +01:00
Grégoire Pineau
8abf50639a [Console] Added abbreviation into search for bad command / namespace 2012-02-13 00:16:28 +01:00
Grégoire Pineau
c6203bcffa [Console] Added namespace suggest on bad namespace name 2012-02-11 21:01:00 +01:00
Grégoire Pineau
117359a196 [Console] fixed CS according to PR comment 2012-02-11 16:33:06 +01:00
Grégoire Pineau
dd0d97e643 [Console] Added suggest on bad command name 2012-02-11 14:09:23 +01:00
Dariusz Górecki
e9b4c584c0 [Console] Enable process isolantion in Shell
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 :)
2012-02-02 10:09:00 +01:00
Fabien Potencier
5fa0f2d92b merged 2.0 2012-01-16 07:44:08 +01:00
Kris Wallsmith
fe62401907 optimized string starts with checks
Doing this with strpos() is slightly faster than substr().
2012-01-11 11:33:56 -08:00
Hugo Hamon
a7f857da87 [Console] removed unused $position parameter in Shell::autocompleter() method. 2012-01-10 22:07:21 +01:00
Jordi Boggiano
bea7a9c865 [Console] Fix tests on windows 2012-01-09 17:05:16 +01:00
Fabien Potencier
4ad7e0e4dd merged branch Seldaek/console_opts2 (PR #3061)
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.
2012-01-09 12:31:41 +01:00
Fabien Potencier
61975a1b3d [Console] tweaked previous merge 2012-01-09 12:22:03 +01:00
Fabien Potencier
4f8f2d4f47 merged branch Seldaek/console_opts (PR #3060)
Commits
-------

7f7b853 [Console] Format simple arrays nicer

Discussion
----------

[Console] Format simple arrays nicer

Minor cosmetic adjustment for simple (i.e. with sequential numeric keys) arrays
2012-01-09 12:15:01 +01:00
Fabien Potencier
ca8dc87940 merged 2.0 2012-01-09 11:51:30 +01:00
Jordi Boggiano
c9129e51fe Fix Console tests on windows 2012-01-09 10:04:20 +01:00
Jordi Boggiano
c7ab9ba7ec [Console] Allow redefinition of application options descriptions 2012-01-09 00:42:35 +01:00
Jordi Boggiano
7f7b853d79 [Console] Format simple arrays nicer 2012-01-09 00:03:43 +01:00
Fabien Potencier
8ce034fae0 Revert "merged 2.0"
This reverts commit 7000e944fd, reversing
changes made to 9d9013d662.
2012-01-08 20:43:02 +01:00
Fabien Potencier
0492290a3b [Console] added a missing method (closes #3043) 2012-01-06 04:12:25 +01:00
Fabien Potencier
7000e944fd merged 2.0 2012-01-05 14:54:04 +01:00
Fabien Potencier
208c2e468c removed the version attribute in all composer.json files 2012-01-05 14:51:20 +01:00
Fabien Potencier
cab70f4083 merged 2.0 2011-12-28 20:44:29 +01:00
Javier Eguíluz
2b64944fd7 [Console][Output] Fixed some minor typos and grammatical errors 2011-12-28 10:42:15 +01:00
Javier Eguíluz
96997f12d6 [Console][Input] Added missing PHPDoc and fixed some minor typos and grammatical errors 2011-12-28 10:39:14 +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
Javier Eguíluz
3ad02bd5f9 [Console][Formatter] Added missing PHPDoc @throws and fixed some minor typos and grammatical errors 2011-12-28 10:29:22 +01:00
Javier Eguíluz
33e3f11f48 [Console] Added a missing PHPDoc and replaced program by application 2011-12-28 10:22:28 +01:00
Fabien Potencier
5d6a7d35b0 merged 2.0 2011-12-18 14:48:17 +01:00
Fabien Potencier
4316595dbb fixed CS 2011-12-18 14:42:59 +01:00
Fabien Potencier
bbec4bb32b merged branch canni/fix_type_hint (PR #2912)
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.
2011-12-18 14:37:49 +01:00
Fabien Potencier
d08c2ef8b4 removed unused use statements 2011-12-18 14:36:25 +01:00
Fabien Potencier
3f4d718c5b [Console] fixed previous merge 2011-12-18 14:36:20 +01:00
Fabien Potencier
a13d2270ed merged branch andrewtch/plain-commands (PR #2914)
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
2011-12-18 14:28:52 +01:00
Fabien Potencier
997f354d53 tweaked the README files 2011-12-18 14:22:28 +01:00
Andrew Tch
2181f6c8b6 Fixed space 2011-12-18 14:03:17 +02:00
Fabien Potencier
0f2caf1106 merged branch lsmith77/component_readmes (PR #2561)
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.
2011-12-18 12:42:02 +01:00
Andrew Tch
5f98b73e7c Raw output of commands in app/console list 2011-12-18 01:19:10 +02:00
Dariusz Górecki
e417153e49 [BugFix][Console] Fix type hint for output formatter 2011-12-17 22:55:00 +01:00
Dariusz Górecki
cab03344d7 [Console] Enable stderr support
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.
2011-12-17 18:34:12 +01:00
Fabien Potencier
2750adb52d Merge branch '2.0'
* 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
2011-12-15 18:17:38 +01:00
Jeremy Mikola
d5a1343c29 [Console] Improve input definition output for Boolean defaults
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".
2011-12-15 01:07:36 -05:00
Fabien Potencier
142cef21bb merged 2.0 2011-12-13 16:12:53 +01:00
Fabien Potencier
e3421a0b1d [DoctrineBridge] fixed some CS 2011-12-13 10:22:12 +01:00
Fabien Potencier
bd708247f0 merged 2.0 2011-11-17 07:00:22 +01:00
Fabien Potencier
d1ae6c7cb6 bumped Symfony version in composer.json files to 2.0.7 2011-11-17 06:58:47 +01:00
Markus Tacker
839957487a Fixes a small php doc issue of Symfony\Component\Console\Command\Command::setDefinition() 2011-11-14 14:56:06 +01:00
Fabien Potencier
6f05544424 [Console] added an exception when overriding an existing argument (added some unit tests for option and arguments overriding) 2011-11-07 17:22:50 +01:00
Lukas Kahwe Smith
d6af3f145c fixed README for Console 2011-11-03 21:17:38 +01:00
Lukas Kahwe Smith
6a72b8c6b9 added basic README files for all components
heavily inspired by http://fabien.potencier.org/article/49/what-is-symfony2 and the official Symfony2 documentation
2011-11-03 21:11:40 +01:00
Fabien Potencier
f8f622b39c bumped Symfony version to 2.0.6-DEV 2011-11-02 14:18:45 +01:00
Fabien Potencier
7f21a5e979 bumped Symfony version in composer.json files to 2.0.5 2011-11-02 12:42:41 +01:00
Fabien Potencier
8a62e3249f merged 2.0 2011-11-01 12:32:44 +01:00
Fabien Potencier
d7a5351aaa updated composer.json files to contain information about autoloading and target dirs 2011-11-01 12:30:24 +01:00
Fabien Potencier
d34d50f0b0 fixed CS 2011-10-29 12:05:45 +02:00
Fabien Potencier
dec43f5539 merged 2.0 2011-10-29 12:01:39 +02:00
Douglas Greenshields
2ddd7cca7b [Console] Fixed stilted English in console header 2011-10-28 23:25:00 +02:00
Fabien Potencier
95ec41b075 [Console] made the defaults in Application more easily customizable 2011-10-25 17:12:17 +02:00
Fabien Potencier
4dc5953100 merged 2.0 2011-10-15 00:56:57 +02:00
Fabien Potencier
c00ba4dab8 [Console] fixed typo (closes #2358) 2011-10-11 12:56:40 +02:00
Fabien Potencier
245ff6d7a8 updated composer.json for 2.1 2011-09-29 17:40:43 +02:00
Fabien Potencier
f5ab6ec934 Merge branch '2.0'
* 2.0:
  [composer] add missing deps for FrameworkBundle
  [composer] change ext/intl to the new ext-intl syntax
  [composer] fix monolog-bridge composer.json, add more inter-component deps
  [composer] add composer.json
2011-09-29 17:29:32 +02:00
Fabien Potencier
0c38b95ad9 [Console] tweaked previous merge 2011-09-29 14:51:30 +02:00
Fabien Potencier
e74beb8bfa merged branch hason/shell (PR #1484)
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 ?
2011-09-29 14:37:30 +02:00
lenar
fd00ed0be1 [Console] Check if dialog helper actually exists 2011-09-29 11:45:17 +03:00
lenar
0f7bf4155c [Console] Detect if interactive mode is possible at all 2011-09-29 11:37:25 +03:00
Fabien Potencier
885bb33791 merged 2.0 2011-09-28 16:08:31 +02:00
Fabien Potencier
063e6f9ae6 merged branch Seldaek/commands (PR #1470)
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 #1467
536d979 [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
2011-09-27 15:48:10 +02:00
Igor Wiedler
9ade639bb4 [composer] add composer.json 2011-09-27 00:55:43 +02:00
Marcin Chylek
ed02aa9974 Fix console: list 'namespace' command display all available commands 2011-09-27 00:05:57 +02:00
Fabien Potencier
6fa1d64f84 Merge branch '2.0'
* 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()
2011-09-17 22:18:22 +02:00
Fabien Potencier
e0502b1d69 fixed previous merge, done the same change to other occurences 2011-09-16 14:38:31 +02:00
Johannes M. Schmitt
8e2cbe603b fixes usage of mb_* 2011-09-16 14:27:56 +02:00
Jordi Boggiano
536d9790c3 [Console] Added Command::isEnabled method that defines whether to add the command or not 2011-09-04 17:12:33 +02:00
Tom Klingenberg
e991c595b8 [Console] Improved checks for InputArgument and InputOption constructor's $mode parameter.
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.
2011-08-31 23:53:00 +02:00
Fabien Potencier
283097db09 Revert "expanded namespaces within phpdoc (special for PhpStorm)"
This reverts commit 6e7439e73a.
2011-08-13 19:27:36 +02:00
realmfoo
6e7439e73a expanded namespaces within phpdoc (special for PhpStorm) 2011-08-10 11:16:31 +04:00
Michel Salib
1087792f7e -- fix use of STDIN 2011-08-01 02:02:37 +02:00
Hugo Hamon
f2e4d35931 [Console] harmonized commands documentation by changing ./app/console to php app/console. 2011-07-28 10:01:57 +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
everzet
fa20b514a2 [Console] refactored definition printer 2011-07-06 15:44:24 +03:00
Fabien Potencier
01d583e889 [Console] fixed Command::setApplication() when the argument is null 2011-07-05 20:02:12 +02:00
Lenar Lõhmus
511a9a1fd7 Edited src/Symfony/Component/Console/Helper/DialogHelper.php via GitHub 2011-07-05 00:19:44 -07:00
Paul
924ea926ea made command consistent with other help texts (it's now './app/console', instead of 'php app/console') 2011-07-04 20:18:08 +02:00
Paul
836134620b Corrected help text from './symfony' to 'php app/console' 2011-07-04 20:06:30 +02:00
Martin Hason
060d75de17 [Console] fixed CS and simplified code 2011-07-01 10:40:43 +02:00
Martin Hason
a5ff6352c5 [Console] added support for interactive shell without readline extension 2011-06-30 12:55:47 +02:00
Laszlo Korte
6b72cda1a7 removed whitespace 2011-06-23 22:03:13 +02:00
Laszlo Korte
282a493af2 moved the constant from the interface back into the class 2011-06-23 21:57:47 +02:00
Laszlo Korte
7ec7fbefaa fixed inteface name 2011-06-23 18:31:46 +02:00
Laszlo Korte
9a829242fb [Console] Extract the OutputFormatter's regular expression into the inteface. 2011-06-23 18:14:54 +02:00
Fabien Potencier
f57e1d3e10 fixed CS 2011-06-23 14:07:53 +02:00
Fabien Potencier
6ab11eb1ce [Console] decoupled Command from Application 2011-06-20 21:24:21 +02:00
Fabien Potencier
5744b520f7 [Console] added unit tests for DialogHelper 2011-06-20 19:05:56 +02:00
Gábor Egyed
3cfff4bfbe [Console] fixed output formatter if content has line breaks 2011-06-18 02:07:44 +02:00
Fabien Potencier
54dd7966e6 [Console] added missing @api 2011-06-17 18:17:53 +02:00
Fabien Potencier
740b2ac833 [Console] added a --no-ansi option for disable ANSI output (closes #1238) 2011-06-08 10:26:48 +02:00
Fabien Potencier
c6cfd3aeb1 Merge remote branch 'Herzult/fixArrayOption'
* Herzult/fixArrayOption:
  Simplify conditional block
  [Command] Fix array option parsing
2011-06-07 19:55:53 +02:00
Fabien Potencier
d84728e278 [Console] removed the ? alias for help and fix a few bugs from the previous commit 2011-06-07 18:26:00 +02:00
Fabien Potencier
7d3e20d87d [Console] removed the special treatment of aliases in Application 2011-06-07 18:14:15 +02:00
Fabien Potencier
facff73049 made the console tool more powerful
* 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.
2011-06-07 17:51:43 +02:00
Antoine Hérault
d9f00ca7be Simplify conditional block 2011-06-07 15:19:16 +02:00
Antoine Hérault
fb051b2f98 [Command] Fix array option parsing 2011-06-07 14:58:11 +02:00
Fabien Potencier
06804d3f1d [Console] added mb_detect_encoding when needed 2011-06-04 18:20:20 +02:00
Fabien Potencier
18c3049fad Merge remote branch 'brikou/console_formatter_helper'
* brikou/console_formatter_helper:
  added mb_detect_encoding when formatting block (usefull when mb_internal_encoding is not properly set)
2011-06-04 18:19:11 +02:00
Fabien Potencier
79c6dc7937 [Console] fixed nested styles 2011-06-03 22:48:04 +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
Pascal Borreli
50d5e3e007 [Various] Fixed typos 2011-05-29 22:24:32 +00:00
Fabien Potencier
af2f9207be [Console] fixed typo 2011-05-27 15:34:13 +02:00
Fabien Potencier
15bede5a63 [Console] refactored style management
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.
2011-05-23 16:54:36 +02: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
Hugo Hamon
c6bd284ecd [Console] fixed phpdoc for Command class. 2011-04-30 22:17:30 +02:00
Eriksen Costa
164ce5210d capitalized 'boolean' 2011-04-27 02:35:10 -03:00
Eriksen Costa
4db0752894 replaced 'bool' with 'Boolean' 2011-04-27 02:35:03 -03: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
Pascal Borreli
b5769c52d6 Fixed various typo 2011-04-22 23:12:50 +00:00
Brikou CARRE
e898445b94 removed empty lines/trailing spaces 2011-04-15 21:12:02 +02:00
Fabien Potencier
514133a6bb [Console] made ApplicationTester::getDisplay() work even in case of an error during execution and changed returned value of ApplicationTester to the command exit code 2011-04-03 23:46:08 +02:00
Fabien Potencier
dd158a2c99 [Console] made CommandTester::getDispaly() work even in case of an error during execution 2011-04-03 23:25:59 +02:00
Fabien Potencier
ad4a0bda1c [Console] changed returned value of CommandTester to the command exit code 2011-04-03 22:30:40 +02:00
Fabien Potencier
1ec2886546 [Console] fixed previous commit 2011-03-29 22:03:29 +02:00
Fabien Potencier
49d67645d7 [Console] moved Output constants to OutputInterface 2011-03-29 21:53:28 +02:00
Fabien Potencier
e232218eed [Console] fixed PHP notice 2011-03-24 13:30:27 +01:00
Fabien Potencier
9206af1773 [Console] tagged the guaranteed BC API 2011-03-24 09:39:53 +01:00
ever.zet
3e7fa82f34 [Console] privatized protected variables, cuz they now have getters/setters 2011-03-17 18:51:37 +02:00
ever.zet
aa084dbc45 [Console] moved whole constructor definitions in one line 2011-03-17 18:51:01 +02:00
ever.zet
8b885a991c [Console] updated console and stream outputs to support new output formatter 2011-03-17 17:53:46 +02:00
ever.zet
644cf612b3 [Console] updated console output to support new output formatter and styles 2011-03-17 17:52:36 +02:00
ever.zet
4fe2efd49e [Console] implemented output formatter to decorate and format output messages 2011-03-17 17:51:49 +02:00
ever.zet
e5700b817b [Console] implemented output formatter style class for defining custom styles 2011-03-17 17:51:25 +02:00
ever.zet
65681cdc85 [Console] added output formatter interfaces 2011-03-17 17:50:42 +02:00
Fabien Potencier
49e3494560 [Console] fixed typo 2011-03-14 12:56:59 +01:00
Fabien Potencier
dcc1948fb6 Merge remote branch 'everzet/console-privatisation-errors'
* 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
2011-03-12 13:10:09 +01:00
ever.zet
dab8e5888f 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 2011-03-12 13:59:51 +02:00
ever.zet
d4d8576f93 start => finish, begin => end. Mixing them is a bad choice. 2011-03-12 13:57:04 +02:00
ever.zet
a809453416 ability to define custom regex's for style placeholders
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.
2011-03-12 13:54:35 +02:00
ever.zet
49b968df67 we need ability to get style parameters same way we set them with setStyle
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!
2011-03-12 13:49:06 +02:00
ever.zet
5ec8f47d7c if proper style not found, then this is a tag - no need in Exception 2011-03-12 11:55:44 +02:00
Fabien Potencier
b940cc6f40 moved most protected to private in the Console component 2011-03-11 12:53:42 +01:00
Fabien Potencier
c2e9dd27b2 [Console] fixed synopsis when an error occurs 2011-03-11 11:51:05 +01:00
Fabien Potencier
8c423edfef replaced symfony-project.org by symfony.com 2011-03-06 12:40:06 +01:00
Degory Valentine
057e86161e added test to verify ArgvInput->parse() failure with array input definition 2011-02-28 17:16:58 +01:00
Degory Valentine
0306c9aa66 Fixed array argument parsing in ArgvInput. 2011-02-28 17:16:58 +01:00
Pascal Borreli
46d28ce1b1 [Console] Removed useless else 2011-02-27 18:36:37 +01:00
Fabien Potencier
f54cedfe5e added LICENSE files for the subtree repositories 2011-02-22 18:58:15 +01:00
Kris Wallsmith
36ff9abe67 [Console] fixed new ArgvInput method 2011-02-12 21:51:34 +01:00
Tim Nagel
76e9b6ec97 [Console] PHPDoc fixes 2011-02-09 06:55:12 +01:00
Fabien Potencier
fae8a557f9 [Console] fixed typo 2011-02-08 22:37:21 +01:00
Fabien Potencier
9f30e42c16 added --debug/-d and --env/-d to console 2011-02-07 03:03:02 +01:00
Tim Nagel
f3b6e1a30c PHPDoc for Console 2011-02-07 01:54:10 +01:00
Lukas Kahwe Smith
dd71501f54 some fixes by just "blindly" trying to make phpStorm code analysis happier 2011-02-04 19:30:28 +01:00
Benjamin Eberlei
6ac5c298bd [Console] Add missing method isInteractive() to InputInterface and added some docblock comments to all interface methods. 2011-01-28 18:28:17 +01:00
Andy Stanberry
0ef67112b2 [Console] added writeln to the OutputInterface 2011-01-25 10:05:07 +01:00
Fabien Potencier
9607e61d86 [Console] fixed typo 2011-01-24 19:05:36 +01:00
Dominique Bongiraud
64fb94c725 normalized license messages in PHP files 2011-01-18 08:07:46 +01:00
Martin Hason
f41654fd60 [Console] added rendering previous exceptions 2011-01-11 14:52:32 +01:00
fivestar
ac3e5545b9 [Console] fixed call to undefined method. 2010-12-30 11:28:03 +01:00
Fabien Potencier
2547bbffc3 a-[Console] added some phpdoc 2010-12-06 08:11:27 +01:00
Ryan Weaver
7efb4630b8 [Command] Changing the InputOption::PARAMETER_* constants to InputOption::VALUE_* to more accurately reflect that these constants refer to the value or lack of value assigned to a particular option (e.g. --verbose or --em=doctrine).
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.
2010-11-27 19:56:27 +01:00
Fabien Potencier
944d91c1df made some method name changes to have a better coherence throughout the framework
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()
2010-11-25 17:30:06 +01:00
Kris Wallsmith
f79e23ffb5 Removed all those spaces after @author that were bothering me so… 2010-10-18 16:55:41 +02:00
Kris Wallsmith
0b1f3145ae Removed unnecessary "public" from interface method signatures. 2010-10-18 16:55:09 +02:00
Tom Van Looy
44f54c2578 [Console] fixed status code when it is > 255 2010-10-13 07:33:49 +02:00
Fabien Pennequin
56935f85df [Console] Fixed invalid help command shortcut 2010-09-14 09:18:47 +02:00
Fabien Potencier
bf82cf42dd renamed Symfony\Components to Symfony\Component 2010-08-20 23:09:55 +02:00