Skip to content

Commit 1401372

Browse files
committed
Merge branch '2.4'
Conflicts: cookbook/form/dynamic_form_modification.rst
2 parents 2a10a46 + 14b0c47 commit 1401372

File tree

82 files changed

+422
-316
lines changed

Some content is hidden

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

82 files changed

+422
-316
lines changed

README.markdown

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Contributing
88

99
>**Note**
1010
>Unless you're documenting a feature that's new to a specific version of Symfony
11-
>(e.g. Symfony 2.3), all pull requests must be based off of the **2.2** branch,
11+
>(e.g. Symfony 2.3), all pull requests must be based off of the **2.2** branch,
1212
>**not** the master or 2.3 branch.
1313
1414
We love contributors! For more information on how you can contribute to the
15-
Symfony documentation, please read
16-
[Contributing to the Documentation](http://symfony.com/doc/current/contributing/documentation/overview.html)
15+
Symfony documentation, please read
16+
[Contributing to the Documentation](http://symfony.com/doc/current/contributing/documentation/overview.html)

book/controller.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ the ``notice`` message:
726726

727727
.. code-block:: html+php
728728

729-
<?php foreach ($view['session']->getFlashBag()->get('notice') as $message): ?>
729+
<?php foreach ($view['session']->getFlash('notice') as $message): ?>
730730
<div class="flash-notice">
731731
<?php echo "<div class='flash-error'>$message</div>" ?>
732732
</div>

book/forms.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ form with many ``Product`` sub-forms). This is done by using the ``collection``
13601360
field type.
13611361
13621362
For more information see the ":doc:`/cookbook/form/form_collections`" cookbook
1363-
entry and the :doc:`collection </reference/forms/types/collection>` field type reference.
1363+
entry and the :doc:`collection </reference/forms/types/collection>` field type reference.
13641364
13651365
.. index::
13661366
single: Forms; Theming

book/from_flat_php_to_symfony2.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ content:
433433
434434
{
435435
"require": {
436-
"symfony/symfony": "2.3.*"
436+
"symfony/symfony": "2.4.*"
437437
},
438438
"autoload": {
439439
"files": ["model.php","controllers.php"]

book/http_cache.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -904,12 +904,12 @@ matter), Symfony2 uses the standard ``render`` helper to configure ESI tags:
904904

905905
<?php echo $view['actions']->render(
906906
new ControllerReference('...:news', array('max' => 5)),
907-
array('renderer' => 'esi'))
907+
array('strategy' => 'esi'))
908908
?>
909909

910910
<?php echo $view['actions']->render(
911911
$view['router']->generate('latest_news', array('max' => 5), true),
912-
array('renderer' => 'esi'),
912+
array('strategy' => 'esi'),
913913
) ?>
914914

915915
By using the ``esi`` renderer (via the ``render_esi`` Twig function), you

book/installation.rst

+10-10
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ have curl installed, it's as easy as:
4444

4545
.. code-block:: bash
4646
47-
curl -s https://getcomposer.org/installer | php
47+
$ curl -s https://getcomposer.org/installer | php
4848
4949
.. note::
5050

@@ -57,7 +57,7 @@ Distribution:
5757

5858
.. code-block:: bash
5959
60-
$ php composer.phar create-project symfony/framework-standard-edition /path/to/webroot/Symfony 2.3.*
60+
$ php composer.phar create-project symfony/framework-standard-edition /path/to/webroot/Symfony 2.4.*
6161
6262
.. tip::
6363

@@ -104,10 +104,10 @@ one of the following commands (replacing ``###`` with your actual filename):
104104
.. code-block:: bash
105105
106106
# for .tgz file
107-
$ tar zxvf Symfony_Standard_Vendors_2.3.###.tgz
107+
$ tar zxvf Symfony_Standard_Vendors_2.4.###.tgz
108108
109109
# for a .zip file
110-
$ unzip Symfony_Standard_Vendors_2.3.###.zip
110+
$ unzip Symfony_Standard_Vendors_2.4.###.zip
111111
112112
If you've downloaded "without vendors", you'll definitely need to read the
113113
next section.
@@ -135,7 +135,7 @@ Updating Vendors
135135

136136
At this point, you've downloaded a fully-functional Symfony project in which
137137
you'll start to develop your own application. A Symfony project depends on
138-
a number of external libraries. These are downloaded into the `vendor/` directory
138+
a number of external libraries. These are downloaded into the ``vendor/`` directory
139139
of your project via a library called `Composer`_.
140140

141141
Depending on how you downloaded Symfony, you may or may not need to update
@@ -146,7 +146,7 @@ Step 1: Get `Composer`_ (The great new PHP packaging system)
146146

147147
.. code-block:: bash
148148
149-
curl -s http://getcomposer.org/installer | php
149+
$ curl -s http://getcomposer.org/installer | php
150150
151151
Make sure you download ``composer.phar`` in the same folder where
152152
the ``composer.json`` file is located (this is your Symfony project
@@ -169,8 +169,8 @@ Symfony itself - into the ``vendor/`` directory.
169169

170170
.. code-block:: bash
171171
172-
php installer
173-
php composer.phar install
172+
$ php installer
173+
$ php composer.phar install
174174
175175
.. tip::
176176

@@ -231,7 +231,7 @@ If there are any issues, correct them now before moving on.
231231
$ rm -rf app/cache/*
232232
$ rm -rf app/logs/*
233233
234-
$ APACHEUSER=`ps aux | grep -E '[a]pache|[h]ttpd' | grep -v root | head -1 | cut -d\ -f1`
234+
$ APACHEUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data' | grep -v root | head -1 | cut -d\ -f1`
235235
$ sudo chmod +a "$APACHEUSER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
236236
$ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
237237
@@ -246,7 +246,7 @@ If there are any issues, correct them now before moving on.
246246

247247
.. code-block:: bash
248248
249-
$ APACHEUSER=`ps aux | grep -E '[a]pache|[h]ttpd' | grep -v root | head -1 | cut -d\ -f1`
249+
$ APACHEUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data' | grep -v root | head -1 | cut -d\ -f1`
250250
$ sudo setfacl -R -m u:"$APACHEUSER":rwX -m u:`whoami`:rwX app/cache app/logs
251251
$ sudo setfacl -dR -m u:"$APACHEUSER":rwX -m u:`whoami`:rwX app/cache app/logs
252252

book/page_creation.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ also load specific bundles based on the selected environment. For example,
4242
Symfony2 comes with the WebProfilerBundle (described below), enabled only
4343
in the ``dev`` and ``test`` environments.
4444

45-
Symfony2 comes with two web-accessible front controllers: ``app_dev.php``
45+
Symfony2 comes with two web-accessible front controllers: ``app_dev.php``
4646
provides the ``dev`` environment, and ``app.php`` provides the ``prod`` environment.
4747
All web accesses to Symfony2 normally go through one of these front controllers.
48-
(The ``test`` environment is normally only used when running unit tests, and so
48+
(The ``test`` environment is normally only used when running unit tests, and so
4949
doesn't have a dedicated front controller. The console tool also provides a
5050
front controller that can be used with any environment.)
5151

@@ -555,7 +555,7 @@ You'll learn more about each of these directories in later chapters.
555555

556556
When Symfony is loading, a special file - ``vendor/autoload.php`` - is
557557
included. This file is created by Composer and will autoload all
558-
application files living in the `src/` folder as well as all
558+
application files living in the ``src/`` folder as well as all
559559
third-party libraries mentioned in the ``composer.json`` file.
560560

561561
Because of the autoloader, you never need to worry about using ``include``
@@ -864,18 +864,18 @@ Default Configuration Dump
864864
~~~~~~~~~~~~~~~~~~~~~~~~~~
865865

866866
You can dump the default configuration for a bundle in YAML to the console using
867-
the ``config:dump-reference`` command. Here is an example of dumping the default
867+
the ``config:dump-reference`` command. Here is an example of dumping the default
868868
FrameworkBundle configuration:
869869

870-
.. code-block:: text
870+
.. code-block:: bash
871871
872-
app/console config:dump-reference FrameworkBundle
872+
$ app/console config:dump-reference FrameworkBundle
873873
874874
The extension alias (configuration key) can also be used:
875875

876-
.. code-block:: text
876+
.. code-block:: bash
877877
878-
app/console config:dump-reference framework
878+
$ app/console config:dump-reference framework
879879
880880
.. note::
881881

book/performance.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ command line, and might become part of your deploy process:
6060

6161
.. code-block:: bash
6262
63-
php composer.phar dump-autoload --optimize
63+
$ php composer.phar dump-autoload --optimize
6464
6565
Internally, this builds the big class map array in ``vendor/composer/autoload_classmap.php``.
6666

book/propel.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Creating the Database Tables/Schema
134134
Now you have a usable ``Product`` class and all you need to persist it. Of
135135
course, you don't yet have the corresponding ``product`` table in your
136136
database. Fortunately, Propel can automatically create all the database tables
137-
needed for every known model in your application. To do this, run:
137+
needed for every known model in your application. To do this, run:
138138

139139
.. code-block:: bash
140140
@@ -153,7 +153,7 @@ Persisting Objects to the Database
153153
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
154154

155155
Now that you have a ``Product`` object and corresponding ``product`` table,
156-
you're ready to persist data to the database. From inside a controller, this
156+
you're ready to persist data to the database. From inside a controller, this
157157
is pretty easy. Add the following method to the ``DefaultController`` of the
158158
bundle::
159159

@@ -406,7 +406,7 @@ Fetching Related Objects
406406
~~~~~~~~~~~~~~~~~~~~~~~~
407407

408408
When you need to fetch associated objects, your workflow looks just like it did
409-
before. First, fetch a ``$product`` object and then access its related
409+
before. First, fetch a ``$product`` object and then access its related
410410
``Category``::
411411

412412
// ...
@@ -435,7 +435,7 @@ Lifecycle Callbacks
435435
-------------------
436436

437437
Sometimes, you need to perform an action right before or after an object is
438-
inserted, updated, or deleted. These types of actions are known as "lifecycle"
438+
inserted, updated, or deleted. These types of actions are known as "lifecycle"
439439
callbacks or "hooks", as they're callback methods that you need to execute
440440
during different stages of the lifecycle of an object (e.g. the object is
441441
inserted, updated, deleted, etc).

book/routing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ route. With this information, any URL can easily be generated::
12441244
:class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller`,
12451245
you can use the
12461246
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::generateUrl`
1247-
method, which call's the router service's
1247+
method, which calls the router service's
12481248
:method:`Symfony\\Component\\Routing\\Router::generate` method.
12491249

12501250
In an upcoming section, you'll learn how to generate URLs from inside templates.

book/security.rst

+2-55
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ the trusted reverse proxy cache.
902902
does not restrict to a specific IP address. Instead, using the ``ip``
903903
key means that the ``access_control`` entry will only match this IP address,
904904
and users accessing it from a different IP address will continue down
905-
the ``acces_control`` list.
905+
the ``access_control`` list.
906906

907907
Here is an example of how you might secure all ESI routes that start with a
908908
given prefix, ``/esi``, from outside access:
@@ -1589,59 +1589,6 @@ Now, all authentication mechanisms will use the ``chain_provider``, since
15891589
it's the first specified. The ``chain_provider`` will, in turn, try to load
15901590
the user from both the ``in_memory`` and ``user_db`` providers.
15911591

1592-
.. tip::
1593-
1594-
If you have no reasons to separate your ``in_memory`` users from your
1595-
``user_db`` users, you can accomplish this even more easily by combining
1596-
the two sources into a single provider:
1597-
1598-
.. configuration-block::
1599-
1600-
.. code-block:: yaml
1601-
1602-
# app/config/security.yml
1603-
security:
1604-
providers:
1605-
main_provider:
1606-
memory:
1607-
users:
1608-
foo: { password: test }
1609-
entity:
1610-
class: Acme\UserBundle\Entity\User,
1611-
property: username
1612-
1613-
.. code-block:: xml
1614-
1615-
<!-- app/config/security.xml -->
1616-
<config>
1617-
<provider name=="main_provider">
1618-
<memory>
1619-
<user name="foo" password="test" />
1620-
</memory>
1621-
1622-
<entity class="Acme\UserBundle\Entity\User"
1623-
property="username" />
1624-
</provider>
1625-
</config>
1626-
1627-
.. code-block:: php
1628-
1629-
// app/config/security.php
1630-
$container->loadFromExtension('security', array(
1631-
'providers' => array(
1632-
'main_provider' => array(
1633-
'memory' => array(
1634-
'users' => array(
1635-
'foo' => array('password' => 'test'),
1636-
),
1637-
),
1638-
'entity' => array(
1639-
'class' => 'Acme\UserBundle\Entity\User',
1640-
'property' => 'username'),
1641-
),
1642-
),
1643-
));
1644-
16451592
You can also configure the firewall or individual authentication mechanisms
16461593
to use a specific provider. Again, unless a provider is specified explicitly,
16471594
the first provider is always used:
@@ -1702,7 +1649,7 @@ Roles
17021649

17031650
The idea of a "role" is key to the authorization process. Each user is assigned
17041651
a set of roles and then each resource requires one or more roles. If the user
1705-
has the required roles, access is granted. Otherwise access is denied.
1652+
has any one of the required roles, access is granted. Otherwise access is denied.
17061653

17071654
Roles are pretty simple, and are basically strings that you can invent and
17081655
use as needed (though roles are objects internally). For example, if you

book/templating.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ Global Template Variables
10761076
-------------------------
10771077

10781078
During each request, Symfony2 will set a global template variable ``app``
1079-
in both Twig and PHP template engines by default. The ``app`` variable
1079+
in both Twig and PHP template engines by default. The ``app`` variable
10801080
is a :class:`Symfony\\Bundle\\FrameworkBundle\\Templating\\GlobalVariables`
10811081
instance which will give you access to some application specific variables
10821082
automatically:
@@ -1349,7 +1349,7 @@ this classic example:
13491349

13501350
Imagine the user enters the following code for their name:
13511351

1352-
.. code-block:: text
1352+
.. code-block:: html
13531353

13541354
<script>alert('hello!')</script>
13551355

book/testing.rst

+2-3
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ Redirecting
485485

486486
When a request returns a redirect response, the client does not follow
487487
it automatically. You can examine the response and force a redirection
488-
afterwards with the ``followRedirect()`` method::
488+
afterwards with the ``followRedirect()`` method::
489489

490490
$crawler = $client->followRedirect();
491491

@@ -581,8 +581,7 @@ The Crawler can extract information from the nodes::
581581
$info = $crawler->extract(array('_text', 'href'));
582582

583583
// Executes a lambda for each node and return an array of results
584-
$data = $crawler->each(function ($node, $i)
585-
{
584+
$data = $crawler->each(function ($node, $i) {
586585
return $node->attr('href');
587586
});
588587

book/validation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ You could also pass the collection of errors into a template.
169169
return $this->render('AcmeBlogBundle:Author:validate.html.twig', array(
170170
'errors' => $errors,
171171
));
172-
}
172+
}
173173
174174
Inside the template, you can output the list of errors exactly as needed:
175175

components/class_loader/cache_class_loader.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ for a class.
2020

2121
.. note::
2222

23-
Both the ``ApcClassLoader`` and the ``XcacheClassLoader`` can be used
24-
to cache Composer's `autoloader`_.
23+
Both the ``ApcClassLoader`` and the ``XcacheClassLoader`` can be used
24+
to cache Composer's `autoloader`_.
2525

2626
ApcClassLoader
2727
--------------

components/class_loader/class_loader.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ is straightforward::
2828
$loader = new ClassLoader();
2929

3030
// to enable searching the include path (eg. for PEAR packages)
31-
$loader->useIncludePath(true);
31+
$loader->setUseIncludePath(true);
3232

3333
// ... register namespaces and prefixes here - see below
3434

@@ -78,4 +78,4 @@ or one of its children, the autoloader will first look for the class under the
7878
of the prefix registrations is significant in this case.
7979

8080
.. _PEAR: http://pear.php.net/manual/en/standards.naming.php
81-
.. _PSR-0: http://symfony.com/PSR0
81+
.. _PSR-0: http://www.php-fig.org/psr/psr-0/

components/class_loader/map_class_loader.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ an instance of the ``MapClassLoader`` class::
3636
3737
$loader->register();
3838

39-
.. _PSR-0: http://symfony.com/PSR0
39+
.. _PSR-0: http://www.php-fig.org/psr/psr-0/

0 commit comments

Comments
 (0)