Skip to content

Commit 8b5c1a9

Browse files
Update scaffolded tests and README to latest
1 parent ef7a034 commit 8b5c1a9

File tree

5 files changed

+222
-74
lines changed

5 files changed

+222
-74
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Quick links: [Using](#using) | [Installing](#installing) | [Contributing](#contr
1010
## Using
1111

1212
~~~
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]
1414
~~~
1515

1616
Searches through all rows in a selection of tables and replaces
@@ -87,6 +87,9 @@ change primary key values.
8787
[--regex-flags=<regex-flags>]
8888
Pass PCRE modifiers to regex search-replace (e.g. 'i' for case-insensitivity).
8989

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+
9093
[--format=<format>]
9194
Render output in a particular format.
9295
---
@@ -96,6 +99,12 @@ change primary key values.
9699
- count
97100
---
98101

102+
[--report]
103+
Produce report. Defaults to true.
104+
105+
[--report-changed-only]
106+
Report changed fields only. Defaults to false.
107+
99108
**EXAMPLES**
100109

101110
# Search and replace but skip one column

features/bootstrap/FeatureContext.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,11 +699,15 @@ public function get_php_binary() {
699699
return 'php';
700700
}
701701

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+
}
703707
$cmd = Utils\esc_cmd( '%s -S %s -t %s -c %s %s',
704708
$this->get_php_binary(),
705709
'localhost:8080',
706-
$this->variables['RUN_DIR'] . '/wordpress/',
710+
$dir,
707711
get_cfg_var( 'cfg_file_path' ),
708712
$this->variables['RUN_DIR'] . '/vendor/wp-cli/server-command/router.php'
709713
);

features/bootstrap/Process.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,17 @@ public function run() {
8787
self::$run_times[ $this->command ][1]++;
8888
}
8989

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+
);
99101
}
100102

101103
/**
@@ -107,7 +109,7 @@ public function run_check() {
107109
$r = $this->run();
108110

109111
// $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 ) ) {
111113
throw new \RuntimeException( $r );
112114
}
113115

0 commit comments

Comments
 (0)