Skip to content

Commit 56a0e4d

Browse files
committed
Merge branch '2.1'
2 parents 4a53877 + 6878140 commit 56a0e4d

32 files changed

+179
-85
lines changed

contributing/code/bugs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ If your problem definitely looks like a bug, report it using the official bug
2525
* Describe the steps needed to reproduce the bug with short code examples
2626
(providing a unit test that illustrates the bug is best);
2727

28-
* Give as much details as possible about your environment (OS, PHP version,
28+
* Give as much detail as possible about your environment (OS, PHP version,
2929
Symfony version, enabled extensions, ...);
3030

3131
* *(optional)* Attach a :doc:`patch <patches>`.

contributing/code/patches.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Get the Symfony2 source code:
7171

7272
* Fork the `Symfony2 repository`_ (click on the "Fork" button);
7373

74-
* After the "hardcore forking action" has completed, clone your fork locally
74+
* After the "forking action" has completed, clone your fork locally
7575
(this will create a `symfony` directory):
7676

7777
.. code-block:: bash
@@ -251,8 +251,8 @@ You can now make a pull request on the ``symfony/symfony`` Github repository.
251251

252252
.. tip::
253253

254-
Take care to point your pull request towards ``symfony:2.0`` if you want
255-
the core team to pull a bugfix based on the 2.0 branch.
254+
Take care to point your pull request towards ``symfony:2.1`` if you want
255+
the core team to pull a bugfix based on the 2.1 branch.
256256

257257
To ease the core team work, always include the modified components in your
258258
pull request message, like in:
@@ -267,6 +267,9 @@ pull request message, like in:
267267
Please use the title with "[WIP]" if the submission is not yet completed
268268
or the tests are incomplete or not yet passing.
269269

270+
Pull Request Description
271+
~~~~~~~~~~~~~~~~~~~~~~~~
272+
270273
The pull request description must include the following check list to ensure
271274
that contributions may be reviewed without needless feedback loops and that
272275
your contributions can be included into Symfony2 as quickly as possible:

contributing/code/security.rst

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,23 @@ confirmed, the core-team works on a solution following these steps:
2121

2222
1. Send an acknowledgement to the reporter;
2323
2. Work on a patch;
24-
3. Write a security announcement for the official Symfony `blog`_ about the
24+
3. Get a CVE identifier from mitre.org;
25+
4. Write a security announcement for the official Symfony `blog`_ about the
2526
vulnerability. This post should contain the following information:
2627

2728
* a title that always include the "Security release" string;
2829
* a description of the vulnerability;
2930
* the affected versions;
3031
* the possible exploits;
3132
* how to patch/upgrade/workaround affected applications;
33+
* the CVE identifier;
3234
* credits.
33-
4. Send the patch and the announcement to the reporter for review;
34-
5. Apply the patch to all maintained versions of Symfony;
35-
6. Package new versions for all affected versions;
36-
7. Publish the post on the official Symfony `blog`_ (it must also be added to
35+
5. Send the patch and the announcement to the reporter for review;
36+
6. Apply the patch to all maintained versions of Symfony;
37+
7. Package new versions for all affected versions;
38+
8. Publish the post on the official Symfony `blog`_ (it must also be added to
3739
the "`Security Advisories`_" category);
38-
8. Update the security advisory list (see below).
40+
9. Update the security advisory list (see below).
3941

4042
.. note::
4143

@@ -52,10 +54,11 @@ Security Advisories
5254
This section indexes security vulnerabilities that were fixed in Symfony
5355
releases, starting from Symfony 1.0.0:
5456

57+
* December 20, 2012: `Security release: Symfony 2.0.20 and 2.1.5 <http://symfony.com/blog/security-release-symfony-2-0-20-and-2-1-5-released>`_ (`CVE-2012-6431 <http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-6431>`_ and `CVE-2012-6432 <http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-6432>`_)
5558
* November 29, 2012: `Security release: Symfony 2.0.19 and 2.1.4 <http://symfony.com/blog/security-release-symfony-2-0-19-and-2-1-4>`_
56-
* November 25, 2012: `Security release: symfony 1.4.20 released <http://symfony.com/blog/security-release-symfony-1-4-20-released>`_
59+
* November 25, 2012: `Security release: symfony 1.4.20 released <http://symfony.com/blog/security-release-symfony-1-4-20-released>`_ (`CVE-2012-5574 <http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-5574>`_)
5760
* August 28, 2012: `Security Release: Symfony 2.0.17 released <http://symfony.com/blog/security-release-symfony-2-0-17-released>`_
58-
* May 30, 2012: `Security Release: symfony 1.4.18 released <http://symfony.com/blog/security-release-symfony-1-4-18-released>`_
61+
* May 30, 2012: `Security Release: symfony 1.4.18 released <http://symfony.com/blog/security-release-symfony-1-4-18-released>`_ (`CVE-2012-2667 <http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-2667>`_)
5962
* February 24, 2012: `Security Release: Symfony 2.0.11 released <http://symfony.com/blog/security-release-symfony-2-0-11-released>`_
6063
* November 16, 2011: `Security Release: Symfony 2.0.6 <http://symfony.com/blog/security-release-symfony-2-0-6>`_
6164
* March 21, 2011: `symfony 1.3.10 and 1.4.10: security releases <http://symfony.com/blog/symfony-1-3-10-and-1-4-10-security-releases>`_

contributing/code/standards.rst

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ documents.
1515
Since a picture - or some code - is worth a thousand words, here's a short
1616
example containing most features described below:
1717

18-
.. code-block:: php
18+
.. code-block:: html+php
1919

2020
<?php
2121

@@ -40,7 +40,7 @@ example containing most features described below:
4040
private $fooBar;
4141

4242
/**
43-
* @param string $dummy Some argument description
43+
* @param string $dummyy Some argument description
4444
*/
4545
public function __construct($dummy)
4646
{
@@ -82,17 +82,17 @@ Structure
8282

8383
* Add a single space after each comma delimiter;
8484

85-
* Add a single space around operators (`==`, `&&`, ...);
85+
* Add a single space around operators (``==``, ``&&``, ...);
8686

87-
* Add a blank line before `return` statements, unless the return is alone
88-
inside a statement-group (like an `if` statement);
87+
* Add a blank line before ``return`` statements, unless the return is alone
88+
inside a statement-group (like an ``if`` statement);
8989

9090
* Use braces to indicate control structure body regardless of the number of
9191
statements it contains;
9292

9393
* Define one class per file - this does not apply to private helper classes
9494
that are not intended to be instantiated from the outside and thus are not
95-
concerned by the PSR-0 standard;
95+
concerned by the `PSR-0`_ standard;
9696

9797
* Declare class properties before methods;
9898

@@ -108,9 +108,15 @@ Naming Conventions
108108

109109
* Use namespaces for all classes;
110110

111-
* Abstract classes are often prefixed with `Abstract`;
111+
* Prefix abstract classes with ``Abstract``. Please note some early Symfony2 classes
112+
do not follow this convention and have not been renamed for backward compatibility
113+
reasons. However all new abstract classes must follow this naming convention;
114+
115+
* Suffix interfaces with ``Interface``;
116+
117+
* Suffix traits with ``Trait``;
112118

113-
* Suffix interfaces with `Interface`;
119+
* Suffix exceptions with ``Exception``;
114120

115121
* Use alphanumeric characters and underscores for file names;
116122

@@ -122,9 +128,9 @@ Documentation
122128

123129
* Add PHPDoc blocks for all classes, methods, and functions;
124130

125-
* Omit the `@return` tag if the method does not return anything;
131+
* Omit the ``@return`` tag if the method does not return anything;
126132

127-
* The `@package` and `@subpackage` annotations are not used.
133+
* The ``@package`` and ``@subpackage`` annotations are not used.
128134

129135
License
130136
-------

contributing/documentation/format.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,6 @@ The current list of supported formats are the following:
108108
+-----------------+-------------+
109109
| html+jinja | Twig |
110110
+-----------------+-------------+
111-
| jinja+html | Twig |
112-
+-----------------+-------------+
113-
| php+html | PHP |
114-
+-----------------+-------------+
115111
| html+php | PHP |
116112
+-----------------+-------------+
117113
| ini | INI |

cookbook/bundles/best_practices.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ The end user can provide values in any configuration file:
263263
264264
.. code-block:: ini
265265
266-
; app/config/config.ini
266+
; app/config/parameters.ini
267267
[parameters]
268268
acme_hello.email.from = fabien@example.com
269269

cookbook/configuration/external_parameters.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,18 @@ The container also has support for setting PHP constants as parameters. To
9999
take advantage of this feature, map the name of your constant to a parameter
100100
key, and define the type as ``constant``.
101101

102-
.. code-block:: xml
102+
.. code-block:: xml
103103
104-
<?xml version="1.0" encoding="UTF-8"?>
104+
<?xml version="1.0" encoding="UTF-8"?>
105105
106-
<container xmlns="http://symfony.com/schema/dic/services"
107-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
106+
<container xmlns="http://symfony.com/schema/dic/services"
107+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
108108
109-
<parameters>
110-
<parameter key="global.constant.value" type="constant">GLOBAL_CONSTANT</parameter>
111-
<parameter key="my_class.constant.value" type="constant">My_Class::CONSTANT_NAME</parameter>
112-
</parameters>
113-
</container>
109+
<parameters>
110+
<parameter key="global.constant.value" type="constant">GLOBAL_CONSTANT</parameter>
111+
<parameter key="my_class.constant.value" type="constant">My_Class::CONSTANT_NAME</parameter>
112+
</parameters>
113+
</container>
114114
115115
.. note::
116116

cookbook/configuration/pdo_session_storage.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,22 +136,22 @@ parameter.ini by referencing the database-related parameters defined there:
136136
pdo:
137137
class: PDO
138138
arguments:
139-
- "mysql:dbname=%database_name%"
139+
- "mysql:host=%database_host%;port=%database_port%;dbname=%database_name%"
140140
- %database_user%
141141
- %database_password%
142142
143143
.. code-block:: xml
144144
145145
<service id="pdo" class="PDO">
146-
<argument>mysql:dbname=%database_name%</argument>
146+
<argument>mysql:host=%database_host%;port=%database_port%;dbname=%database_name%</argument>
147147
<argument>%database_user%</argument>
148148
<argument>%database_password%</argument>
149149
</service>
150150
151151
.. code-block:: php
152152
153153
$pdoDefinition = new Definition('PDO', array(
154-
'mysql:dbname=%database_name%',
154+
'mysql:host=%database_host%;port=%database_port%;dbname=%database_name%',
155155
'%database_user%',
156156
'%database_password%',
157157
));

cookbook/doctrine/file_uploads.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ The following controller shows you how to handle the entire process::
176176

177177
When writing the template, don't forget to set the ``enctype`` attribute:
178178

179-
.. code-block:: html+php
179+
.. code-block:: html+jinja
180180

181181
<h1>Upload File</h1>
182182

cookbook/doctrine/registration_form.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ Start by creating a simple class which represents the "registration"::
151151
{
152152
/**
153153
* @Assert\Type(type="Acme\AccountBundle\Entity\User")
154+
* @Assert\Valid()
154155
*/
155156
protected $user;
156157

cookbook/form/form_collections.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,8 @@ into new ``Tag`` objects and added to the ``tags`` property of the ``Task`` obje
425425
and call ``$em->persist($tag)`` on each, you'll receive an error from
426426
Doctrine:
427427

428-
A new entity was found through the relationship 'Acme\TaskBundle\Entity\Task#tags' that was not configured to cascade persist operations for entity...
428+
A new entity was found through the relationship `Acme\TaskBundle\Entity\Task#tags`
429+
that was not configured to cascade persist operations for entity...
429430

430431
To fix this, you may choose to "cascade" the persist operation automatically
431432
from the ``Task`` object to any related tags. To do this, add the ``cascade``

cookbook/map.rst.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
* **Deployment**
4343

44-
* :doc:`/cookbook/deployment-tools`
44+
* :doc:`/cookbook/deployment-tools`
4545

4646
* :doc:`/cookbook/doctrine/index`
4747

cookbook/security/entity_provider.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ For more details on each of these, see :class:`Symfony\\Component\\Security\\Cor
200200
Below is an export of my ``User`` table from MySQL. For details on how to
201201
create user records and encode their password, see :ref:`book-security-encoding-user-password`.
202202

203-
.. code-block:: text
203+
.. code-block:: bash
204204
205-
mysql> select * from user;
205+
$ mysql> select * from user;
206206
+----+----------+----------------------------------+------------------------------------------+--------------------+-----------+
207207
| id | username | salt | password | email | is_active |
208208
+----+----------+----------------------------------+------------------------------------------+--------------------+-----------+

cookbook/symfony1.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,11 @@ a bundle. With the help of a console command, the ``Resources/public/``
9090
directory of each bundle is copied or symbolically-linked to the ``web/bundles/``
9191
directory. This allows you to keep assets organized inside your bundle, but
9292
still make them available to the public. To make sure that all bundles are
93-
available, run the following command::
93+
available, run the following command:
9494

95-
php app/console assets:install web
95+
.. code-block:: bash
96+
97+
$ php app/console assets:install web
9698
9799
.. note::
98100

@@ -174,16 +176,16 @@ Using the Console
174176
In symfony1, the console is in the root directory of your project and is
175177
called ``symfony``:
176178

177-
.. code-block:: text
179+
.. code-block:: bash
178180
179-
php symfony
181+
$ php symfony
180182
181183
In Symfony2, the console is now in the app sub-directory and is called
182184
``console``:
183185

184-
.. code-block:: text
186+
.. code-block:: bash
185187
186-
php app/console
188+
$ php app/console
187189
188190
Applications
189191
------------
@@ -251,7 +253,9 @@ In symfony1, the ``routing.yml`` and ``app.yml`` configuration files were
251253
automatically loaded inside any plugin. In Symfony2, routing and application
252254
configuration inside a bundle must be included manually. For example, to
253255
include a routing resource from a bundle called ``AcmeDemoBundle``, you can
254-
do the following::
256+
do the following:
257+
258+
.. code-block:: yaml
255259
256260
# app/config/routing.yml
257261
_hello:
@@ -301,4 +305,4 @@ primarily to configure objects that you can use. For more information, see
301305
the chapter titled ":doc:`/book/service_container`".
302306

303307
.. _`Symfony2 Standard`: https://github.com/symfony/symfony-standard
304-
.. _`Composer`: http://getcomposer.org
308+
.. _`Composer`: http://getcomposer.org

cookbook/templating/global_variables.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ Now, the variable ``ga_tracking`` is available in all Twig templates:
2424
It's that easy! You can also take advantage of the built-in :ref:`book-service-container-parameters`
2525
system, which lets you isolate or reuse the value:
2626

27-
.. code-block:: ini
27+
.. code-block:: yaml
2828
29-
; app/config/parameters.yml
30-
[parameters]
29+
# app/config/parameters.yml
30+
parameters:
3131
ga_tracking: UA-xxxxx-x
3232
3333
.. code-block:: yaml

cookbook/testing/bootstrap.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ with ``tests.bootstrap.php``:
2525
.. code-block:: xml
2626
2727
<!-- app/phpunit.xml.dist -->
28-
bootstrap = "tests.bootstrap.php"
28+
29+
<!-- ... -->
30+
<phpunit
31+
...
32+
bootstrap = "tests.bootstrap.php"
33+
>
2934
3035
Now, you can define in your ``phpunit.xml.dist`` file which environment you want the
3136
cache to be cleared:

cookbook/workflow/_vendor_deps.rst.inc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,32 @@ allows you to pin each library to an **exact** version. In fact, if a ``composer
2222
file exists, the versions inside will override those in ``composer.json``.
2323
To upgrade your libraries to new versions, run ``php composer.phar update``.
2424

25+
.. tip::
26+
27+
If you want to add a new package to your application, modify the ``composer.json``
28+
file:
29+
30+
.. code-block:: json
31+
32+
{
33+
"require": {
34+
...
35+
"doctrine/doctrine-fixtures-bundle": "@dev"
36+
}
37+
}
38+
39+
and then execute the ``update`` command for this specific package, i.e.:
40+
41+
.. code-block:: bash
42+
43+
$ php composer.phar update doctrine/doctrine-fixtures-bundle
44+
45+
You can also combine both steps into a single command:
46+
47+
.. code-block:: bash
48+
49+
$ php composer.phar require doctrine/doctrine-fixtures-bundle:@dev
50+
2551
To learn more about Composer, see `GetComposer.org`_:
2652

2753
It's important to realize that these vendor libraries are *not* actually part

images/book/doctrine_image_1.png

10.4 KB
Loading

images/book/doctrine_image_3.png

37.5 KB
Loading

images/request-flow.png

-2.74 KB
Loading

reference/configuration/doctrine.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
single: Doctrine; ORM configuration reference
33
single: Configuration reference; Doctrine ORM
44

5-
Configuration Reference
6-
=======================
5+
Doctrine Configuration Reference
6+
================================
77

88
.. configuration-block::
99

0 commit comments

Comments
 (0)