function apachesolr_config_file in Apache Solr Search 8
Same name and namespace in other branches
- 6.3 apachesolr.admin.inc \apachesolr_config_file()
- 6 apachesolr.admin.inc \apachesolr_config_file()
- 6.2 apachesolr.admin.inc \apachesolr_config_file()
- 7 apachesolr.admin.inc \apachesolr_config_file()
Page callback to show one conf file.
Parameters
string $name:
array $environment:
Return value
string the requested config file
1 string reference to 'apachesolr_config_file'
- apachesolr_menu in ./
apachesolr.module - Implements hook_menu().
File
- ./
apachesolr.admin.inc, line 824 - Administrative pages for the Apache Solr framework.
Code
function apachesolr_config_file($name, array $environment = array()) {
if (empty($environment)) {
$env_id = apachesolr_default_environment();
}
else {
$env_id = $environment['env_id'];
}
$output = '';
try {
$solr = apachesolr_get_solr($env_id);
$response = $solr
->makeServletRequest('admin/file', array(
'file' => $name,
));
$raw_file = $response->data;
$output = '<pre>' . check_plain($raw_file) . '</pre>';
drupal_set_title(check_plain($name));
} catch (Exception $e) {
watchdog('Apache Solr', nl2br(check_plain($e
->getMessage())), NULL, WATCHDOG_ERROR);
drupal_set_message(nl2br(check_plain($e
->getMessage())), "warning");
}
return $output;
}