function drush_search_api_server_disable in Search API 7
Same name and namespace in other branches
- 8 search_api.drush.inc \drush_search_api_server_disable()
Disables a search server.
Parameters
int|string $server_id: The numeric ID or machine name of the server to disable.
File
- ./
search_api.drush.inc, line 709 - Drush commands for SearchAPI.
Code
function drush_search_api_server_disable($server_id = NULL) {
if (!isset($server_id)) {
drush_print(dt('Please provide a valid server id.'));
return;
}
$server = search_api_server_load($server_id);
if (empty($server)) {
drush_print(dt('The server was not able to load.'));
return;
}
else {
$server
->update(array(
'enabled' => 0,
));
drush_print(dt('The server was disabled successfully.'));
}
}