Skip to content

Commit bc0fe91

Browse files
committed
Merge branch '2.3' into 2.4
Conflicts: cookbook/service_container/scopes.rst
2 parents 080a769 + 0649c21 commit bc0fe91

File tree

6 files changed

+25
-17
lines changed

6 files changed

+25
-17
lines changed

book/security.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,16 +450,21 @@ Next, create the controller that will display the login form::
450450
$error = $request->attributes->get(
451451
SecurityContextInterface::AUTHENTICATION_ERROR
452452
);
453-
} else {
453+
} elseif (null !== $session && $session->has(SecurityContextInterface::AUTHENTICATION_ERROR)) {
454454
$error = $session->get(SecurityContextInterface::AUTHENTICATION_ERROR);
455455
$session->remove(SecurityContextInterface::AUTHENTICATION_ERROR);
456+
} else {
457+
$error = '';
456458
}
459+
460+
// last username entered by the user
461+
$lastUsername = (null === $session) ? '' : $session->get(SecurityContextInterface::LAST_USERNAME);
457462

458463
return $this->render(
459464
'AcmeSecurityBundle:Security:login.html.twig',
460465
array(
461466
// last username entered by the user
462-
'last_username' => $session->get(SecurityContextInterface::LAST_USERNAME),
467+
'last_username' => $lastUsername,
463468
'error' => $error,
464469
)
465470
);
@@ -1252,7 +1257,7 @@ this by creating a ``User`` class and configuring the ``entity`` provider.
12521257
.. tip::
12531258

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

12581263
With this approach, you'll first create your own ``User`` class, which will

book/testing.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,11 @@ force him with the ``followRedirects()`` method::
501501

502502
$client->followRedirects();
503503

504+
If you pass ``false`` to the ``followRedirects()`` method, the redirects
505+
will no longer be followed::
506+
507+
$client->followRedirects(false);
508+
504509
.. index::
505510
single: Tests; Crawler
506511

components/http_foundation/session_configuration.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ Example usage::
8383
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
8484
use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler;
8585

86-
$storage = new NativeSessionStorage(array(), new PdoSessionHandler());
86+
$pdo = new \PDO('mysql:dbname=testdb;host=127.0.0.1');
87+
$storage = new NativeSessionStorage(array(), new PdoSessionHandler($pdo));
8788
$session = new Session($storage);
8889

8990
Configuring PHP Sessions

cookbook/assetic/uglifyjs.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,15 +232,16 @@ helper:
232232

233233
.. code-block:: html+jinja
234234

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

241241
<?php foreach ($view['assetic']->stylesheets(
242-
array('@AcmeFooBundle/Resources/public/css/*'),
243-
array('uglifycss')
242+
array('bundles/AcmeFoo/css/*'),
243+
array('uglifycss'),
244+
array('cssrewrite')
244245
) as $url): ?>
245246
<link rel="stylesheet" href="<?php echo $view->escape($url) ?>" />
246247
<?php endforeach; ?>

cookbook/security/voters_data_permission.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,20 +204,16 @@ from the security context is called.
204204
205205
class PostController extends Controller
206206
{
207-
public function showAction()
207+
public function showAction($id)
208208
{
209209
// get a Post instance
210210
$post = ...;
211-
211+
212212
// keep in mind, this will call all registered security voters
213213
if (false === $this->get('security.context')->isGranted('view', $post)) {
214214
throw new AccessDeniedException('Unauthorised access!');
215215
}
216216
217-
$product = $this->getDoctrine()
218-
->getRepository('AcmeStoreBundle:Post')
219-
->find($id);
220-
221217
return new Response('<h1>'.$post->getName().'</h1>');
222218
}
223219
}

cookbook/service_container/scopes.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,10 @@ argument is the ``ClientConfiguration`` object:
281281
<!-- src/Acme/HelloBundle/Resources/config/services.xml -->
282282
<services>
283283
<service id="my_mailer"
284-
class="Acme\HelloBundle\Mail\Mailer"
285-
scope="client"
286-
/>
287-
<argument type="service" id="client_configuration" />
284+
class="Acme\HelloBundle\Mail\Mailer"
285+
scope="client">
286+
<argument type="service" id="client_configuration" />
287+
</service>
288288
</services>
289289
290290
.. code-block:: php

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy