From 7105d1f09d7ec19251106f92cfeea3dcf75c89c9 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Fri, 8 Dec 2023 09:10:38 +0000 Subject: [PATCH 1/4] Fix script for the case where a Phar is being used --- bin/command.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/command.php b/bin/command.php index 6dc3e106..f5016587 100644 --- a/bin/command.php +++ b/bin/command.php @@ -196,8 +196,9 @@ private static function update_commands_data( $command, &$commands_data, $full ) $filename = $reflection_func->getFileName(); } } + var_dump( $filename ); if ( $filename ) { - preg_match( '#wp-cli-dev/([^/]+)#', $filename, $matches ); + preg_match( '#(?:vendor/wp-cli/|wp-cli-dev/)([^/]+)#', $filename, $matches ); if ( ! empty( $matches[1] ) ) { $repo_url = 'https://github.com/wp-cli/' . $matches[1]; } From 89c46f1d30dff69f054321d964feb357cb34c29a Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Fri, 8 Dec 2023 09:10:46 +0000 Subject: [PATCH 2/4] Run update --- bin/commands-manifest.json | 32 ----------------------- bin/handbook-manifest.json | 2 +- commands/dist-archive.md | 5 +++- internal-api/wp-cli-utils-http-request.md | 2 ++ 4 files changed, 7 insertions(+), 34 deletions(-) diff --git a/bin/commands-manifest.json b/bin/commands-manifest.json index d562eb19..893178d0 100644 --- a/bin/commands-manifest.json +++ b/bin/commands-manifest.json @@ -1647,38 +1647,6 @@ "markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/scaffold\/child-theme.md", "repo_url": "https:\/\/github.com\/wp-cli\/scaffold-command" }, - "scaffold\/package-github": { - "title": "scaffold package-github", - "slug": "package-github", - "cmd_path": "scaffold\/package-github", - "parent": "scaffold", - "markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/scaffold\/package-github.md", - "repo_url": "https:\/\/github.com\/wp-cli\/scaffold-package-command" - }, - "scaffold\/package-readme": { - "title": "scaffold package-readme", - "slug": "package-readme", - "cmd_path": "scaffold\/package-readme", - "parent": "scaffold", - "markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/scaffold\/package-readme.md", - "repo_url": "https:\/\/github.com\/wp-cli\/scaffold-package-command" - }, - "scaffold\/package-tests": { - "title": "scaffold package-tests", - "slug": "package-tests", - "cmd_path": "scaffold\/package-tests", - "parent": "scaffold", - "markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/scaffold\/package-tests.md", - "repo_url": "https:\/\/github.com\/wp-cli\/scaffold-package-command" - }, - "scaffold\/package": { - "title": "scaffold package", - "slug": "package", - "cmd_path": "scaffold\/package", - "parent": "scaffold", - "markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/scaffold\/package.md", - "repo_url": "https:\/\/github.com\/wp-cli\/scaffold-package-command" - }, "scaffold\/plugin-tests": { "title": "scaffold plugin-tests", "slug": "plugin-tests", diff --git a/bin/handbook-manifest.json b/bin/handbook-manifest.json index 928bd6ff..a4653349 100644 --- a/bin/handbook-manifest.json +++ b/bin/handbook-manifest.json @@ -42,7 +42,7 @@ "parent": null }, "contributor-day": { - "title": "WordCamp Contributor Day", + "title": "WP-CLI Hack Day", "slug": "contributor-day", "markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/contributor-day.md", "parent": null diff --git a/commands/dist-archive.md b/commands/dist-archive.md index 61d1a098..7d5eeca4 100644 --- a/commands/dist-archive.md +++ b/commands/dist-archive.md @@ -41,7 +41,10 @@ options: \--- [\--filename-format=<filename-format>] -: Use a custom format for archive filename. Defaults to '{name}.{version}'. This is ignored if a custom filename is provided or version does not exist. +: Use a custom format for archive filename. Available substitutions: {name}, {version}. This is ignored if the <target> parameter is provided or the version cannot be determined. +\--- +default: "{name}.{version}" +\--- ### GLOBAL PARAMETERS diff --git a/internal-api/wp-cli-utils-http-request.md b/internal-api/wp-cli-utils-http-request.md index b6c19e8e..de5c1bb5 100644 --- a/internal-api/wp-cli-utils-http-request.md +++ b/internal-api/wp-cli-utils-http-request.md @@ -11,6 +11,7 @@ Make a HTTP request to a remote URL.
$method (string) HTTP method (GET, POST, DELETE, etc.).
$url (string) URL to make the HTTP request to.
+$data (array|null) Data to send either as a query string for GET/HEAD requests,
$headers (array) Add specific headers to the request.
$options (array) {
Optional. An associative array of additional request options.
@type bool $halt_on_error Whether or not command execution should be halted on error. Default: true
@type bool|string $verify A boolean to use enable/disable SSL verification
or string absolute path to CA cert to use.
Defaults to detected CA cert bundled with the Requests library.
@type bool $insecure Whether to retry automatically without certificate validation.
}
@return (object)
@@ -31,6 +32,7 @@ if ( 20 != substr( $md5_response->status_code, 0, 2 ) ) { WP_CLI::error( "Couldn't access md5 hash for release (HTTP code {$response->status_code})" ); } ``` + or in the body for POST requests. *Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* From 033e6401818755f45286e93ce8483b14be6d516c Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Fri, 8 Dec 2023 09:15:23 +0000 Subject: [PATCH 3/4] Remove debugging left-over --- bin/command.php | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/command.php b/bin/command.php index f5016587..ce3affbd 100644 --- a/bin/command.php +++ b/bin/command.php @@ -196,7 +196,6 @@ private static function update_commands_data( $command, &$commands_data, $full ) $filename = $reflection_func->getFileName(); } } - var_dump( $filename ); if ( $filename ) { preg_match( '#(?:vendor/wp-cli/|wp-cli-dev/)([^/]+)#', $filename, $matches ); if ( ! empty( $matches[1] ) ) { From d742f6da07acc8c1ce7145db037c8f9a8933c223 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Fri, 8 Dec 2023 09:15:55 +0000 Subject: [PATCH 4/4] Reinclude scaffold package command --- bin/commands-manifest.json | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/bin/commands-manifest.json b/bin/commands-manifest.json index 893178d0..d562eb19 100644 --- a/bin/commands-manifest.json +++ b/bin/commands-manifest.json @@ -1647,6 +1647,38 @@ "markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/scaffold\/child-theme.md", "repo_url": "https:\/\/github.com\/wp-cli\/scaffold-command" }, + "scaffold\/package-github": { + "title": "scaffold package-github", + "slug": "package-github", + "cmd_path": "scaffold\/package-github", + "parent": "scaffold", + "markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/scaffold\/package-github.md", + "repo_url": "https:\/\/github.com\/wp-cli\/scaffold-package-command" + }, + "scaffold\/package-readme": { + "title": "scaffold package-readme", + "slug": "package-readme", + "cmd_path": "scaffold\/package-readme", + "parent": "scaffold", + "markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/scaffold\/package-readme.md", + "repo_url": "https:\/\/github.com\/wp-cli\/scaffold-package-command" + }, + "scaffold\/package-tests": { + "title": "scaffold package-tests", + "slug": "package-tests", + "cmd_path": "scaffold\/package-tests", + "parent": "scaffold", + "markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/scaffold\/package-tests.md", + "repo_url": "https:\/\/github.com\/wp-cli\/scaffold-package-command" + }, + "scaffold\/package": { + "title": "scaffold package", + "slug": "package", + "cmd_path": "scaffold\/package", + "parent": "scaffold", + "markdown_source": "https:\/\/github.com\/wp-cli\/handbook\/blob\/main\/commands\/scaffold\/package.md", + "repo_url": "https:\/\/github.com\/wp-cli\/scaffold-package-command" + }, "scaffold\/plugin-tests": { "title": "scaffold plugin-tests", "slug": "plugin-tests",