Commit c6bdf396 authored by anarcat's avatar anarcat Committed by Adrian Rossouw

implement delete_line()

parent bc20732f
......@@ -242,6 +242,19 @@ class provisionConfig_bind_zone extends provisionConfig {
fclose($fd);
}
function delete_line($pattern) {
$file = $this->filename();
$fd = fopen($file, 'r+');
flock($fd, LOCK_EX);
$body = fread($fd, filesize($file));
$newbody = preg_replace($pattern, '', $body);
drush_log("pattern $pattern found and replaced with $replacement");
fseek($fd, 0);
fwrite($fd, $newbody);
ftruncate($fd, strlen($newbody));
fclose($fd);
}
function zone_declaration() {
return 'zone "' . $this->data['name'] . '" { type master; file "' . $this->filename() . '"; allow-query { any; }; };';
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment