You are here

adsense_adstxt.install in Google AdSense integration 8

Same filename and directory in other branches
  1. 7 adstxt/adsense_adstxt.install

Install file of the adsense_adstxt module.

File

adstxt/adsense_adstxt.install
View source
<?php

/**
 * @file
 * Install file of the adsense_adstxt module.
 */

/**
 * Implements hook_requirements().
 */
function adsense_adstxt_requirements($phase) {
  $requirements = [];
  switch ($phase) {

    // At runtime, make sure there is no existing ads.txt.
    case 'runtime':
      if (file_exists(DRUPAL_ROOT . '/ads.txt')) {
        $requirements['adstxt_file'] = [
          '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;
}

Functions