Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3443205
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3443205
Commits
89794ac9
Commit
89794ac9
authored
9 years ago
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2461081
by Wim Leers: Lock test pages are uncacheable but aren't marked as such
parent
b4494afa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php
+9
-0
9 additions, 0 deletions
...dules/system_test/src/Controller/SystemTestController.php
with
9 additions
and
0 deletions
core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php
+
9
−
0
View file @
89794ac9
...
...
@@ -119,6 +119,9 @@ public function requestDestination(Request $request) {
* Try to acquire a named lock and report the outcome.
*/
public
function
lockAcquire
()
{
// Don't cache lock-testing pages.
\Drupal
::
service
(
'page_cache_kill_switch'
)
->
trigger
();
if
(
$this
->
lock
->
acquire
(
'system_test_lock_acquire'
))
{
$this
->
lock
->
release
(
'system_test_lock_acquire'
);
return
[
'#markup'
=>
'TRUE: Lock successfully acquired in \Drupal\system_test\Controller\SystemTestController::lockAcquire()'
];
...
...
@@ -132,6 +135,9 @@ public function lockAcquire() {
* Try to acquire a specific lock, and then exit.
*/
public
function
lockExit
()
{
// Don't cache lock-testing pages.
\Drupal
::
service
(
'page_cache_kill_switch'
)
->
trigger
();
if
(
$this
->
lock
->
acquire
(
'system_test_lock_exit'
,
900
))
{
echo
'TRUE: Lock successfully acquired in \Drupal\system_test\Controller\SystemTestController::lockExit()'
;
// The shut-down function should release the lock.
...
...
@@ -152,6 +158,9 @@ public function lockExit() {
* The text to display.
*/
public
function
lockPersist
(
$lock_name
)
{
// Don't cache lock-testing pages.
\Drupal
::
service
(
'page_cache_kill_switch'
)
->
trigger
();
if
(
$this
->
persistentLock
->
acquire
(
$lock_name
))
{
return
[
'#markup'
=>
'TRUE: Lock successfully acquired in SystemTestController::lockPersist()'
];
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment