You are here

function xmlsitemap_requirements in XML sitemap 6

Same name and namespace in other branches
  1. 8 xmlsitemap.install \xmlsitemap_requirements()
  2. 6.2 xmlsitemap.install \xmlsitemap_requirements()
  3. 7.2 xmlsitemap.install \xmlsitemap_requirements()
  4. 2.x xmlsitemap.install \xmlsitemap_requirements()

Implementation of hook_requirements().

File

./xmlsitemap.install, line 578
Installation file for XML sitemap.

Code

function xmlsitemap_requirements($phase) {
  $requirements = array();
  $t = get_t();
  if ($phase == 'runtime' && is_dir(drupal_get_path('module', 'xmlsitemap') . '/xmlsitemap')) {
    watchdog('xmlsitemap', 'You have not correctly followed the installation instructions for this module. You must make certain that the old xmlsitemap/xmlsitemap diretory is removed. The xmlsitemap/xmlsitemap/xmlsitemap.* files have been moved back to the modules root directory. The install instructions were to removed the modules/xmlsitemap directory completely before extracting the update. If you had followed that step you would have prevented this message.', NULL, WATCHDOG_ERROR);
    $requirements['xmlsitemap'] = array(
      'title' => $t('xmlsitemap'),
      'value' => $t('Installation issue'),
      'description' => $t('You have not correctly followed the installation instructions for this module. You must make certain that the old xmlsitemap/xmlsitemap diretory is removed. The xmlsitemap/xmlsitemap/xmlsitemap.* files have been moved back to the modules root directory. The install instructions were to removed the modules/xmlsitemap directory completely before extracting the update. If you had followed that step you would have prevented this message.'),
      'severity' => REQUIREMENT_ERROR,
    );
  }
  if (variable_get('clean_url', 0) && file_exists('./sitemap.xml')) {
    $requirements['xmlsitemap_file'] = array(
      'title' => $t('XML sitemap'),
      'value' => $t('Existing sitemap.xml file found.'),
      'severity' => REQUIREMENT_ERROR,
      'description' => $t('The XML sitemap module cannot display its XML output if there is an existing sitemap.xml file in your website root.'),
    );
  }
  return $requirements;
}