Skip to content

Commit 6cb57d2

Browse files
committed
Merge branch '2.8' into 3.1
* 2.8: (32 commits) [symfony#6989] some minor tweaks Added paths options in Framework::translator configuration [symfony#6934] add remember me response listener Update events.rst [symfony#6897] some tweaks after review Update voters.rst [symfony#6920] some tweaks after review Note about bundle priority for PrependExtensionInterface [symfony#6926] some tweaks after review [symfony#6905] rewrite code example to cover the setter Change example of ignoring dependencies for yaml [FormComponent]Fix wrong mention in side note Article about logout. Clarify by_reference use Use Terminal lexer for console examples Update entity_provider.rst fixing $formatLevelMap array values Fix subject/verb agreement Fixed directory name type fix link role syntax ...
2 parents 762a00e + b032584 commit 6cb57d2

File tree

95 files changed

+380
-352
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+380
-352
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from pygments.lexer import RegexLexer, bygroups, using
2+
from pygments.token import *
3+
from pygments.lexers.shell import BashLexer, BatchLexer
4+
5+
class TerminalLexer(RegexLexer):
6+
name = 'Terminal'
7+
aliases = ['terminal']
8+
filenames = []
9+
10+
tokens = {
11+
'root': [
12+
('^\$', Generic.Prompt, 'bash-prompt'),
13+
('^[^\n>]+>', Generic.Prompt, 'dos-prompt'),
14+
('^#.+$', Comment.Single),
15+
('^.+$', Generic.Output),
16+
],
17+
'bash-prompt': [
18+
('(.+)$', bygroups(using(BashLexer)), '#pop')
19+
],
20+
'dos-prompt': [
21+
('(.+)$', bygroups(using(BatchLexer)), '#pop')
22+
],
23+
}

_build/conf.py

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from pygments.lexers.special import TextLexer
2525
from pygments.lexers.text import RstLexer
2626
from pygments.lexers.web import PhpLexer
27+
from symfonycom.sphinx.lexer import TerminalLexer
2728

2829
# -- General configuration -----------------------------------------------------
2930

@@ -108,6 +109,7 @@
108109
lexers['rst'] = RstLexer()
109110
lexers['varnish3'] = CLexer()
110111
lexers['varnish4'] = CLexer()
112+
lexers['terminal'] = TerminalLexer()
111113

112114
config_block = {
113115
'markdown': 'Markdown',

assetic/asset_management.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ environment is just too slow.
596596
Instead, each time you use your application in the ``prod`` environment (and therefore,
597597
each time you deploy), you should run the following command:
598598

599-
.. code-block:: bash
599+
.. code-block:: terminal
600600
601601
$ php bin/console assetic:dump --env=prod --no-debug
602602
@@ -648,7 +648,7 @@ the following change in your ``config_dev.yml`` file:
648648
Next, since Symfony is no longer generating these assets for you, you'll
649649
need to dump them manually. To do so, run the following command:
650650

651-
.. code-block:: bash
651+
.. code-block:: terminal
652652
653653
$ php bin/console assetic:dump
654654
@@ -657,7 +657,7 @@ environment. The big disadvantage is that you need to run this each time
657657
you update an asset. Fortunately, by using the ``assetic:watch`` command,
658658
assets will be regenerated automatically *as they change*:
659659

660-
.. code-block:: bash
660+
.. code-block:: terminal
661661
662662
$ php bin/console assetic:watch
663663

assetic/php.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ associated libraries. Therefore, before enabling the filters used in this articl
3030
you must install two libraries. Open a command console, browse to your project
3131
directory and execute the following commands:
3232

33-
.. code-block:: bash
33+
.. code-block:: terminal
3434
3535
$ composer require leafo/scssphp
3636
$ composer require patchwork/jsqueeze

assetic/uglifyjs.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ The global installation method makes all your projects use the very same UglifyJ
2828
version, which simplifies its maintenance. Open your command console and execute
2929
the following command (you may need to run it as a root user):
3030

31-
.. code-block:: bash
31+
.. code-block:: terminal
3232
3333
$ npm install -g uglify-js
3434
3535
Now you can execute the global ``uglifyjs`` command anywhere on your system:
3636

37-
.. code-block:: bash
37+
.. code-block:: terminal
3838
3939
$ uglifyjs --help
4040
@@ -45,7 +45,7 @@ It's also possible to install UglifyJS inside your project only, which is useful
4545
when your project requires a specific UglifyJS version. To do this, install it
4646
without the ``-g`` option and specify the path where to put the module:
4747

48-
.. code-block:: bash
48+
.. code-block:: terminal
4949
5050
$ cd /path/to/your/symfony/project
5151
$ npm install uglify-js --prefix app/Resources
@@ -57,7 +57,7 @@ an npm `package.json`_ file and specify your dependencies there.
5757
Now you can execute the ``uglifyjs`` command that lives in the ``node_modules``
5858
directory:
5959

60-
.. code-block:: bash
60+
.. code-block:: terminal
6161
6262
$ "./app/Resources/node_modules/.bin/uglifyjs" --help
6363
@@ -115,7 +115,7 @@ your JavaScripts:
115115
The path where UglifyJS is installed may vary depending on your system.
116116
To find out where npm stores the ``bin`` folder, execute the following command:
117117

118-
.. code-block:: bash
118+
.. code-block:: terminal
119119
120120
$ npm bin -g
121121
@@ -251,7 +251,7 @@ Install, Configure and Use UglifyCSS
251251
The usage of UglifyCSS works the same way as UglifyJS. First, make sure
252252
the node package is installed:
253253

254-
.. code-block:: bash
254+
.. code-block:: terminal
255255
256256
# global installation
257257
$ npm install -g uglifycss

best_practices/business-logic.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ Data Fixtures
283283
As fixtures support is not enabled by default in Symfony, you should execute
284284
the following command to install the Doctrine fixtures bundle:
285285

286-
.. code-block:: bash
286+
.. code-block:: terminal
287287
288288
$ composer require "doctrine/doctrine-fixtures-bundle"
289289
@@ -320,7 +320,7 @@ Assuming you have at least one fixtures class and that the database access
320320
is configured properly, you can load your fixtures by executing the following
321321
command:
322322

323-
.. code-block:: bash
323+
.. code-block:: terminal
324324
325325
$ php bin/console doctrine:fixtures:load
326326

best_practices/creating-the-project.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Now that everything is correctly set up, you can create a new project based on
2525
Symfony. In your command console, browse to a directory where you have permission
2626
to create files and execute the following commands:
2727

28-
.. code-block:: bash
28+
.. code-block:: terminal
2929
3030
$ cd projects/
3131
$ symfony new blog
@@ -156,7 +156,7 @@ that follows these best practices:
156156
If your Symfony installation doesn't come with a pre-generated AppBundle,
157157
you can generate it by hand executing this command:
158158

159-
.. code-block:: bash
159+
.. code-block:: terminal
160160
161161
$ php bin/console generate:bundle --namespace=AppBundle --dir=src --format=annotation --no-interaction
162162

best_practices/introduction.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ best practices in mind. This project, called the Symfony Demo application, can
7474
be obtained through the Symfony Installer. First, `download and install`_ the
7575
installer and then execute this command to download the demo application:
7676

77-
.. code-block:: bash
77+
.. code-block:: terminal
7878
7979
$ symfony demo
8080

best_practices/templates.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ the Markdown contents of each post into HTML.
6969
To do this, first, install the excellent `Parsedown`_ Markdown parser as
7070
a new dependency of the project:
7171

72-
.. code-block:: bash
72+
.. code-block:: terminal
7373
7474
$ composer require erusev/parsedown
7575

bundles.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ And while it doesn't do anything yet, AcmeTestBundle is now ready to be used.
120120
And as easy as this is, Symfony also provides a command-line interface for
121121
generating a basic bundle skeleton:
122122

123-
.. code-block:: bash
123+
.. code-block:: terminal
124124
125125
$ php bin/console generate:bundle --namespace=Acme/TestBundle
126126

bundles/best_practices.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ following standardized instructions in your ``README.md`` file.
207207
Open a command console, enter your project directory and execute the
208208
following command to download the latest stable version of this bundle:
209209
210-
```bash
210+
```console
211211
$ composer require <package-name> "~1"
212212
```
213213
@@ -254,7 +254,7 @@ following standardized instructions in your ``README.md`` file.
254254
Open a command console, enter your project directory and execute the
255255
following command to download the latest stable version of this bundle:
256256
257-
.. code-block:: bash
257+
.. code-block:: terminal
258258
259259
$ composer require <package-name> "~1"
260260

bundles/installation.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ the bundle on the `Packagist.org`_ site.
3434

3535
Now that you know the package name, you can install it via Composer:
3636

37-
.. code-block:: bash
37+
.. code-block:: terminal
3838
3939
$ composer require friendsofsymfony/user-bundle
4040
4141
This will choose the best version for your project, add it to ``composer.json``
4242
and download its code into the ``vendor/`` directory. If you need a specific
4343
version, include it as the second argument of the `composer require`_ command:
4444

45-
.. code-block:: bash
45+
.. code-block:: terminal
4646
4747
$ composer require friendsofsymfony/user-bundle "~2.0"
4848
@@ -106,14 +106,14 @@ in ``app/config/config.yml``. The bundle's documentation will tell you about
106106
the configuration, but you can also get a reference of the bundle's configuration
107107
via the ``config:dump-reference`` command:
108108

109-
.. code-block:: bash
109+
.. code-block:: terminal
110110
111111
$ bin/console config:dump-reference AsseticBundle
112112
113113
Instead of the full bundle name, you can also pass the short name used as the root
114114
of the bundle's configuration:
115115

116-
.. code-block:: bash
116+
.. code-block:: terminal
117117
118118
$ bin/console config:dump-reference assetic
119119

bundles/prepend_extension.rst

+7
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,10 @@ The above would be the equivalent of writing the following into the
131131
// ...
132132
'use_acme_goodbye' => false,
133133
));
134+
135+
More than one Bundle using PrependExtensionInterface
136+
----------------------------------------------------
137+
138+
If there is more than one bundle that prepends the same extension and defines
139+
the same key, the bundle that is registered **first** will take priority:
140+
next bundles won't override this specific config setting.

components/console/changing_default_command.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Executing the application and changing the default Command::
4343

4444
Test the new default console command by running the following:
4545

46-
.. code-block:: bash
46+
.. code-block:: terminal
4747
4848
$ php application.php
4949

components/console/logger.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ constructor::
9898

9999
// ...
100100
$formatLevelMap = array(
101-
LogLevel::CRITICAL => ConsoleLogger::INFO,
102-
LogLevel::DEBUG => ConsoleLogger::ERROR,
101+
LogLevel::CRITICAL => ConsoleLogger::ERROR,
102+
LogLevel::DEBUG => ConsoleLogger::INFO,
103103
);
104104
$logger = new ConsoleLogger($output, array(), $formatLevelMap);
105105

components/console/usage.rst

+14-14
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,26 @@ Built-in Commands
2828
There is a built-in command ``list`` which outputs all the standard options
2929
and the registered commands:
3030

31-
.. code-block:: bash
31+
.. code-block:: terminal
3232
3333
$ php application.php list
3434
3535
You can get the same output by not running any command as well
3636

37-
.. code-block:: bash
37+
.. code-block:: terminal
3838
3939
$ 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

44-
.. code-block:: bash
44+
.. code-block:: terminal
4545
4646
$ php application.php help list
4747
4848
Running ``help`` without specifying a command will list the global options:
4949

50-
.. code-block:: bash
50+
.. code-block:: terminal
5151
5252
$ php application.php help
5353
@@ -57,29 +57,29 @@ Global Options
5757
You can get help information for any command with the ``--help`` option. To
5858
get help for the list command:
5959

60-
.. code-block:: bash
60+
.. code-block:: terminal
6161
6262
$ php application.php list --help
6363
$ php application.php list -h
6464
6565
You can suppress output with:
6666

67-
.. code-block:: bash
67+
.. code-block:: terminal
6868
6969
$ php application.php list --quiet
7070
$ php application.php list -q
7171
7272
You can get more verbose messages (if this is supported for a command)
7373
with:
7474

75-
.. code-block:: bash
75+
.. code-block:: terminal
7676
7777
$ php application.php list --verbose
7878
$ php application.php list -v
7979
8080
To output even more verbose messages you can use these options:
8181

82-
.. code-block:: bash
82+
.. code-block:: terminal
8383
8484
$ php application.php list -vv
8585
$ php application.php list -vvv
@@ -90,7 +90,7 @@ If you set the optional arguments to give your application a name and version::
9090

9191
then you can use:
9292

93-
.. code-block:: bash
93+
.. code-block:: terminal
9494
9595
$ php application.php list --version
9696
$ php application.php list -V
@@ -109,19 +109,19 @@ If you do not provide a console name then it will just output:
109109
110110
You can force turning on ANSI output coloring with:
111111

112-
.. code-block:: bash
112+
.. code-block:: terminal
113113
114114
$ php application.php list --ansi
115115
116116
or turn it off with:
117117

118-
.. code-block:: bash
118+
.. code-block:: terminal
119119
120120
$ php application.php list --no-ansi
121121
122122
You can suppress any interactive questions from the command you are running with:
123123

124-
.. code-block:: bash
124+
.. code-block:: terminal
125125
126126
$ php application.php list --no-interaction
127127
$ php application.php list -n
@@ -133,7 +133,7 @@ You do not have to type out the full command names. You can just type the
133133
shortest unambiguous name to run a command. So if there are non-clashing
134134
commands, then you can run ``help`` like this:
135135

136-
.. code-block:: bash
136+
.. code-block:: terminal
137137
138138
$ php application.php h
139139
@@ -142,7 +142,7 @@ to type the shortest unambiguous text for each part. If you have created the
142142
``demo:greet`` as shown in :doc:`/components/console` then you
143143
can run it with:
144144

145-
.. code-block:: bash
145+
.. code-block:: terminal
146146
147147
$ php application.php d:g Fabien
148148

0 commit comments

Comments
 (0)