You are here

flickr_api.install in Flickr API Integration 8

Contains install hooks.

File

flickr_api.install
View source
<?php

/**
 * @file
 * Contains install hooks.
 */
use Drupal\Core\Url;

/**
 * Implements hook_requirements().
 */
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;
}

Functions

Namesort descending Description
flickr_api_requirements Implements hook_requirements().