function xmlsitemap_engines_get_engine_info in XML sitemap 6.2
Same name and namespace in other branches
- 8 xmlsitemap_engines/xmlsitemap_engines.module \xmlsitemap_engines_get_engine_info()
- 7.2 xmlsitemap_engines/xmlsitemap_engines.module \xmlsitemap_engines_get_engine_info()
- 2.x xmlsitemap_engines/xmlsitemap_engines.module \xmlsitemap_engines_get_engine_info()
Returns information about supported search engines.
Parameters
$engine: (optional) The engine to return information for. If omitted, information for all engines is returned.
$reset: (optional) Boolean whether to reset the static cache and do nothing. Only used for tests.
See also
hook_xmlsitemap_engines_info()
hook_xmlsitemap_engines_info_alter()
2 calls to xmlsitemap_engines_get_engine_info()
- xmlsitemap_engines_settings_form in xmlsitemap_engines/
xmlsitemap_engines.admin.inc - Form builder; Administration settings form.
- xmlsitemap_engines_submit_engines in xmlsitemap_engines/
xmlsitemap_engines.module - Submit the sitemaps to all the specified search engines.
File
- xmlsitemap_engines/
xmlsitemap_engines.module, line 163
Code
function xmlsitemap_engines_get_engine_info($engine = NULL) {
global $language;
$engines =& xmlsitemap_static(__FUNCTION__);
if (!isset($engines)) {
if ($cached = cache_get('xmlsitemap:engines:' . $language->language)) {
$engines = $cached->data;
}
else {
// Fetch the results of all hook_xmlsitemap_engine_info() implementations.
$engines = module_invoke_all('xmlsitemap_engine_info');
// Allow other modulse to alter the engine info.
drupal_alter('xmlsitemap_engine_info', $engines);
// Cache by language since engine names are translated.
cache_set('xmlsitemap:engines:' . $language->language, $engines);
}
}
if (isset($engine)) {
return isset($engines[$engine]) ? $engines[$engine] : NULL;
}
else {
return $engines;
}
}