Skip to content

Commit

Permalink
Merge branch '2.4'
Browse files Browse the repository at this point in the history
Conflicts:
	cookbook/form/dynamic_form_modification.rst
  • Loading branch information
weaverryan committed Dec 23, 2013
2 parents 2a10a46 + 14b0c47 commit 1401372
Show file tree
Hide file tree
Showing 82 changed files with 422 additions and 316 deletions.
6 changes: 3 additions & 3 deletions README.markdown
Expand Up @@ -8,9 +8,9 @@ Contributing

>**Note**
>Unless you're documenting a feature that's new to a specific version of Symfony
>(e.g. Symfony 2.3), all pull requests must be based off of the **2.2** branch,
>(e.g. Symfony 2.3), all pull requests must be based off of the **2.2** branch,
>**not** the master or 2.3 branch.
We love contributors! For more information on how you can contribute to the
Symfony documentation, please read
[Contributing to the Documentation](http://symfony.com/doc/current/contributing/documentation/overview.html)
Symfony documentation, please read
[Contributing to the Documentation](http://symfony.com/doc/current/contributing/documentation/overview.html)
2 changes: 1 addition & 1 deletion book/controller.rst
Expand Up @@ -726,7 +726,7 @@ the ``notice`` message:

.. code-block:: html+php

<?php foreach ($view['session']->getFlashBag()->get('notice') as $message): ?>
<?php foreach ($view['session']->getFlash('notice') as $message): ?>
<div class="flash-notice">
<?php echo "<div class='flash-error'>$message</div>" ?>
</div>
Expand Down
2 changes: 1 addition & 1 deletion book/forms.rst
Expand Up @@ -1360,7 +1360,7 @@ form with many ``Product`` sub-forms). This is done by using the ``collection``
field type.
For more information see the ":doc:`/cookbook/form/form_collections`" cookbook
entry and the :doc:`collection </reference/forms/types/collection>` field type reference.
entry and the :doc:`collection </reference/forms/types/collection>` field type reference.
.. index::
single: Forms; Theming
Expand Down
2 changes: 1 addition & 1 deletion book/from_flat_php_to_symfony2.rst
Expand Up @@ -433,7 +433,7 @@ content:
{
"require": {
"symfony/symfony": "2.3.*"
"symfony/symfony": "2.4.*"
},
"autoload": {
"files": ["model.php","controllers.php"]
Expand Down
4 changes: 2 additions & 2 deletions book/http_cache.rst
Expand Up @@ -904,12 +904,12 @@ matter), Symfony2 uses the standard ``render`` helper to configure ESI tags:

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

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

By using the ``esi`` renderer (via the ``render_esi`` Twig function), you
Expand Down
20 changes: 10 additions & 10 deletions book/installation.rst
Expand Up @@ -44,7 +44,7 @@ have curl installed, it's as easy as:

.. code-block:: bash
curl -s https://getcomposer.org/installer | php
$ curl -s https://getcomposer.org/installer | php
.. note::

Expand All @@ -57,7 +57,7 @@ Distribution:

.. code-block:: bash
$ php composer.phar create-project symfony/framework-standard-edition /path/to/webroot/Symfony 2.3.*
$ php composer.phar create-project symfony/framework-standard-edition /path/to/webroot/Symfony 2.4.*
.. tip::

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

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

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

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

.. code-block:: bash
php installer
php composer.phar install
$ php installer
$ php composer.phar install
.. tip::

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

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

Expand Down
16 changes: 8 additions & 8 deletions book/page_creation.rst
Expand Up @@ -42,10 +42,10 @@ also load specific bundles based on the selected environment. For example,
Symfony2 comes with the WebProfilerBundle (described below), enabled only
in the ``dev`` and ``test`` environments.

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

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

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

Because of the autoloader, you never need to worry about using ``include``
Expand Down Expand Up @@ -864,18 +864,18 @@ Default Configuration Dump
~~~~~~~~~~~~~~~~~~~~~~~~~~

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

.. code-block:: text
.. code-block:: bash
app/console config:dump-reference FrameworkBundle
$ app/console config:dump-reference FrameworkBundle
The extension alias (configuration key) can also be used:

.. code-block:: text
.. code-block:: bash
app/console config:dump-reference framework
$ app/console config:dump-reference framework
.. note::

Expand Down
2 changes: 1 addition & 1 deletion book/performance.rst
Expand Up @@ -60,7 +60,7 @@ command line, and might become part of your deploy process:

.. code-block:: bash
php composer.phar dump-autoload --optimize
$ php composer.phar dump-autoload --optimize
Internally, this builds the big class map array in ``vendor/composer/autoload_classmap.php``.

Expand Down
8 changes: 4 additions & 4 deletions book/propel.rst
Expand Up @@ -134,7 +134,7 @@ Creating the Database Tables/Schema
Now you have a usable ``Product`` class and all you need to persist it. Of
course, you don't yet have the corresponding ``product`` table in your
database. Fortunately, Propel can automatically create all the database tables
needed for every known model in your application. To do this, run:
needed for every known model in your application. To do this, run:

.. code-block:: bash
Expand All @@ -153,7 +153,7 @@ Persisting Objects to the Database
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

Expand Down Expand Up @@ -406,7 +406,7 @@ Fetching Related Objects
~~~~~~~~~~~~~~~~~~~~~~~~

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

// ...
Expand Down Expand Up @@ -435,7 +435,7 @@ Lifecycle Callbacks
-------------------

Sometimes, you need to perform an action right before or after an object is
inserted, updated, or deleted. These types of actions are known as "lifecycle"
inserted, updated, or deleted. These types of actions are known as "lifecycle"
callbacks or "hooks", as they're callback methods that you need to execute
during different stages of the lifecycle of an object (e.g. the object is
inserted, updated, deleted, etc).
Expand Down
2 changes: 1 addition & 1 deletion book/routing.rst
Expand Up @@ -1244,7 +1244,7 @@ route. With this information, any URL can easily be generated::
:class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller`,
you can use the
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::generateUrl`
method, which call's the router service's
method, which calls the router service's
:method:`Symfony\\Component\\Routing\\Router::generate` method.

In an upcoming section, you'll learn how to generate URLs from inside templates.
Expand Down
57 changes: 2 additions & 55 deletions book/security.rst
Expand Up @@ -902,7 +902,7 @@ the trusted reverse proxy cache.
does not restrict to a specific IP address. Instead, using the ``ip``
key means that the ``access_control`` entry will only match this IP address,
and users accessing it from a different IP address will continue down
the ``acces_control`` list.
the ``access_control`` list.

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

.. tip::

If you have no reasons to separate your ``in_memory`` users from your
``user_db`` users, you can accomplish this even more easily by combining
the two sources into a single provider:

.. configuration-block::

.. code-block:: yaml
# app/config/security.yml
security:
providers:
main_provider:
memory:
users:
foo: { password: test }
entity:
class: Acme\UserBundle\Entity\User,
property: username
.. code-block:: xml
<!-- app/config/security.xml -->
<config>
<provider name=="main_provider">
<memory>
<user name="foo" password="test" />
</memory>
<entity class="Acme\UserBundle\Entity\User"
property="username" />
</provider>
</config>
.. code-block:: php
// app/config/security.php
$container->loadFromExtension('security', array(
'providers' => array(
'main_provider' => array(
'memory' => array(
'users' => array(
'foo' => array('password' => 'test'),
),
),
'entity' => array(
'class' => 'Acme\UserBundle\Entity\User',
'property' => 'username'),
),
),
));
You can also configure the firewall or individual authentication mechanisms
to use a specific provider. Again, unless a provider is specified explicitly,
the first provider is always used:
Expand Down Expand Up @@ -1702,7 +1649,7 @@ Roles

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

Roles are pretty simple, and are basically strings that you can invent and
use as needed (though roles are objects internally). For example, if you
Expand Down
4 changes: 2 additions & 2 deletions book/templating.rst
Expand Up @@ -1076,7 +1076,7 @@ Global Template Variables
-------------------------

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

Imagine the user enters the following code for their name:

.. code-block:: text
.. code-block:: html

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

Expand Down
5 changes: 2 additions & 3 deletions book/testing.rst
Expand Up @@ -485,7 +485,7 @@ Redirecting

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

$crawler = $client->followRedirect();

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

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

Expand Down
2 changes: 1 addition & 1 deletion book/validation.rst
Expand Up @@ -169,7 +169,7 @@ You could also pass the collection of errors into a template.
return $this->render('AcmeBlogBundle:Author:validate.html.twig', array(
'errors' => $errors,
));
}
}
Inside the template, you can output the list of errors exactly as needed:

Expand Down
4 changes: 2 additions & 2 deletions components/class_loader/cache_class_loader.rst
Expand Up @@ -20,8 +20,8 @@ for a class.

.. note::

Both the ``ApcClassLoader`` and the ``XcacheClassLoader`` can be used
to cache Composer's `autoloader`_.
Both the ``ApcClassLoader`` and the ``XcacheClassLoader`` can be used
to cache Composer's `autoloader`_.

ApcClassLoader
--------------
Expand Down
4 changes: 2 additions & 2 deletions components/class_loader/class_loader.rst
Expand Up @@ -28,7 +28,7 @@ is straightforward::
$loader = new ClassLoader();

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

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

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

.. _PEAR: http://pear.php.net/manual/en/standards.naming.php
.. _PSR-0: http://symfony.com/PSR0
.. _PSR-0: http://www.php-fig.org/psr/psr-0/
2 changes: 1 addition & 1 deletion components/class_loader/map_class_loader.rst
Expand Up @@ -36,4 +36,4 @@ an instance of the ``MapClassLoader`` class::
$loader->register();

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

0 comments on commit 1401372

Please sign in to comment.