Update Composer, update everything
This commit is contained in:
parent
ea3e94409f
commit
dda5c284b6
19527 changed files with 1135420 additions and 351004 deletions
49
vendor/chi-teck/drupal-code-generator/templates/d7/hook/requirements.twig
vendored
Normal file
49
vendor/chi-teck/drupal-code-generator/templates/d7/hook/requirements.twig
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
/**
|
||||
* Implements hook_requirements().
|
||||
*/
|
||||
function {{ machine_name }}_requirements($phase) {
|
||||
$requirements = array();
|
||||
// Ensure translations don't break during installation.
|
||||
$t = get_t();
|
||||
|
||||
// Report Drupal version
|
||||
if ($phase == 'runtime') {
|
||||
$requirements['drupal'] = array(
|
||||
'title' => $t('Drupal'),
|
||||
'value' => VERSION,
|
||||
'severity' => REQUIREMENT_INFO
|
||||
);
|
||||
}
|
||||
|
||||
// Test PHP version
|
||||
$requirements['php'] = array(
|
||||
'title' => $t('PHP'),
|
||||
'value' => ($phase == 'runtime') ? l(phpversion(), 'admin/reports/status/php') : phpversion(),
|
||||
);
|
||||
if (version_compare(phpversion(), DRUPAL_MINIMUM_PHP) < 0) {
|
||||
$requirements['php']['description'] = $t('Your PHP installation is too old. Drupal requires at least PHP %version.', array('%version' => DRUPAL_MINIMUM_PHP));
|
||||
$requirements['php']['severity'] = REQUIREMENT_ERROR;
|
||||
}
|
||||
|
||||
// Report cron status
|
||||
if ($phase == 'runtime') {
|
||||
$cron_last = variable_get('cron_last');
|
||||
|
||||
if (is_numeric($cron_last)) {
|
||||
$requirements['cron']['value'] = $t('Last run !time ago', array('!time' => format_interval(REQUEST_TIME - $cron_last)));
|
||||
}
|
||||
else {
|
||||
$requirements['cron'] = array(
|
||||
'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>.', array('@url' => 'http://drupal.org/cron')),
|
||||
'severity' => REQUIREMENT_ERROR,
|
||||
'value' => $t('Never run'),
|
||||
);
|
||||
}
|
||||
|
||||
$requirements['cron']['description'] .= ' ' . $t('You can <a href="@cron">run cron manually</a>.', array('@cron' => url('admin/reports/status/run-cron')));
|
||||
|
||||
$requirements['cron']['title'] = $t('Cron maintenance tasks');
|
||||
}
|
||||
|
||||
return $requirements;
|
||||
}
|
||||
Reference in a new issue