function flickr_api_requirements in Flickr API Integration 8
Implements hook_requirements().
File
- ./
flickr_api.install, line 13 - Contains install hooks.
Code
function flickr_api_requirements($phase) {
$requirements = [];
if ($phase == 'runtime') {
$config = \Drupal::config('flickr_api.settings');
if (!$config
->get('api_key') || !$config
->get('api_secret')) {
$requirements['flickr_api'] = [
'severity' => REQUIREMENT_WARNING,
'title' => 'Flickr Api',
'value' => t('Flickr API credentials are not set'),
'description' => t('It can be set on the <a href=":config_page">configuration page</a>.', [
':config_page' => Url::fromRoute('flickr_api.settings'),
]),
];
}
}
return $requirements;
}