File tree Expand file tree Collapse file tree 5 files changed +222
-74
lines changed Expand file tree Collapse file tree 5 files changed +222
-74
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ Quick links: [Using](#using) | [Installing](#installing) | [Contributing](#contr
10
10
## Using
11
11
12
12
~~~
13
- wp search-replace <old> <new> [<table>...] [--dry-run] [--network] [--all-tables-with-prefix] [--all-tables] [--export[=<file>]] [--export_insert_size=<rows>] [--skip-columns=<columns>] [--include-columns=<columns>] [--precise] [--recurse-objects] [--verbose] [--regex] [--regex-flags=<regex-flags>] [--format=<format>]
13
+ wp search-replace <old> <new> [<table>...] [--dry-run] [--network] [--all-tables-with-prefix] [--all-tables] [--export[=<file>]] [--export_insert_size=<rows>] [--skip-columns=<columns>] [--include-columns=<columns>] [--precise] [--recurse-objects] [--verbose] [--regex] [--regex-flags=<regex-flags>] [--regex-delimiter=<regex-delimiter>] [-- format=<format>] [--report] [--report-changed-only ]
14
14
~~~
15
15
16
16
Searches through all rows in a selection of tables and replaces
@@ -87,6 +87,9 @@ change primary key values.
87
87
[--regex-flags=<regex-flags>]
88
88
Pass PCRE modifiers to regex search-replace (e.g. 'i' for case-insensitivity).
89
89
90
+ [--regex-delimiter=<regex-delimiter>]
91
+ The delimiter to use for the regex. It must be escaped if it appears in the search string. The default value is the result of `chr(1)`.
92
+
90
93
[--format=<format>]
91
94
Render output in a particular format.
92
95
---
@@ -96,6 +99,12 @@ change primary key values.
96
99
- count
97
100
---
98
101
102
+ [--report]
103
+ Produce report. Defaults to true.
104
+
105
+ [--report-changed-only]
106
+ Report changed fields only. Defaults to false.
107
+
99
108
** EXAMPLES**
100
109
101
110
# Search and replace but skip one column
Original file line number Diff line number Diff line change @@ -699,11 +699,15 @@ public function get_php_binary() {
699
699
return 'php ' ;
700
700
}
701
701
702
- public function start_php_server () {
702
+ public function start_php_server ( $ subdir = '' ) {
703
+ $ dir = $ this ->variables ['RUN_DIR ' ] . '/ ' ;
704
+ if ( $ subdir ) {
705
+ $ dir .= trim ( $ subdir , '/ ' ) . '/ ' ;
706
+ }
703
707
$ cmd = Utils \esc_cmd ( '%s -S %s -t %s -c %s %s ' ,
704
708
$ this ->get_php_binary (),
705
709
'localhost:8080 ' ,
706
- $ this -> variables [ ' RUN_DIR ' ] . ' /wordpress/ ' ,
710
+ $ dir ,
707
711
get_cfg_var ( 'cfg_file_path ' ),
708
712
$ this ->variables ['RUN_DIR ' ] . '/vendor/wp-cli/server-command/router.php '
709
713
);
Original file line number Diff line number Diff line change @@ -87,15 +87,17 @@ public function run() {
87
87
self ::$ run_times [ $ this ->command ][1 ]++;
88
88
}
89
89
90
- return new ProcessRun ( array (
91
- 'stdout ' => $ stdout ,
92
- 'stderr ' => $ stderr ,
93
- 'return_code ' => $ return_code ,
94
- 'command ' => $ this ->command ,
95
- 'cwd ' => $ this ->cwd ,
96
- 'env ' => $ this ->env ,
97
- 'run_time ' => $ run_time ,
98
- ) );
90
+ return new ProcessRun (
91
+ array (
92
+ 'stdout ' => $ stdout ,
93
+ 'stderr ' => $ stderr ,
94
+ 'return_code ' => $ return_code ,
95
+ 'command ' => $ this ->command ,
96
+ 'cwd ' => $ this ->cwd ,
97
+ 'env ' => $ this ->env ,
98
+ 'run_time ' => $ run_time ,
99
+ )
100
+ );
99
101
}
100
102
101
103
/**
@@ -107,7 +109,7 @@ public function run_check() {
107
109
$ r = $ this ->run ();
108
110
109
111
// $r->STDERR is incorrect, but kept incorrect for backwards-compat
110
- if ( $ r ->return_code || !empty ( $ r ->STDERR ) ) {
112
+ if ( $ r ->return_code || ! empty ( $ r ->STDERR ) ) {
111
113
throw new \RuntimeException ( $ r );
112
114
}
113
115
You can’t perform that action at this time.
0 commit comments