Skip to content

Commit

Permalink
Merge branch '2.8' into 3.0
Browse files Browse the repository at this point in the history
Conflicts:
	book/page_creation.rst
	cookbook/deployment/platformsh.rst
	cookbook/symfony1.rst
  • Loading branch information
xabbuh committed Dec 9, 2015
2 parents 8c17033 + 78d11d8 commit 8d21262
Show file tree
Hide file tree
Showing 52 changed files with 138 additions and 143 deletions.
2 changes: 1 addition & 1 deletion best_practices/business-logic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ the class namespace as a parameter:
services:
app.slugger:
class: "%slugger.class%"
class: '%slugger.class%'
This practice is cumbersome and completely unnecessary for your own services:

Expand Down
2 changes: 1 addition & 1 deletion best_practices/controllers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ configuration to the main routing configuration file:
# app/config/routing.yml
app:
resource: "@AppBundle/Controller/"
resource: '@AppBundle/Controller/'
type: annotation
This configuration will load annotations from any controller stored inside the
Expand Down
10 changes: 5 additions & 5 deletions book/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ format you prefer:
- { resource: security.yml }
framework:
secret: "%secret%"
router: { resource: "%kernel.root_dir%/config/routing.yml" }
secret: '%secret%'
router: { resource: '%kernel.root_dir%/config/routing.yml' }
# ...
# Twig Configuration
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'
# ...
Expand Down Expand Up @@ -226,7 +226,7 @@ the configuration file for the ``dev`` environment.
- { resource: config.yml }
framework:
router: { resource: "%kernel.root_dir%/config/routing_dev.yml" }
router: { resource: '%kernel.root_dir%/config/routing_dev.yml' }
profiler: { only_exceptions: false }
# ...
Expand Down
12 changes: 6 additions & 6 deletions book/doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ information. By convention, this information is usually configured in an
# app/config/config.yml
doctrine:
dbal:
driver: "%database_driver%"
host: "%database_host%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
driver: '%database_driver%'
host: '%database_host%'
dbname: '%database_name%'
user: '%database_user%'
password: '%database_password%'
.. code-block:: xml
Expand Down Expand Up @@ -162,7 +162,7 @@ for you:
doctrine:
dbal:
driver: pdo_sqlite
path: "%kernel.root_dir%/sqlite.db"
path: '%kernel.root_dir%/sqlite.db'
charset: UTF8
.. code-block:: xml
Expand Down
2 changes: 1 addition & 1 deletion book/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ controller::

$form->handleRequest($request);

if ($form->isValid()) {
if ($form->isSubmitted() && $form->isValid()) {
// ... perform some action, such as saving the task to the database

return $this->redirectToRoute('task_success');
Expand Down
6 changes: 0 additions & 6 deletions book/from_flat_php_to_symfony2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ the code that prepares the HTML "presentation":

.. code-block:: html+php

<?php
// index.php
$link = mysql_connect('localhost', 'myuser', 'mypassword');
mysql_select_db('blog_db', $link);
Expand Down Expand Up @@ -146,7 +145,6 @@ of the application are isolated in a new file called ``model.php``:

.. code-block:: html+php

<?php
// model.php
function open_database_connection()
{
Expand Down Expand Up @@ -188,7 +186,6 @@ The controller (``index.php``) is now very simple:

.. code-block:: html+php

<?php
require_once 'model.php';

$posts = get_all_posts();
Expand Down Expand Up @@ -280,7 +277,6 @@ page:

.. code-block:: html+php

<?php
require_once 'model.php';

$post = get_post_by_id($_GET['id']);
Expand Down Expand Up @@ -361,7 +357,6 @@ on the requested URI:

.. code-block:: html+php

<?php
// index.php

// load and initialize any global libraries
Expand Down Expand Up @@ -464,7 +459,6 @@ the HTTP response being returned. Use them to improve the blog:

.. code-block:: html+php

<?php
// index.php
require_once 'vendor/autoload.php';

Expand Down
5 changes: 2 additions & 3 deletions book/http_fundamentals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ known as HTTP headers. For example, one important HTTP response header is
``Content-Type``. The body of the same resource could be returned in multiple
different formats like HTML, XML, or JSON and the ``Content-Type`` header uses
Internet Media Types like ``text/html`` to tell the client which format is
being returned. A list of common media types can be found on Wikipedia's
`List of common media types`_ article.
being returned. You can see a `list of common media types`_ from IANA.

Many other headers exist, some of which are very powerful. For example, certain
headers can be used to create a powerful caching system.
Expand Down Expand Up @@ -578,6 +577,6 @@ sensible defaults. For more advanced users, the sky is the limit.
.. _`Live HTTP Headers`: https://addons.mozilla.org/en-US/firefox/addon/live-http-headers/
.. _`List of HTTP status codes`: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
.. _`List of HTTP header fields`: https://en.wikipedia.org/wiki/List_of_HTTP_header_fields
.. _`List of common media types`: https://www.iana.org/assignments/media-types/media-types.xhtml
.. _`list of common media types`: https://www.iana.org/assignments/media-types/media-types.xhtml
.. _`Validator`: https://github.com/symfony/validator
.. _`Swift Mailer`: http://swiftmailer.org/
19 changes: 9 additions & 10 deletions book/page_creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ a method inside of it that will be executed when someone goes to ``/lucky/number
// src/AppBundle/Controller/LuckyController.php
namespace AppBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Response;

class LuckyController extends Controller
class LuckyController
{
/**
* @Route("/lucky/number")
Expand Down Expand Up @@ -104,7 +103,7 @@ Just add a second method to ``LuckyController``::
// src/AppBundle/Controller/LuckyController.php

// ...
class LuckyController extends Controller
class LuckyController
{
// ...

Expand Down Expand Up @@ -137,7 +136,7 @@ You can even shorten this with the handy :class:`Symfony\\Component\\HttpFoundat
// --> don't forget this new use statement
use Symfony\Component\HttpFoundation\JsonResponse;

class LuckyController extends Controller
class LuckyController
{
// ...

Expand Down Expand Up @@ -170,7 +169,7 @@ at the end:
// src/AppBundle/Controller/LuckyController.php
// ...
class LuckyController extends Controller
class LuckyController
{
/**
* @Route("/lucky/number/{count}")
Expand Down Expand Up @@ -224,7 +223,7 @@ The best part is that you can access this value and use it in your controller::
// src/AppBundle/Controller/LuckyController.php
// ...

class LuckyController extends Controller
class LuckyController
{

/**
Expand Down Expand Up @@ -489,14 +488,14 @@ is ``app/config/config.yml``:
# ...
framework:
secret: "%secret%"
secret: '%secret%'
router:
resource: "%kernel.root_dir%/config/routing.yml"
resource: '%kernel.root_dir%/config/routing.yml'
# ...
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'
# ...
Expand Down
8 changes: 4 additions & 4 deletions book/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ file:
# app/config/config.yml
framework:
# ...
router: { resource: "%kernel.root_dir%/config/routing.yml" }
router: { resource: '%kernel.root_dir%/config/routing.yml' }
.. code-block:: xml
Expand Down Expand Up @@ -1257,7 +1257,7 @@ configuration:
# app/config/routing.yml
app:
resource: "@AppBundle/Controller/"
resource: '@AppBundle/Controller/'
type: annotation # required to enable the Annotation reader for this resource
.. code-block:: xml
Expand Down Expand Up @@ -1308,7 +1308,7 @@ directory are parsed and put into the routing.
# app/config/routing.yml
app:
resource: "@AcmeOtherBundle/Resources/config/routing.yml"
resource: '@AcmeOtherBundle/Resources/config/routing.yml'
.. code-block:: xml
Expand Down Expand Up @@ -1347,7 +1347,7 @@ suppose you want to prefix all routes in the AppBundle with ``/site`` (e.g.
# app/config/routing.yml
app:
resource: "@AppBundle/Controller/"
resource: '@AppBundle/Controller/'
type: annotation
prefix: /site
Expand Down
8 changes: 4 additions & 4 deletions book/service_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ parameter and uses it in the service definition.
# app/config/parameters.yml
parameters:
# This will be parsed as string "@securepass"
mailer_password: "@@securepass"
# This will be parsed as string '@securepass'
mailer_password: '@@securepass'
.. note::

Expand Down Expand Up @@ -356,7 +356,7 @@ configuration.
# app/config/config.yml
imports:
- { resource: "@AcmeHelloBundle/Resources/config/services.yml" }
- { resource: '@AcmeHelloBundle/Resources/config/services.yml' }
.. code-block:: xml
Expand Down Expand Up @@ -433,7 +433,7 @@ invokes the service container extension inside the FrameworkBundle:
secret: xxxxxxxxxx
form: true
csrf_protection: true
router: { resource: "%kernel.root_dir%/config/routing.yml" }
router: { resource: '%kernel.root_dir%/config/routing.yml' }
# ...
.. code-block:: xml
Expand Down
2 changes: 1 addition & 1 deletion book/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ not empty, add the following:
AppBundle\Entity\Author:
properties:
name:
- NotBlank: { message: "author.name.not_blank" }
- NotBlank: { message: 'author.name.not_blank' }
.. code-block:: xml
Expand Down
8 changes: 4 additions & 4 deletions book/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ rules). In order to validate an object, simply map one or more constraints
to its class and then pass it to the ``validator`` service.

Behind the scenes, a constraint is simply a PHP object that makes an assertive
statement. In real life, a constraint could be: "The cake must not be burned".
statement. In real life, a constraint could be: 'The cake must not be burned'.
In Symfony, constraints are similar: they are assertions that a condition
is true. Given a value, a constraint will tell you if that value
adheres to the rules of the constraint.
Expand Down Expand Up @@ -644,7 +644,7 @@ this method must return ``true``:
AppBundle\Entity\Author:
getters:
passwordLegal:
- "True": { message: "The password cannot match your first name" }
- 'True': { message: 'The password cannot match your first name' }
.. code-block:: xml
Expand Down Expand Up @@ -954,8 +954,8 @@ username and the password are different only if all other validation passes
- Strict
getters:
passwordLegal:
- "True":
message: "The password cannot match your username"
- 'True':
message: 'The password cannot match your username'
groups: [Strict]
properties:
username:
Expand Down
2 changes: 1 addition & 1 deletion components/dependency_injection/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ service by asking for the ``bar`` service like this::
services:
foo:
class: Example\Foo
bar: "@foo"
bar: '@foo'
Decorating Services
-------------------
Expand Down
10 changes: 5 additions & 5 deletions components/dependency_injection/parentservices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ The service config for these classes would look something like this:
newsletter_manager:
class: NewsletterManager
calls:
- [setMailer, ["@my_mailer"]]
- [setEmailFormatter, ["@my_email_formatter"]]
- [setMailer, ['@my_mailer']]
- [setEmailFormatter, ['@my_email_formatter']]
greeting_card_manager:
class: "GreetingCardManager"
class: 'GreetingCardManager'
calls:
- [setMailer, ["@my_mailer"]]
- [setEmailFormatter, ["@my_email_formatter"]]
- [setMailer, ['@my_mailer']]
- [setEmailFormatter, ['@my_email_formatter']]
.. code-block:: xml
Expand Down
2 changes: 1 addition & 1 deletion components/dependency_injection/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Another possibility is just setting public fields of the class directly::
newsletter_manager:
class: NewsletterManager
properties:
mailer: "@my_mailer"
mailer: '@my_mailer'
.. code-block:: xml
Expand Down
6 changes: 3 additions & 3 deletions components/routing/hostname_pattern.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ instance, if you want to match both ``m.example.com`` and
host: "m.{domain}"
defaults:
_controller: AcmeDemoBundle:Main:mobileHomepage
domain: "%domain%"
domain: '%domain%'
requirements:
domain: "%domain%"
domain: '%domain%'
homepage:
path: /
Expand Down Expand Up @@ -243,7 +243,7 @@ You can also set the host option on imported routes:
.. code-block:: yaml
acme_hello:
resource: "@AcmeHelloBundle/Resources/config/routing.yml"
resource: '@AcmeHelloBundle/Resources/config/routing.yml'
host: "hello.example.com"
.. code-block:: xml
Expand Down
2 changes: 1 addition & 1 deletion components/security/authorization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ the votes (either positive, negative or neutral) it has received. It
recognizes several strategies:

``affirmative`` (default)
grant access as soon as any voter returns an affirmative response;
grant access as soon as there is one voter granting access;

``consensus``
grant access if there are more voters granting access than there are denying;
Expand Down
Loading

0 comments on commit 8d21262

Please sign in to comment.