function _apachesolr_drush_variable_like in Apache Solr Search 6.3
Same name and namespace in other branches
- 8 drush/apachesolr.drush.inc \_apachesolr_drush_variable_like()
- 7 drush/apachesolr.drush.inc \_apachesolr_drush_variable_like()
Search for similar variable names.
Throws
Exception
3 calls to _apachesolr_drush_variable_like()
- drush_apachesolr_solr_variable_delete in drush/
apachesolr.drush.inc - Command callback. Delete a variable.
- drush_apachesolr_solr_variable_get in drush/
apachesolr.drush.inc - Command callback. List your site's variables.
- drush_apachesolr_solr_variable_set in drush/
apachesolr.drush.inc - Command callback. Set a variable.
File
- drush/
apachesolr.drush.inc, line 542 - drush integration for apachesolr.
Code
function _apachesolr_drush_variable_like($env_id, $arg = NULL, $starts_with = FALSE) {
$found = array();
$environment = _apachesolr_drush_environment_load_and_validate($env_id);
if (!isset($arg)) {
return $environment['conf'];
}
if ($starts_with) {
$pattern = "/^{$arg}/i";
}
else {
$pattern = "/{$arg}/i";
}
foreach ($environment['conf'] as $name => $value) {
// Find all variable that start with $arg.
if (preg_match($pattern, $name)) {
$found[$name] = $value;
}
}
return $found;
}