Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
af9859d7
Commit
af9859d7
authored
May 29, 2013
by
Nathaniel Catchpole
Browse files
Issue
#1987828
by mtift, vijaycs85: Convert system_run_cron() to a new style controller.
parent
739eb268
Changes
4
Hide whitespace changes
Inline
Side-by-side
core/modules/system/lib/Drupal/system/CronController.php
View file @
af9859d7
...
...
@@ -8,6 +8,7 @@
namespace
Drupal\system
;
use
Symfony\Component\HttpFoundation\Response
;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
/**
* Controller for Cron handling.
...
...
@@ -17,7 +18,7 @@ class CronController {
/**
* Run Cron once.
*
* @return Symfony\Component\HttpFoundation\Response
* @return
\
Symfony\Component\HttpFoundation\Response
* A Symfony response object.
*/
public
function
run
()
{
...
...
@@ -27,4 +28,21 @@ public function run() {
// HTTP 204 is "No content", meaning "I did what you asked and we're done."
return
new
Response
(
''
,
204
);
}
/**
* Run cron manually.
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse
* A Symfony direct response object.
*/
public
function
runManually
()
{
if
(
drupal_cron_run
())
{
drupal_set_message
(
t
(
'Cron ran successfully.'
));
}
else
{
drupal_set_message
(
t
(
'Cron run failed.'
),
'error'
);
}
return
new
RedirectResponse
(
url
(
'admin/reports/status'
,
array
(
'absolute'
=>
TRUE
)));
}
}
core/modules/system/system.admin.inc
View file @
af9859d7
...
...
@@ -1307,21 +1307,6 @@ function system_status($check = FALSE) {
return
theme
(
'status_report'
,
array
(
'requirements'
=>
$requirements
));
}
/**
* Menu callback: run cron manually.
*/
function
system_run_cron
()
{
// Run cron manually
if
(
drupal_cron_run
())
{
drupal_set_message
(
t
(
'Cron ran successfully.'
));
}
else
{
drupal_set_message
(
t
(
'Cron run failed.'
),
'error'
);
}
drupal_goto
(
'admin/reports/status'
);
}
/**
* Menu callback: return information about PHP.
*/
...
...
core/modules/system/system.module
View file @
af9859d7
...
...
@@ -980,13 +980,6 @@ function system_menu() {
'access arguments'
=>
array
(
'administer site configuration'
),
'file'
=>
'system.admin.inc'
,
);
$items
[
'admin/reports/status/run-cron'
]
=
array
(
'title'
=>
'Run cron'
,
'page callback'
=>
'system_run_cron'
,
'access arguments'
=>
array
(
'administer site configuration'
),
'type'
=>
MENU_CALLBACK
,
'file'
=>
'system.admin.inc'
,
);
$items
[
'admin/reports/status/php'
]
=
array
(
'title'
=>
'PHP'
,
'page callback'
=>
'system_php'
,
...
...
core/modules/system/system.routing.yml
View file @
af9859d7
...
...
@@ -88,6 +88,13 @@ date_format_edit:
requirements
:
_permission
:
'
administer
site
configuration'
system_run_cron
:
pattern
:
'
/admin/reports/status/run-cron'
defaults
:
_controller
:
'
\Drupal\system\CronController::runManually'
requirements
:
_permission
:
'
administer
site
configuration'
date_format_delete
:
pattern
:
'
admin/config/regional/date-time/formats/{format_id}/delete'
defaults
:
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment