You are here

function xmlsitemap_check_directory in XML sitemap 7.2

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

Check that the sitemap files directory exists and is writable.

5 calls to xmlsitemap_check_directory()
XMLSitemapTestHelper::checkFilesDirectory in ./xmlsitemap.test
Check the files directory is created (massive fails if not done).
xmlsitemap_enable in ./xmlsitemap.install
Implements hook_enable().
xmlsitemap_regenerate_batch_generate in ./xmlsitemap.generate.inc
Batch callback; generate all pages of a sitemap.
xmlsitemap_requirements in ./xmlsitemap.install
Implements hook_requirements().
xmlsitemap_settings_form in ./xmlsitemap.admin.inc
Form builder; Administration settings form.

File

./xmlsitemap.module, line 891
xmlsitemap XML sitemap

Code

function xmlsitemap_check_directory(stdClass $sitemap = NULL) {
  $directory = xmlsitemap_get_directory($sitemap);
  $result = file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
  if (!$result) {
    watchdog('file system', 'The directory %directory does not exist or is not writable.', array(
      '%directory' => $directory,
    ), WATCHDOG_ERROR);
  }
  return $result;
}