You are here

function apachesolr_config_file in Apache Solr Search 6

Same name and namespace in other branches
  1. 8 apachesolr.admin.inc \apachesolr_config_file()
  2. 6.3 apachesolr.admin.inc \apachesolr_config_file()
  3. 6.2 apachesolr.admin.inc \apachesolr_config_file()
  4. 7 apachesolr.admin.inc \apachesolr_config_file()

Page callback to show one conf file.

1 string reference to 'apachesolr_config_file'
apachesolr_menu in ./apachesolr.module
Implementation of hook_menu().

File

./apachesolr.admin.inc, line 749
Administrative pages for the Apache Solr framework.

Code

function apachesolr_config_file($name) {
  $output = '';
  try {
    $solr = apachesolr_get_solr();
    $response = $solr
      ->makeServletRequest('admin/file', array(
      'file' => $name,
    ));
    $raw_file = $response
      ->getRawResponse();
    $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;
}