function robotstxt_robots in RobotsTxt 6
Same name and namespace in other branches
- 5 robotstxt.module \robotstxt_robots()
- 7 robotstxt.module \robotstxt_robots()
Show the robots.txt file.
1 string reference to 'robotstxt_robots'
- robotstxt_menu in ./
robotstxt.module - Implementation of hook_menu().
File
- ./
robotstxt.module, line 52
Code
function robotstxt_robots() {
$content = array();
$content[] = _robotstxt_get_content();
// Hook other modules for adding additional lines.
if ($additions = module_invoke_all('robotstxt')) {
$content = array_merge($content, $additions);
}
// Trim any extra whitespace and filter out empty strings.
$content = array_map('trim', $content);
$content = array_filter($content);
drupal_set_header('Content-type: text/plain');
echo implode("\n", $content);
drupal_page_footer();
exit;
}