You are here

function xmlsitemap_get_directory in XML sitemap 2.x

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

End of "defgroup xmlsitemap_api"

Related topics

8 calls to xmlsitemap_get_directory()
XmlSitemapSettingsForm::buildForm in src/Form/XmlSitemapSettingsForm.php
Form constructor.
xmlsitemap_check_all_directories in ./xmlsitemap.module
Check all directories.
xmlsitemap_check_directory in ./xmlsitemap.module
Check that the sitemap files directory exists and is writable.
xmlsitemap_clear_directory in ./xmlsitemap.module
Clears sitemap directory.
xmlsitemap_requirements in ./xmlsitemap.install
Implements hook_requirements().

... See full list

File

./xmlsitemap.module, line 475
xmlsitemap XML sitemap

Code

function xmlsitemap_get_directory(XmlSitemapInterface $sitemap = NULL) {
  $directory =& drupal_static(__FUNCTION__);
  if (!isset($directory)) {
    $directory = \Drupal::config('xmlsitemap.settings')
      ->get('path') ?: 'xmlsitemap';
  }
  if ($sitemap != NULL && !empty($sitemap->id)) {
    return file_build_uri($directory . '/' . $sitemap->id);
  }
  else {
    return file_build_uri($directory);
  }
}