You are here

function adsense_adstxt_requirements in Google AdSense integration 7

Same name and namespace in other branches
  1. 8 adstxt/adsense_adstxt.install \adsense_adstxt_requirements()

Implements hook_requirements().

File

adstxt/adsense_adstxt.install, line 11
Install file of the adsense_adstxt module.

Code

function adsense_adstxt_requirements($phase) {
  $requirements = array();
  $t = get_t();
  switch ($phase) {

    // At runtime, make sure there is no existing ads.txt.
    case 'runtime':
      if (file_exists(DRUPAL_ROOT . '/ads.txt')) {
        $requirements['adstxt_file'] = array(
          'title' => $t('AdSense ads.txt'),
          'value' => $t('Existing ads.txt file detected.'),
          'description' => $t('This module can only provide an auto-generated version if you remove the existing file. To keep using it, disable this module.'),
          'severity' => REQUIREMENT_WARNING,
        );
      }
      break;
  }
  return $requirements;
}