Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9a533ce

Browse files
committed
Merge branch '2.4' into 2.5
2 parents3e3004f +bc0fe91 commit9a533ce

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
@@ -451,16 +451,21 @@ Next, create the controller that will display the login form::
451451
$error = $request->attributes->get(
452452
SecurityContextInterface::AUTHENTICATION_ERROR
453453
);
454-
}else {
454+
}elseif (null !== $session && $session->has(SecurityContextInterface::AUTHENTICATION_ERROR)) {
455455
$error = $session->get(SecurityContextInterface::AUTHENTICATION_ERROR);
456456
$session->remove(SecurityContextInterface::AUTHENTICATION_ERROR);
457+
} else {
458+
$error = '';
457459
}
460+
461+
// last username entered by the user
462+
$lastUsername = (null === $session) ? '' : $session->get(SecurityContextInterface::LAST_USERNAME);
458463

459464
return $this->render(
460465
'AcmeSecurityBundle:Security:login.html.twig',
461466
array(
462467
// last username entered by the user
463-
'last_username' => $session->get(SecurityContextInterface::LAST_USERNAME),
468+
'last_username' => $lastUsername,
464469
'error' => $error,
465470
)
466471
);
@@ -1259,7 +1264,7 @@ this by creating a ``User`` class and configuring the ``entity`` provider.
12591264
..tip::
12601265

12611266
A high-quality open source bundle is available that allows your users
1262-
to be storedvia the Doctrine ORM or ODM. Read more about the `FOSUserBundle`_
1267+
to be storedin a database. Read more about the `FOSUserBundle`_
12631268
on GitHub.
12641269

12651270
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
@@ -206,20 +206,16 @@ from the security context is called.
206206
207207
class PostController extends Controller
208208
{
209-
public function showAction()
209+
public function showAction($id)
210210
{
211211
// get a Post instance
212212
$post = ...;
213-
213+
214214
// keep in mind, this will call all registered security voters
215215
if (false === $this->get('security.context')->isGranted('view', $post)) {
216216
throw new AccessDeniedException('Unauthorised access!');
217217
}
218218
219-
$product = $this->getDoctrine()
220-
->getRepository('AcmeStoreBundle:Post')
221-
->find($id);
222-
223219
return new Response('<h1>'.$post->getName().'</h1>');
224220
}
225221
}

‎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
<serviceid="my_mailer"
284-
class="Acme\HelloBundle\Mail\Mailer"
285-
scope="client"
286-
/>
287-
<argumenttype="service"id="client_configuration" />
284+
class="Acme\HelloBundle\Mail\Mailer"
285+
scope="client">
286+
<argumenttype="service"id="client_configuration"/>
287+
</service>
288288
</services>
289289
290290
..code-block::php

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp