You are here

function apachesolr_confgen_format_variable in Apache Solr Config Generator 7

Same name and namespace in other branches
  1. 6 apachesolr_confgen.module \apachesolr_confgen_format_variable()
1 call to apachesolr_confgen_format_variable()
apachesolr_confgen_variable_get in ./apachesolr_confgen.module

File

./apachesolr_confgen.module, line 183
Generator for Apache Solr Configuration Files.

Code

function apachesolr_confgen_format_variable($name, $value) {
  $info = variable_get_info($name);
  if ('boolean' == $info['type'] && array_key_exists('solr_format', $info)) {
    switch ($info['solr_format']) {
      case 'string':
        return $value ? 'true' : 'false';
      case 'numeric':
        return $value ? '1' : '0';
    }
  }
  return $value;
}