You are here

function xmlsitemap_check_all_directories in XML sitemap 7.2

Same name and namespace in other branches
  1. 8 xmlsitemap.module \xmlsitemap_check_all_directories()
  2. 6.2 xmlsitemap.module \xmlsitemap_check_all_directories()
  3. 2.x xmlsitemap.module \xmlsitemap_check_all_directories()

Check all directories.

1 call to xmlsitemap_check_all_directories()
xmlsitemap_requirements in ./xmlsitemap.install
Implements hook_requirements().

File

./xmlsitemap.module, line 903
xmlsitemap XML sitemap

Code

function xmlsitemap_check_all_directories() {
  $directories = array();
  $sitemaps = xmlsitemap_sitemap_load_multiple(FALSE);
  foreach ($sitemaps as $smid => $sitemap) {
    $directory = xmlsitemap_get_directory($sitemap);
    $directories[$directory] = $directory;
  }
  foreach ($directories as $directory) {
    $result = file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
    if ($result) {
      $directories[$directory] = TRUE;
    }
    else {
      $directories[$directory] = FALSE;
    }
  }
  return $directories;
}