Skip to content

Commit

Permalink
Merge branch '2.4' into 2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed May 29, 2014
2 parents 3e3004f + bc0fe91 commit 9a533ce
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 17 deletions.
11 changes: 8 additions & 3 deletions book/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -451,16 +451,21 @@ Next, create the controller that will display the login form::
$error = $request->attributes->get(
SecurityContextInterface::AUTHENTICATION_ERROR
);
} else {
} elseif (null !== $session && $session->has(SecurityContextInterface::AUTHENTICATION_ERROR)) {
$error = $session->get(SecurityContextInterface::AUTHENTICATION_ERROR);
$session->remove(SecurityContextInterface::AUTHENTICATION_ERROR);
} else {
$error = '';
}
// last username entered by the user
$lastUsername = (null === $session) ? '' : $session->get(SecurityContextInterface::LAST_USERNAME);

return $this->render(
'AcmeSecurityBundle:Security:login.html.twig',
array(
// last username entered by the user
'last_username' => $session->get(SecurityContextInterface::LAST_USERNAME),
'last_username' => $lastUsername,
'error' => $error,
)
);
Expand Down Expand Up @@ -1259,7 +1264,7 @@ this by creating a ``User`` class and configuring the ``entity`` provider.
.. tip::

A high-quality open source bundle is available that allows your users
to be stored via the Doctrine ORM or ODM. Read more about the `FOSUserBundle`_
to be stored in a database. Read more about the `FOSUserBundle`_
on GitHub.

With this approach, you'll first create your own ``User`` class, which will
Expand Down
5 changes: 5 additions & 0 deletions book/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,11 @@ force him with the ``followRedirects()`` method::

$client->followRedirects();

If you pass ``false`` to the ``followRedirects()`` method, the redirects
will no longer be followed::

$client->followRedirects(false);

.. index::
single: Tests; Crawler

Expand Down
3 changes: 2 additions & 1 deletion components/http_foundation/session_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ Example usage::
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler;

$storage = new NativeSessionStorage(array(), new PdoSessionHandler());
$pdo = new \PDO('mysql:dbname=testdb;host=127.0.0.1');
$storage = new NativeSessionStorage(array(), new PdoSessionHandler($pdo));
$session = new Session($storage);

Configuring PHP Sessions
Expand Down
7 changes: 4 additions & 3 deletions cookbook/assetic/uglifyjs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,16 @@ helper:

.. code-block:: html+jinja

{% stylesheets '@AcmeFooBundle/Resources/public/css/*' filter='uglifycss' %}
{% stylesheets 'bundles/AcmeFoo/css/*' filter='uglifycss' filter='cssrewrite' %}
<link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}
.. code-block:: html+php

<?php foreach ($view['assetic']->stylesheets(
array('@AcmeFooBundle/Resources/public/css/*'),
array('uglifycss')
array('bundles/AcmeFoo/css/*'),
array('uglifycss'),
array('cssrewrite')
) as $url): ?>
<link rel="stylesheet" href="<?php echo $view->escape($url) ?>" />
<?php endforeach; ?>
Expand Down
8 changes: 2 additions & 6 deletions cookbook/security/voters_data_permission.rst
Original file line number Diff line number Diff line change
Expand Up @@ -206,20 +206,16 @@ from the security context is called.
class PostController extends Controller
{
public function showAction()
public function showAction($id)
{
// get a Post instance
$post = ...;
// keep in mind, this will call all registered security voters
if (false === $this->get('security.context')->isGranted('view', $post)) {
throw new AccessDeniedException('Unauthorised access!');
}
$product = $this->getDoctrine()
->getRepository('AcmeStoreBundle:Post')
->find($id);
return new Response('<h1>'.$post->getName().'</h1>');
}
}
Expand Down
8 changes: 4 additions & 4 deletions cookbook/service_container/scopes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,10 @@ argument is the ``ClientConfiguration`` object:
<!-- src/Acme/HelloBundle/Resources/config/services.xml -->
<services>
<service id="my_mailer"
class="Acme\HelloBundle\Mail\Mailer"
scope="client"
/>
<argument type="service" id="client_configuration" />
class="Acme\HelloBundle\Mail\Mailer"
scope="client">
<argument type="service" id="client_configuration" />
</service>
</services>
.. code-block:: php
Expand Down

0 comments on commit 9a533ce

Please sign in to comment.