function drush_http_response_headers_http_header_del in HTTP Response Headers 7
Deletes a header rule.
Return value
string A string message for choice or confirming success.
File
- ./
http_response_headers.drush.inc, line 257 - HTTP response headers drush command.
Code
function drush_http_response_headers_http_header_del() {
$args = func_get_args();
// Look for similar variable names.
$result = drush_http_response_headers_like($args[0]);
$options = array();
while ($name = drush_db_result($result)) {
$options[] = $name;
}
if (drush_get_option('exact', FALSE)) {
$options = in_array($args[0], $options) ? array(
$args[0],
) : array();
}
if (count($options) == 0) {
drush_print(dt('!name not found.', array(
'!name' => $args[0],
)));
return '';
}
if (count($options) == 1 && drush_get_context('DRUSH_AFFIRMATIVE')) {
drush_op('http_response_headers_rule_delete', $args[0]);
drush_log(dt('!name was deleted.', array(
'!name' => $args[0],
)), 'success');
return '';
}
else {
$choice = drush_choice($options, 'Enter a number to choose which header rule to delete.');
if ($choice !== FALSE) {
$choice = $options[$choice];
drush_op('http_response_headers_rule_delete', $choice);
drush_log(dt('!choice was deleted.', array(
'!choice' => $choice,
)), 'success');
}
}
}