Commit 6a62e4f8 authored by anarcat's avatar anarcat Committed by anarcat

detect preg_replace failures

parent b731ad71
......@@ -268,7 +268,11 @@ class provisionConfig {
flock($fd, LOCK_EX);
$body = fread($fd, filesize($file));
$newbody = preg_replace($pattern, '', $body);
drush_log("pattern $pattern found and replaced with $replacement");
if ($newbody != $body) {
drush_log("pattern $pattern found and replaced with $replacement");
} else {
drush_log("couldn't find line $pattern", 'warning');
}
fseek($fd, 0);
fwrite($fd, $newbody);
ftruncate($fd, strlen($newbody));
......
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