Skip to content

Commit d4b2c99

Browse files
committed
Merge branch '4.1'
* 4.1: added mentoring and speaker mentoring sections Fix translation debug examples [Dotenv] Advise using the Composer --dev option Fixed some RST syntax issues Add note about configuration root node Add twig.runtime Updating language to remove ORM Recommend to install ORM pack instead of Doctrine bundle
2 parents a7c30bb + 3cf74d4 commit d4b2c99

File tree

10 files changed

+142
-28
lines changed

10 files changed

+142
-28
lines changed

bundles/configuration.rst

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,9 @@ as integration of other related components:
4747
Using the Bundle Extension
4848
--------------------------
4949

50-
The basic idea is that instead of having the user override individual
51-
parameters, you let the user configure just a few, specifically created,
52-
options. As the bundle developer, you then parse through that configuration and
53-
load correct services and parameters inside an "Extension" class.
54-
55-
As an example, imagine you are creating a social bundle, which provides
56-
integration with Twitter and such. To be able to reuse your bundle, you have to
57-
make the ``client_id`` and ``client_secret`` variables configurable. Your
58-
bundle configuration would look like:
50+
Imagine you are creating a new bundle - AcmeSocialBundle - which provides
51+
integration with Twitter, etc. To make your bundle easy to use, you want to
52+
allow users to configure it with some configuration that looks like this:
5953

6054
.. configuration-block::
6155

@@ -92,6 +86,17 @@ bundle configuration would look like:
9286
'client_secret' => 'your_secret',
9387
));
9488
89+
The basic idea is that instead of having the user override individual
90+
parameters, you let the user configure just a few, specifically created,
91+
options. As the bundle developer, you then parse through that configuration and
92+
load correct services and parameters inside an "Extension" class.
93+
94+
.. note::
95+
96+
The root key of your bundle configuration (``acme_social`` in the previous
97+
example) is automatically determined from your bundle name (it's the
98+
`snake case`_ of the bundle name without the ``Bundle`` suffix ).
99+
95100
.. seealso::
96101

97102
Read more about the extension in :doc:`/bundles/extension`.
@@ -428,3 +433,4 @@ Assuming the XSD file is called ``hello-1.0.xsd``, the schema location will be
428433
.. _`TwigBundle Configuration`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php
429434
.. _`XML namespace`: https://en.wikipedia.org/wiki/XML_namespace
430435
.. _`XML schema`: https://en.wikipedia.org/wiki/XML_schema
436+
.. _`snake case`: https://en.wikipedia.org/wiki/Snake_case

components/dotenv.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Installation
1313

1414
.. code-block:: terminal
1515
16-
$ composer require symfony/dotenv
16+
$ composer require --dev symfony/dotenv
1717
1818
Alternatively, you can clone the `<https://github.com/symfony/dotenv>`_ repository.
1919

contributing/community/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ Community
77
releases
88
review-comments
99
reviews
10+
mentoring
11+
speaker-mentoring
1012
other

contributing/community/mentoring.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Mentoring
2+
=========
3+
4+
Reading the :doc:`contributing </contributing/index>` is already a great way
5+
to get started on becoming a Symfony contributor. However, sometimes
6+
it might still seem overwhelming - contributing can be complex! For this
7+
purpose we created a dedicated `Symfony Slack`_ channel called `#mentoring`_
8+
to connect new contributors to long-time contributors. This is a great way
9+
to get one-on-one advice on the entire process. These long-time contributors
10+
do really want to help new contributors - so feel free to ask anything!
11+
12+
.. _`Symfony Slack`: https://symfony.com/slack-invite
13+
.. _`#mentoring`: https://symfony-devs.slack.com/messages/mentoring
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Speaker Mentoring
2+
=================
3+
4+
The Symfony community benefits greatly when as many people as possible
5+
share their knowledge and experience with others. Every different
6+
point of view adds to our collective understanding of how to best use
7+
and evolve the code, design patterns and architecture provided within
8+
the Symfony community. Because of this, we specifically want to hear
9+
from long-time contributors and new users, who often come across entirely
10+
different challenges with a totally fresh new look and perspective.
11+
12+
How to get started
13+
------------------
14+
15+
Giving a first talk at a conference can seem quite intimidating. But
16+
don't worry! At one time, every speaker went through the same process.
17+
And so, we want to make sure that as many people as possible are empowered
18+
to take this path if they are motivated. We have collected a few resources
19+
with advice to get started. More importantly, we can connect experienced
20+
speakers with people who are just taking their first steps in this area:
21+
22+
.. tip::
23+
24+
A good first step might be to give a talk at a local user group to a
25+
smaller crowd that one knows more intimately. A next step could be to
26+
give a talk at conference in your first language.
27+
28+
The best way to find people that can review your talk idea or slides is
29+
the `#speaker-mentoring`_ channel on `Symfony Slack`_. There are many
30+
seasoned speakers with knowledge in various parts of Symfony that are
31+
motivated to help you get started on your path towards becoming a
32+
public speaker. They can even do practice runs via video chat!
33+
Furthermore, they can also be an ally when it comes to the day of
34+
giving the talk at a conference!
35+
36+
A great resource with advice on everything related to`public speaking`_
37+
is a collection of links maintained by VM (Vicky) Brasseur. It covers
38+
everything from finding a conference call for proposals, how to
39+
refine a proposal, to how to put together slide decks to practical
40+
tips for preparation and talk delivery.
41+
42+
.. _`#speaker-mentoring`: https://symfony-devs.slack.com/messages/speaker-mentoring
43+
.. _`Symfony Slack`: https://symfony.com/slack-invite
44+
.. _`public speaking`: https://github.com/vmbrasseur/Public_Speaking

doctrine/dbal.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ makes it easy to execute queries and perform other database actions.
2121
Read the official Doctrine `DBAL Documentation`_ to learn all the details
2222
and capabilities of Doctrine's DBAL library.
2323

24-
First, install the Doctrine bundle:
24+
First, install the Doctrine ORM pack:
2525

2626
.. code-block:: terminal
2727
28-
$ composer require doctrine/doctrine-bundle
28+
$ composer require symfony/orm-pack
2929
3030
Then configure the ``DATABASE_URL`` environment variable in ``.env``:
3131

@@ -36,9 +36,9 @@ Then configure the ``DATABASE_URL`` environment variable in ``.env``:
3636
# customize this line!
3737
DATABASE_URL="mysql://db_user:[email protected]:3306/db_name"
3838
39-
Further things can be configured in ``config/packages/doctrine.yaml``. For the full
40-
DBAL configuration options, or to learn how to configure multiple connections,
41-
see :ref:`reference-dbal-configuration`.
39+
Further things can be configured in ``config/packages/doctrine.yaml`` - see
40+
:ref:`reference-dbal-configuration`. Remove the ``orm`` key in that file
41+
if you *don't* want to use the Doctrine ORM.
4242

4343
You can then access the Doctrine DBAL connection by autowiring the ``Connection``
4444
object::

frontend/encore/faq.rst

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ FAQ and Common Issues
33

44
.. _how-do-i-deploy-my-encore-assets:
55

6-
How do I deploy my Encore Assets?
6+
How Do I Deploy My Encore Assets?
77
---------------------------------
88

99
There are two important things to remember when deploying your assets.
1010

11-
**1) Compile assets for production**
11+
**1) Compile Assets for Production**
1212

1313
Optimize your assets for production by running:
1414

@@ -19,11 +19,12 @@ Optimize your assets for production by running:
1919
That will minify your assets and make other performance optimizations. Yay!
2020

2121
But, what server should you run this command on? That depends on how you deploy.
22-
For example, you could execute this locally (or on a build server), and use rsync
23-
or something else to transfer the built files to your server. Or, you could put your
24-
files on your production server first (e.g. via a git pull) and then run this command
25-
on production (ideally, before traffic hits your code). In this case, you'll need
26-
to install Node.js on your production server.
22+
For example, you could execute this locally (or on a build server), and use
23+
`rsync`_ or something else to transfer the generated files to your production
24+
server. Or, you could put your files on your production server first (e.g. via
25+
``git pull``) and then run this command on production (ideally, before traffic
26+
hits your code). In this case, you'll need to install Node.js on your production
27+
server.
2728

2829
**2) Only Deploy the Built Assets**
2930

@@ -34,13 +35,13 @@ asset files, **unless** you plan on running ``encore production`` on your produc
3435
machine. Once your assets are built, these are the *only* thing that need to live
3536
on the production server.
3637

37-
Do I need to Install Node.js on my Production Server?
38+
Do I Need to Install Node.js on My Production Server?
3839
-----------------------------------------------------
3940

4041
No, unless you plan to build your production assets on your production server,
41-
which is not recommended. See `How do I deploy my Encore Assets?`_.
42+
which is not recommended. See `How Do I Deploy my Encore Assets?`_.
4243

43-
What Files Should I commit to git? And which should I Ignore?
44+
What Files Should I Commit to git? And which Should I Ignore?
4445
-------------------------------------------------------------
4546

4647
You should commit all of your files to git, except for the ``node_modules/`` directory
@@ -131,3 +132,5 @@ this via:
131132
132133
// require a non-minified file whenever possible
133134
require('respond.js/dest/respond.src.js');
135+
136+
.. _`rsync`: https://rsync.samba.org/

reference/dic_tags.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Tag Name Usage
4141
`translation.dumper`_ Register a custom service that dumps translation messages
4242
`twig.extension`_ Register a custom Twig Extension
4343
`twig.loader`_ Register a custom service that loads Twig templates
44+
`twig.runtime`_ Register a lazy-loaded Twig Extension
4445
`validator.constraint_validator`_ Create your own custom validation constraint
4546
`validator.initializer`_ Register a service that initializes objects before validation
4647
======================================== ========================================================================
@@ -1175,6 +1176,51 @@ also register it manually:
11751176
The ``priority`` value is optional and defaults to ``0``.
11761177
The higher priority loaders are tried first.
11771178

1179+
.. _reference-dic-tags-twig-runtime:
1180+
1181+
twig.runtime
1182+
------------
1183+
1184+
**Purpose**: To register a custom Lazy-Loaded Twig Extension
1185+
1186+
:ref:`Lazy-Loaded Twig Extensions <lazy-loaded-twig-extensions>` are defined as
1187+
regular services but the need to be tagged with ``twig.runtime``. If you're using the
1188+
:ref:`default services.yaml configuration <service-container-services-load-example>`,
1189+
the service is auto-registered and auto-tagged. But, you can also register it manually:
1190+
1191+
.. configuration-block::
1192+
1193+
.. code-block:: yaml
1194+
1195+
services:
1196+
App\Twig\AppExtension:
1197+
tags: [twig.runtime]
1198+
1199+
.. code-block:: xml
1200+
1201+
<?xml version="1.0" encoding="UTF-8" ?>
1202+
<container xmlns="http://symfony.com/schema/dic/services"
1203+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1204+
xsi:schemaLocation="http://symfony.com/schema/dic/services
1205+
http://symfony.com/schema/dic/services/services-1.0.xsd">
1206+
1207+
<services>
1208+
<service id="App\Twig\AppExtension">
1209+
<tag name="twig.runtime" />
1210+
</service>
1211+
</services>
1212+
</container>
1213+
1214+
.. code-block:: php
1215+
1216+
use App\Twig\AppExtension;
1217+
use App\Twig\AnotherExtension;
1218+
1219+
$container
1220+
->register(AppExtension::class)
1221+
->addTag('twig.runtime')
1222+
;
1223+
11781224
validator.constraint_validator
11791225
------------------------------
11801226

setup/built_in_web_server.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ can change the socket passing an IP address and a port as a command-line argumen
6464
6565
$ php bin/console server:status 192.168.0.1:8080
6666
67-
The first command shows if your Symfony application will be server through
67+
The first command shows if your Symfony application will be served through
6868
``localhost:8000``, the second one does the same for ``192.168.0.1:8080``.
6969

7070
.. tip::

translation/debug.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ for the ``fr`` locale and run the command, you will get:
143143
--------- ------------------ ---------------------- -------------------------------
144144
State Id Message Preview (fr) Fallback Message Preview (en)
145145
--------- ------------------ ---------------------- -------------------------------
146-
missing Symfony is great J'aime Symfony Symfony is great
146+
missing Symfony is great Symfony is great Symfony is great
147147
--------- ------------------ ---------------------- -------------------------------
148148
149149
The state indicates the message is missing because it is not translated in
@@ -162,7 +162,7 @@ translation file in the ``fr`` locale and run the command, you will get:
162162
---------- ------------------ ---------------------- -------------------------------
163163
State Id Message Preview (fr) Fallback Message Preview (en)
164164
---------- ------------------ ---------------------- -------------------------------
165-
fallback Symfony is great J'aime Symfony Symfony is great
165+
fallback Symfony is great Symfony is great Symfony is great
166166
---------- ------------------ ---------------------- -------------------------------
167167
168168
You can see that the translations of the message are identical in the ``fr``

0 commit comments

Comments
 (0)