summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Brown <ptbrown@whoopdedo.org>2015-05-29 15:46:19 -0400
committerPatrick Brown <ptbrown@whoopdedo.org>2015-05-29 15:46:19 -0400
commitd93ba631117932f06b44535a9d6256cc8e9c4b90 (patch)
tree79c69e1c69e3f4488fd0dd1df1c89054fbe4c81d
parentdc4a4eb00d67d7d28fae137437900220920577d4 (diff)
downloadrpg-d93ba631117932f06b44535a9d6256cc8e9c4b90.tar.gz
rpg-d93ba631117932f06b44535a9d6256cc8e9c4b90.tar.bz2
Rephrase description of io_replaceInFiles to be clarify use of regex
-rw-r--r--inc/io.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/inc/io.php b/inc/io.php
index 6d3c20047..9be648824 100644
--- a/inc/io.php
+++ b/inc/io.php
@@ -276,12 +276,14 @@ function io_saveFile($file, $content, $append=false) {
/**
* Replace one or more occurrences of a line in a file.
*
- * The default, when $maxlines is 0 is to delete all matches then append a single line.
- * If $maxlines is -1, then every $oldline will be replaced with $newline, and $regex is true
- * then preg captures are used. If $maxlines is greater than 0 then the first $maxlines
- * matches are replaced with $newline.
+ * The default, when $maxlines is 0 is to delete all matching lines then append a single line.
+ * A regex that matches any part of the line will remove the entire line in this mode.
+ * Captures in $newline are not available.
*
- * Be sure to include the trailing newline in $oldline
+ * Otherwise each line is matched and replaced individually, up to the first $maxlines lines
+ * or all lines if $maxlines is -1. If $regex is true then captures can be used in $newline.
+ *
+ * Be sure to include the trailing newline in $oldline when replacing entire lines.
*
* Uses gzip if extension is .gz
* and bz2 if extension is .bz2