Skip to content

Commit 9e2e64b

Browse files
committed
bug #3427 Removed code references to Symfony Standard Distribution (danielcsgomes)
This PR was merged into the 2.3 branch. Discussion ---------- Removed code references to Symfony Standard Distribution | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3+ | Fixed tickets | After talk with @wouterj on #3426 and IRC about references in the standalone Console component to the framework I decided to submit this PR to change the code that have some references to the Symfony Standard Distribution in the code. Commits ------- 4fd7022 Removed code references to Symfony Standard Distribution
2 parents 1e0311e + 4fd7022 commit 9e2e64b

File tree

3 files changed

+40
-38
lines changed

3 files changed

+40
-38
lines changed

components/console/introduction.rst

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Creating a basic Command
3535
To make a console command that greets you from the command line, create ``GreetCommand.php``
3636
and add the following to it::
3737

38-
namespace Acme\DemoBundle\Command;
38+
namespace Acme\Command;
3939

4040
use Symfony\Component\Console\Command\Command;
4141
use Symfony\Component\Console\Input\InputArgument;
@@ -86,9 +86,9 @@ an ``Application`` and adds commands to it::
8686

8787
#!/usr/bin/env php
8888
<?php
89-
// app/console
89+
// application.php
9090

91-
use Acme\DemoBundle\Command\GreetCommand;
91+
use Acme\Command\GreetCommand;
9292
use Symfony\Component\Console\Application;
9393

9494
$application = new Application();
@@ -99,7 +99,7 @@ Test the new console command by running the following
9999

100100
.. code-block:: bash
101101
102-
$ app/console demo:greet Fabien
102+
$ php application.php demo:greet Fabien
103103
104104
This will print the following to the command line:
105105

@@ -111,7 +111,7 @@ You can also use the ``--yell`` option to make everything uppercase:
111111

112112
.. code-block:: bash
113113
114-
$ app/console demo:greet Fabien --yell
114+
$ php application.php demo:greet Fabien --yell
115115
116116
This prints::
117117

@@ -232,8 +232,8 @@ The command can now be used in either of the following ways:
232232

233233
.. code-block:: bash
234234
235-
$ app/console demo:greet Fabien
236-
$ app/console demo:greet Fabien Potencier
235+
$ php application.php demo:greet Fabien
236+
$ php application.php demo:greet Fabien Potencier
237237
238238
It is also possible to let an argument take a list of values (imagine you want
239239
to greet all your friends). For this it must be specified at the end of the
@@ -251,7 +251,7 @@ To use this, just specify as many names as you want:
251251

252252
.. code-block:: bash
253253
254-
$ app/console demo:greet Fabien Ryan Bernhard
254+
$ php application.php demo:greet Fabien Ryan Bernhard
255255
256256
You can access the ``names`` argument as an array::
257257

@@ -321,8 +321,8 @@ flag:
321321

322322
.. code-block:: bash
323323
324-
$ app/console demo:greet Fabien
325-
$ app/console demo:greet Fabien --iterations=5
324+
$ php application.php demo:greet Fabien
325+
$ php application.php demo:greet Fabien --iterations=5
326326
327327
The first example will only print once, since ``iterations`` is empty and
328328
defaults to ``1`` (the last argument of ``addOption``). The second example
@@ -333,8 +333,8 @@ will work:
333333

334334
.. code-block:: bash
335335
336-
$ app/console demo:greet Fabien --iterations=5 --yell
337-
$ app/console demo:greet Fabien --yell --iterations=5
336+
$ php application.php demo:greet Fabien --iterations=5 --yell
337+
$ php application.php demo:greet Fabien --yell --iterations=5
338338
339339
There are 4 option variants you can use:
340340

@@ -380,9 +380,9 @@ useful one is the :class:`Symfony\\Component\\Console\\Tester\\CommandTester`
380380
class. It uses special input and output classes to ease testing without a real
381381
console::
382382

383+
use Acme\Command\GreetCommand;
383384
use Symfony\Component\Console\Application;
384385
use Symfony\Component\Console\Tester\CommandTester;
385-
use Acme\DemoBundle\Command\GreetCommand;
386386

387387
class ListCommandTest extends \PHPUnit_Framework_TestCase
388388
{
@@ -409,9 +409,9 @@ You can test sending arguments and options to the command by passing them
409409
as an array to the :method:`Symfony\\Component\\Console\\Tester\\CommandTester::execute`
410410
method::
411411

412+
use Acme\Command\GreetCommand;
412413
use Symfony\Component\Console\Application;
413414
use Symfony\Component\Console\Tester\CommandTester;
414-
use Acme\DemoBundle\Command\GreetCommand;
415415

416416
class ListCommandTest extends \PHPUnit_Framework_TestCase
417417
{
@@ -491,6 +491,7 @@ Learn More!
491491

492492
* :doc:`/components/console/usage`
493493
* :doc:`/components/console/single_command_tool`
494+
* :doc:`/components/console/events`
494495

495496
.. _Packagist: https://packagist.org/packages/symfony/console
496497
.. _ANSICON: https://github.com/adoxa/ansicon/downloads

components/console/single_command_tool.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ You can also simplify how you execute the application::
6666
#!/usr/bin/env php
6767
<?php
6868
// command.php
69+
6970
use Acme\Tool\MyApplication;
7071

7172
$application = new MyApplication();

components/console/usage.rst

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ built-in options as well as a couple of built-in commands for the Console compon
99

1010
.. note::
1111

12-
These examples assume you have added a file ``app/console`` to run at
12+
These examples assume you have added a file ``application.php`` to run at
1313
the cli::
1414

1515
#!/usr/bin/env php
16-
# app/console
1716
<?php
17+
// application.php
1818

1919
use Symfony\Component\Console\Application;
2020

@@ -30,26 +30,26 @@ and the registered commands:
3030

3131
.. code-block:: bash
3232
33-
$ php app/console list
33+
$ php application.php list
3434
3535
You can get the same output by not running any command as well
3636

3737
.. code-block:: bash
3838
39-
$ php app/console
39+
$ php application.php
4040
4141
The help command lists the help information for the specified command. For
4242
example, to get the help for the ``list`` command:
4343

4444
.. code-block:: bash
4545
46-
$ php app/console help list
46+
$ php application.php help list
4747
4848
Running ``help`` without specifying a command will list the global options:
4949

5050
.. code-block:: bash
5151
52-
$ php app/console help
52+
$ php application.php help
5353
5454
Global Options
5555
~~~~~~~~~~~~~~
@@ -59,33 +59,33 @@ get help for the list command:
5959

6060
.. code-block:: bash
6161
62-
$ php app/console list --help
63-
$ php app/console list -h
62+
$ php application.php list --help
63+
$ php application.php list -h
6464
6565
You can suppress output with:
6666

6767
.. code-block:: bash
6868
69-
$ php app/console list --quiet
70-
$ php app/console list -q
69+
$ php application.php list --quiet
70+
$ php application.php list -q
7171
7272
You can get more verbose messages (if this is supported for a command)
7373
with:
7474

7575
.. code-block:: bash
7676
77-
$ php app/console list --verbose
78-
$ php app/console list -v
77+
$ php application.php list --verbose
78+
$ php application.php list -v
7979
8080
The verbose flag can optionally take a value between 1 (default) and 3 to
8181
output even more verbose messages:
8282

8383
.. code-block:: bash
8484
85-
$ php app/console list --verbose=2
86-
$ php app/console list -vv
87-
$ php app/console list --verbose=3
88-
$ php app/console list -vvv
85+
$ php application.php list --verbose=2
86+
$ php application.php list -vv
87+
$ php application.php list --verbose=3
88+
$ php application.php list -vvv
8989
9090
If you set the optional arguments to give your application a name and version::
9191

@@ -95,8 +95,8 @@ then you can use:
9595

9696
.. code-block:: bash
9797
98-
$ php app/console list --version
99-
$ php app/console list -V
98+
$ php application.php list --version
99+
$ php application.php list -V
100100
101101
to get this information output:
102102

@@ -114,20 +114,20 @@ You can force turning on ANSI output coloring with:
114114

115115
.. code-block:: bash
116116
117-
$ php app/console list --ansi
117+
$ php application.php list --ansi
118118
119119
or turn it off with:
120120

121121
.. code-block:: bash
122122
123-
$ php app/console list --no-ansi
123+
$ php application.php list --no-ansi
124124
125125
You can suppress any interactive questions from the command you are running with:
126126

127127
.. code-block:: bash
128128
129-
$ php app/console list --no-interaction
130-
$ php app/console list -n
129+
$ php application.php list --no-interaction
130+
$ php application.php list -n
131131
132132
Shortcut Syntax
133133
~~~~~~~~~~~~~~~
@@ -138,7 +138,7 @@ commands, then you can run ``help`` like this:
138138

139139
.. code-block:: bash
140140
141-
$ php app/console h
141+
$ php application.php h
142142
143143
If you have commands using ``:`` to namespace commands then you just have
144144
to type the shortest unambiguous text for each part. If you have created the
@@ -147,7 +147,7 @@ can run it with:
147147

148148
.. code-block:: bash
149149
150-
$ php app/console d:g Fabien
150+
$ php application.php d:g Fabien
151151
152152
If you enter a short command that's ambiguous (i.e. there are more than one
153153
command that match), then no command will be run and some suggestions of

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy