Skip to content

Commit

Permalink
Merge branch '2.0' into 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed May 4, 2013
2 parents 0cf03d8 + 4094b55 commit cf2bb38
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 29 deletions.
4 changes: 2 additions & 2 deletions book/http_cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,8 @@ example).
.. tip::

The 304 status code means "Not Modified". It's important because with
this status code do *not* contain the actual content being requested.
Instead, the response is simply a light-weight set of directions that
this status code the response does *not* contain the actual content being
requested. Instead, the response is simply a light-weight set of directions that
tell cache that it should use its stored version.

Like with expiration, there are two different HTTP headers that can be used
Expand Down
20 changes: 10 additions & 10 deletions book/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ for example, that you're translating a simple message from inside a controller::

public function indexAction()
{
$t = $this->get('translator')->trans('Symfony2 is great');
$translated = $this->get('translator')->trans('Symfony2 is great');

return new Response($t);
return new Response($translated);
}

When this code is executed, Symfony2 will attempt to translate the message
Expand Down Expand Up @@ -179,9 +179,9 @@ Sometimes, a message containing a variable needs to be translated::

public function indexAction($name)
{
$t = $this->get('translator')->trans('Hello '.$name);
$translated = $this->get('translator')->trans('Hello '.$name);

return new Response($t);
return new Response($translated);
}

However, creating a translation for this string is impossible since the translator
Expand All @@ -195,12 +195,12 @@ variable with a "placeholder"::

public function indexAction($name)
{
$t = $this->get('translator')->trans(
$translated = $this->get('translator')->trans(
'Hello %name%',
array('%name%' => $name)
);

return new Response($t);
return new Response($translated);
}

Symfony2 will now look for a translation of the raw message (``Hello %name%``)
Expand Down Expand Up @@ -391,9 +391,9 @@ Symfony2 will discover these files and use them when translating either
This example illustrates the two different philosophies when creating
messages to be translated::

$t = $translator->trans('Symfony2 is great');
$translated = $translator->trans('Symfony2 is great');

$t = $translator->trans('symfony2.great');
$translated = $translator->trans('symfony2.great');

In the first method, messages are written in the language of the default
locale (English in this case). That message is then used as the "id"
Expand Down Expand Up @@ -648,7 +648,7 @@ all the forms as a string separated by a pipe (``|``)::
To translate pluralized messages, use the
:method:`Symfony\\Component\\Translation\\Translator::transChoice` method::

$t = $this->get('translator')->transChoice(
$translated = $this->get('translator')->transChoice(
'There is one apple|There are %count% apples',
10,
array('%count%' => 10)
Expand Down Expand Up @@ -798,7 +798,7 @@ texts* and complex expressions:
Using the translation tags or filters have the same effect, but with
one subtle difference: automatic output escaping is only applied to
translations using a filter. In other words, if you need to be sure
that your translated is *not* output escaped, you must apply the
that your translated is *not* output escaped, you must apply the
``raw`` filter after the translation filter:

.. code-block:: jinja
Expand Down
7 changes: 7 additions & 0 deletions components/dom_crawler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@ The crawler supports multiple ways of adding the content::
$crawler->add('<html><body /></html>');
$crawler->add('<root><node /></root>');

.. note::

When dealing with character sets other than ISO-8859-1, always add HTML
content using the :method:`Symfony\\Component\\DomCrawler\\Crawler::addHTMLContent``
method where you can specify the second parameter to be your target character
set.

As the Crawler's implementation is based on the DOM extension, it is also able
to interact with native :phpclass:`DOMDocument`, :phpclass:`DOMNodeList`
and :phpclass:`DOMNode` objects:
Expand Down
1 change: 0 additions & 1 deletion cookbook/bundles/extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,6 @@ global parameters available to use:
* ``kernel.root_dir``
* ``kernel.cache_dir``
* ``kernel.logs_dir``
* ``kernel.bundle_dirs``
* ``kernel.bundles``
* ``kernel.charset``

Expand Down
21 changes: 13 additions & 8 deletions cookbook/configuration/web_server_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ are:
.. code-block:: apache
<VirtualHost *:80>
ServerName www.domain.tld
ServerName domain.tld
ServerAlias www.domain.tld
DocumentRoot /var/www/project/web
<Directory /var/www/project/web>
Expand All @@ -30,7 +31,7 @@ are:
Order allow,deny
Allow from All
</Directory>
ErrorLog /var/log/apache2/project_error.log
CustomLog /var/log/apache2/project_access.log combined
</VirtualHost>
Expand Down Expand Up @@ -59,7 +60,7 @@ are:
.. code-block:: nginx
server {
server_name www.domain.tld;
server_name domain.tld www.domain.tld;
root /var/www/project/web;
location / {
Expand All @@ -72,7 +73,7 @@ are:
rewrite ^(.*)$ /app.php/$1 last;
}
location ~ ^/(app|app_dev)\.php(/|$) {
location ~ ^/(app|app_dev|config)\.php(/|$) {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
Expand All @@ -91,10 +92,14 @@ are:

.. tip::

This executes **only** ``app.php`` and ``app_dev.php`` in the web directory.
All other files will be served as text. If you have other PHP files in
your web directory, be sure to include them in the ``location`` block
above.
This executes **only** ``app.php``, ``app_dev.php`` and ``config.php`` in
the web directory. All other files will be served as text. You **must**
also make sure that if you *do* deploy ``app_dev.php`` or ``config.php``
that these files are secured and not available to any outside user (the
IP checking code at the top of each file does this by default).

If you have other PHP files in your web directory that need to be executed,
be sure to include them in the ``location`` block above.

.. _`Apache`: http://httpd.apache.org/docs/current/mod/core.html#documentroot
.. _`Nginx`: http://wiki.nginx.org/Symfony
2 changes: 1 addition & 1 deletion cookbook/form/form_customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ Using Form Variables
--------------------

Most of the functions available for rendering different parts of a form (e.g.
the form widget, form label, form widget, etc) also allow you to make certain
the form widget, form label, form errors, etc) also allow you to make certain
customizations directly. Look at the following example:

.. configuration-block::
Expand Down
3 changes: 1 addition & 2 deletions cookbook/security/acl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ Checking Access
$securityContext = $this->get('security.context');
// check for edit access
if (false === $securityContext->isGranted('EDIT', $comment))
{
if (false === $securityContext->isGranted('EDIT', $comment)) {
throw new AccessDeniedException();
}
Expand Down
7 changes: 3 additions & 4 deletions cookbook/security/entity_provider.rst
Original file line number Diff line number Diff line change
Expand Up @@ -599,21 +599,20 @@ The ``AcmeUserBundle:Group`` entity class defines three table fields (``id``,
``name`` and ``role``). The unique ``role`` field contains the role name used by
the Symfony security layer to secure parts of the application. The most
important thing to notice is that the ``AcmeUserBundle:Group`` entity class
implements the :class:`Symfony\\Component\\Security\\Core\\Role\\RoleInterface`
that forces it to have a ``getRole()`` method::
extends the :class:`Symfony\\Component\\Security\\Core\\Role\\Role`::
// src/Acme/Bundle/UserBundle/Entity/Group.php
namespace Acme\UserBundle\Entity;
use Symfony\Component\Security\Core\Role\RoleInterface;
use Symfony\Component\Security\Core\Role\Role;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="acme_groups")
* @ORM\Entity()
*/
class Group implements RoleInterface
class Group extends Role
{
/**
* @ORM\Column(name="id", type="integer")
Expand Down
11 changes: 11 additions & 0 deletions cookbook/security/voters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,17 @@ and compare the IP address against a set of blacklisted IP addresses:
That's it! The voter is done. The next step is to inject the voter into
the security layer. This can be done easily through the service container.

.. tip::

Your implementation of the methods
:method:`Symfony\\Component\\Security\\Core\\Authorization\\Voter\\VoterInterface::supportsAttribute`
and :method:`Symfony\\Component\\Security\\Core\\Authorization\\Voter\\VoterInterface::supportsClass`
are not being called internally by the framework. Once you have registered your
voter the ``vote()`` method will always be called, regardless of whether
or not these two methods return true. Therefore you need to call those
methods in your implementation of the ``vote()`` method and return ``ACCESS_ABSTAIN``
if your voter does not support the class or attribute.

Declaring the Voter as a Service
--------------------------------

Expand Down
2 changes: 1 addition & 1 deletion reference/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Optional
* ``short_open_tag = Off``
* ``magic_quotes_gpc = Off``
* ``register_globals = Off``
* ``session.autostart = Off``
* ``session.auto_start = Off``

Doctrine
--------
Expand Down

0 comments on commit cf2bb38

Please sign in to comment.