function ds_file_preg_replace in Display Suite 8.3
Same name and namespace in other branches
- 8.2 drush/ds.drush.inc \ds_file_preg_replace()
- 7.2 drush/ds.drush.inc \ds_file_preg_replace()
- 7 ds.drush.inc \ds_file_preg_replace()
Perform preg_replace() on the contents of an array of files.
2 string references to 'ds_file_preg_replace'
- drush_ds_build in drush/
ds.drush.inc - Create a basic template and configuration file for a Display Suite layout.
- drush_ds_field in drush/
ds.drush.inc - Create a Display Suite plugin.
File
- drush/
ds.drush.inc, line 156 - Display Suite drush integration.
Code
function ds_file_preg_replace($file_paths, $find, $replace) {
foreach ($file_paths as $path) {
$file_contents = file_get_contents($path);
$file_contents = preg_replace($find, $replace, $file_contents);
file_put_contents($path, $file_contents);
}
}