Skip to content

Commit a26a2b2

Browse files
authored
Merge branch 'main' into copilot/fix-search-replace-hyphen-issue
2 parents be22d0e + c4599aa commit a26a2b2

7 files changed

Lines changed: 38 additions & 8 deletions

File tree

.github/workflows/copilot-setup-steps.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ jobs:
1717

1818
steps:
1919
- name: Checkout code
20-
uses: actions/checkout@v6
20+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
2121

2222
- name: Check existence of composer.json file
2323
id: check_composer_file
24-
uses: andstor/file-existence-action@v3
24+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3
2525
with:
2626
files: "composer.json"
2727

2828
- name: Set up PHP environment
2929
if: steps.check_composer_file.outputs.files_exists == 'true'
30-
uses: shivammathur/setup-php@v2
30+
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2
3131
with:
3232
php-version: 'latest'
3333
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On
@@ -38,7 +38,7 @@ jobs:
3838

3939
- name: Install Composer dependencies & cache dependencies
4040
if: steps.check_composer_file.outputs.files_exists == 'true'
41-
uses: ramsey/composer-install@v3
41+
uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3
4242
env:
4343
COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }}
4444
with:

.github/workflows/issue-triage.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ name: Issue and PR Triage
1313
required: false
1414
type: string
1515

16+
permissions:
17+
issues: write
18+
pull-requests: write
19+
actions: write
20+
contents: read
21+
models: read
22+
1623
jobs:
1724
issue-triage:
1825
uses: wp-cli/.github/.github/workflows/reusable-issue-triage.yml@main

.github/workflows/regenerate-readme.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
- "features/**"
1111
- "README.md"
1212

13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
1317
jobs:
1418
regenerate-readme:
1519
uses: wp-cli/.github/.github/workflows/reusable-regenerate-readme.yml@main

.github/workflows/welcome-new-contributors.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
- main
88
- master
99

10+
permissions:
11+
pull-requests: write
12+
1013
jobs:
1114
welcome:
1215
uses: wp-cli/.github/.github/workflows/reusable-welcome-new-contributors.yml@main

.typos.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[default]
2+
extend-ignore-re = [
3+
"(?Rm)^.*(#|//)\\s*spellchecker:disable-line$",
4+
"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on",
5+
"(#|//)\\s*spellchecker:ignore-next-line\\n.*"
6+
]

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@ change primary key values.
8282
specify multiple columns.
8383

8484
[--precise]
85-
Force the use of PHP (instead of SQL) which is more thorough,
86-
but slower.
85+
Force the use of PHP (instead of SQL) for all columns. By default, the command
86+
uses fast SQL queries, but automatically switches to PHP for columns containing
87+
serialized data. Use this flag to ensure PHP processes all columns, which is
88+
slower but handles complex serialized data structures more reliably.
8789

8890
[--recurse-objects]
8991
Enable recursing into objects to replace strings. Defaults to true;
@@ -150,6 +152,9 @@ change primary key values.
150152
# Search/replace string containing hyphens
151153
$ wp search-replace --old='--old-string' --new='new-string'
152154

155+
# Use precise mode for complex serialized data
156+
$ wp search-replace 'oldurl.com' 'newurl.com' --precise
157+
153158
# Bash script: Search/replace production to development url (multisite compatible)
154159
#!/bin/bash
155160
if $(wp --url=http://example.com core is-installed --network); then

src/Search_Replace_Command.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,10 @@ class Search_Replace_Command extends WP_CLI_Command {
191191
* specify multiple columns.
192192
*
193193
* [--precise]
194-
* : Force the use of PHP (instead of SQL) which is more thorough,
195-
* but slower.
194+
* : Force the use of PHP (instead of SQL) for all columns. By default, the command
195+
* uses fast SQL queries, but automatically switches to PHP for columns containing
196+
* serialized data. Use this flag to ensure PHP processes all columns, which is
197+
* slower but handles complex serialized data structures more reliably.
196198
*
197199
* [--recurse-objects]
198200
* : Enable recursing into objects to replace strings. Defaults to true;
@@ -258,6 +260,9 @@ class Search_Replace_Command extends WP_CLI_Command {
258260
*
259261
* # Search/replace string containing hyphens
260262
* $ wp search-replace --old='--old-string' --new='new-string'
263+
*
264+
* # Use precise mode for complex serialized data
265+
* $ wp search-replace 'oldurl.com' 'newurl.com' --precise
261266
*
262267
* # Bash script: Search/replace production to development url (multisite compatible)
263268
* #!/bin/bash

0 commit comments

Comments
 (0)