Skip to content

Commit

Permalink
bug #4861 Ifdattic's fixes (ifdattic)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.3 branch.

Discussion
----------

Ifdattic's fixes

This combines most of @ifdattic's fixes in one PR, to make it easier to merge and review.

| Q   | A
| --- | ---
| Doc fix? | yes
| New docs? | no
| Applies to | all
| Fixed tickets | -

Commits
-------

a2e0a27 Update gmail.rst
2980cad Update cloud.rst
5e7846e Update spool.rst
ece3904 Update environments.rst
80fc665 Update configuration_organization.rst
07aefea Update error_pages.rst
7c9c7ad Update apply_to_option.rst
ff9f315 Update asset_management.rst
8d9a47c Update prepend_extension.rst
04ae7c2 Update configuration.rst
76b23af Update translation.rst
4eb8b64 Update doctrine.rst
8b6cd17 Update testing.rst
0d059ff Update http_cache.rst
b4ee5fb Update security.rst
a6a3b9c Update inheritance.rst
  • Loading branch information
weaverryan committed Jan 25, 2015
2 parents 9a6d7b9 + a2e0a27 commit a6b7d72
Show file tree
Hide file tree
Showing 16 changed files with 152 additions and 97 deletions.
28 changes: 18 additions & 10 deletions book/doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ information. By convention, this information is usually configured in an
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:doctrine="http://symfony.com/schema/dic/doctrine"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/doctrine http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd">
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/doctrine
http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd">
<doctrine:config>
<doctrine:dbal
Expand Down Expand Up @@ -165,8 +167,10 @@ for you:
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:doctrine="http://symfony.com/schema/dic/doctrine"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/doctrine http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd">
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/doctrine
http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd">
<doctrine:config>
<doctrine:dbal
Expand Down Expand Up @@ -426,6 +430,7 @@ mapping information) of a bundle or an entire namespace:
# generates all entities in the AppBundle
$ php app/console doctrine:generate:entities AppBundle
# generates all entities of bundles in the Acme namespace
$ php app/console doctrine:generate:entities Acme
Expand Down Expand Up @@ -864,7 +869,7 @@ You can use this new method just like the default finder methods of the reposito

$em = $this->getDoctrine()->getManager();
$products = $em->getRepository('AppBundle:Product')
->findAllOrderedByName();
->findAllOrderedByName();

.. note::

Expand All @@ -884,7 +889,9 @@ you can let Doctrine create the class for you.

.. code-block:: bash
$ php app/console doctrine:generate:entity --entity="AppBundle:Category" --fields="name:string(255)"
$ php app/console doctrine:generate:entity \
--entity="AppBundle:Category" \
--fields="name:string(255)"
This task generates the ``Category`` entity for you, with an ``id`` field,
a ``name`` field and the associated getter and setter functions.
Expand Down Expand Up @@ -929,7 +936,8 @@ To relate the ``Category`` and ``Product`` entities, start by creating a
products:
targetEntity: Product
mappedBy: category
# don't forget to init the collection in the __construct() method of the entity
# don't forget to init the collection in the __construct() method
# of the entity
.. code-block:: xml
Expand Down Expand Up @@ -1038,7 +1046,7 @@ methods for you:

.. code-block:: bash
$ php app/console doctrine:generate:entities Acme
$ php app/console doctrine:generate:entities AppBundle
Ignore the Doctrine metadata for a moment. You now have two classes - ``Category``
and ``Product`` with a natural one-to-many relationship. The ``Category``
Expand Down Expand Up @@ -1151,7 +1159,7 @@ the category (i.e. it's "lazily loaded").

You can also query in the other direction::

public function showProductAction($id)
public function showProductsAction($id)
{
$category = $this->getDoctrine()
->getRepository('AppBundle:Category')
Expand Down Expand Up @@ -1372,7 +1380,7 @@ list of all available types and more information, see Doctrine's
Summary
-------

With Doctrine, you can focus on your objects and how they're useful in your
With Doctrine, you can focus on your objects and how they're used in your
application and worry about database persistence second. This is because
Doctrine allows you to use any PHP object to hold your data and relies on
mapping metadata information to map an object's data to a particular database
Expand Down
19 changes: 13 additions & 6 deletions book/http_cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ If one content corresponds to one URL, the ``PURGE`` model works well.
You send a request to the cache proxy with the HTTP method ``PURGE`` (using
the word "PURGE" is a convention, technically this can be any string) instead
of ``GET`` and make the cache proxy detect this and remove the data from the
cache instead of going to Symfony to get a response.
cache instead of going to the application to get a response.

Here is how you can configure the Symfony reverse proxy to support the
``PURGE`` HTTP method::
Expand All @@ -877,7 +877,10 @@ Here is how you can configure the Symfony reverse proxy to support the
}

if ('127.0.0.1' !== $request->getClientIp()) {
return new Response('Invalid HTTP method', Response::HTTP_BAD_REQUEST);
return new Response(
'Invalid HTTP method',
Response::HTTP_BAD_REQUEST
);
}

$response = new Response();
Expand Down Expand Up @@ -987,8 +990,10 @@ First, to use ESI, be sure to enable it in your application configuration:
<container xmlns="http://symfony.com/schema/dic/symfony"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:framework="http://symfony.com/schema/dic/symfony"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
<framework:config>
<!-- ... -->
Expand Down Expand Up @@ -1115,8 +1120,10 @@ that must be enabled in your configuration:
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:doctrine="http://symfony.com/schema/dic/framework"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
<!-- ... -->
<framework:config>
Expand Down
32 changes: 22 additions & 10 deletions book/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,17 @@ configuration looks like this:
<srv:container xmlns="http://symfony.com/schema/dic/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:srv="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">
<config>
<provider name="in_memory">
<memory />
</provider>
<firewall name="dev" pattern="^/(_(profiler|wdt)|css|images|js)/" security=false />
<firewall name="dev"
pattern="^/(_(profiler|wdt)|css|images|js)/"
security=false />
<firewall name="default">
<anonymous />
Expand Down Expand Up @@ -145,7 +148,8 @@ To activate this, add the ``http_basic`` key under your firewall:
<srv:container xmlns="http://symfony.com/schema/dic/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:srv="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">
<config>
<!-- ... -->
Expand Down Expand Up @@ -216,7 +220,8 @@ user to be logged in to access this URL:
<srv:container xmlns="http://symfony.com/schema/dic/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:srv="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">
<config>
<!-- ... -->
Expand Down Expand Up @@ -310,7 +315,8 @@ provider, but it's better to think of it as an "in configuration" provider:
<srv:container xmlns="http://symfony.com/schema/dic/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:srv="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">
<config>
<provider name="in_memory">
Expand Down Expand Up @@ -377,7 +383,8 @@ To fix this, add an ``encoders`` key:
<srv:container xmlns="http://symfony.com/schema/dic/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:srv="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">
<config>
<!-- ... -->
Expand Down Expand Up @@ -458,13 +465,16 @@ else, you'll want to encode their passwords. The best algorithm to use is
<srv:container xmlns="http://symfony.com/schema/dic/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:srv="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">
<config>
<!-- ... -->
<encoder class="Symfony\Component\Security\Core\User\User"
algorithm="bcrypt" cost="12" />
algorithm="bcrypt"
cost="12" />
<!-- ... -->
</config>
</srv:container>
Expand Down Expand Up @@ -516,7 +526,8 @@ like this:
<srv:container xmlns="http://symfony.com/schema/dic/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:srv="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">
<config>
<provider name="in_memory">
Expand Down Expand Up @@ -683,7 +694,8 @@ URL pattern. You saw this earlier, where anything matching the regular expressio
<srv:container xmlns="http://symfony.com/schema/dic/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:srv="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">
<config>
<!-- ... -->
Expand Down
15 changes: 10 additions & 5 deletions book/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,8 @@ narrow down your node selection by chaining the method calls::
return false;
}
})
->first();
->first()
;

.. tip::

Expand Down Expand Up @@ -720,8 +721,10 @@ configuration option:
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:swiftmailer="http://symfony.com/schema/dic/swiftmailer"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd">
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/swiftmailer
http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd">
<!-- ... -->
<swiftmailer:config disable-delivery="true" />
Expand Down Expand Up @@ -784,8 +787,9 @@ machine only.
the ``app/phpunit.xml`` file.

By default, only the tests from your own custom bundles stored in the standard
directories ``src/*/*Bundle/Tests`` or ``src/*/Bundle/*Bundle/Tests`` are run
by the ``phpunit`` command, as configured in the ``app/phpunit.xml.dist`` file:
directories ``src/*/*Bundle/Tests``, ``src/*/Bundle/*Bundle/Tests``,
``src/*Bundle/Tests`` are run by the ``phpunit`` command, as configured
in the ``app/phpunit.xml.dist`` file:

.. code-block:: xml
Expand All @@ -796,6 +800,7 @@ by the ``phpunit`` command, as configured in the ``app/phpunit.xml.dist`` file:
<testsuite name="Project Test Suite">
<directory>../src/*/*Bundle/Tests</directory>
<directory>../src/*/Bundle/*Bundle/Tests</directory>
<directory>../src/*Bundle/Tests</directory>
</testsuite>
</testsuites>
<!-- ... -->
Expand Down
Loading

0 comments on commit a6b7d72

Please sign in to comment.