if (version_compare(phpversion(), \Drupal::MINIMUM_PHP
) < 0
) { $requirements['php'
]['description'
] =
t('Your PHP installation is too old. Drupal requires at least PHP %version.',
['%version' => \Drupal::MINIMUM_PHP
]);
$requirements['php'
]['severity'
] = REQUIREMENT_ERROR;
} // Report cron status
if ($phase == 'runtime'
) { $cron_last = \Drupal::
state()->
get('system.cron_last'
);
if (is_numeric($cron_last)) { $requirements['cron'
]['value'
] =
t('Last run @time ago',
['@time' => \Drupal::
service('date.formatter'
)->
formatTimeDiffSince($cron_last)]);
} else { $requirements['cron'
] =
[ 'description' =>
t('Cron has not run. It appears cron jobs have not been setup on your system. Check the help pages for <a href=":url">configuring cron jobs</a>.',
[':url' => 'https://www.drupal.org/docs/administering-a-drupal-site/cron-automated-tasks/cron-automated-tasks-overview'
]),
'severity' => REQUIREMENT_ERROR,
'value' =>
t('Never run'
),
];
} $requirements['cron'
]['description'
] .= ' ' .
t('You can <a href=":cron">run cron manually</a>.',
[':cron' => Url::
fromRoute('system.run_cron'
)->
toString()]);