You are here

adsense_adstxt.install in Google AdSense integration 7

Same filename and directory in other branches
  1. 8 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 = 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;
}

Functions