Skip to content

Ifdattic's fixes #4861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jan 25, 2015
Merged
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 @@ -309,7 +314,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 @@ -376,7 +382,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 @@ -456,13 +463,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 @@ -514,7 +524,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 @@ -681,7 +692,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