comparison core/modules/system/src/CronController.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 4c8ae668cc8c
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
34 */ 34 */
35 public static function create(ContainerInterface $container) { 35 public static function create(ContainerInterface $container) {
36 return new static($container->get('cron')); 36 return new static($container->get('cron'));
37 } 37 }
38 38
39
40 /** 39 /**
41 * Run Cron once. 40 * Run Cron once.
42 * 41 *
43 * @return \Symfony\Component\HttpFoundation\Response 42 * @return \Symfony\Component\HttpFoundation\Response
44 * A Symfony response object. 43 * A Symfony response object.
56 * @return \Symfony\Component\HttpFoundation\RedirectResponse 55 * @return \Symfony\Component\HttpFoundation\RedirectResponse
57 * A Symfony direct response object. 56 * A Symfony direct response object.
58 */ 57 */
59 public function runManually() { 58 public function runManually() {
60 if ($this->cron->run()) { 59 if ($this->cron->run()) {
61 drupal_set_message($this->t('Cron ran successfully.')); 60 $this->messenger()->addStatus($this->t('Cron ran successfully.'));
62 } 61 }
63 else { 62 else {
64 drupal_set_message($this->t('Cron run failed.'), 'error'); 63 $this->messenger()->addError($this->t('Cron run failed.'));
65 } 64 }
66 65
67 return $this->redirect('system.status'); 66 return $this->redirect('system.status');
68 } 67 }
69 68