forked from civicrm/civicrm-core
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REF][PHP8.1] Apply patches and a wrapper for Guzzle v6 to make it ru…
…n in php8.1
- Loading branch information
1 parent
8449e89
commit 9584d5d
Showing
4 changed files
with
63 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace GuzzleHttp; | ||
|
||
if (!function_exists('\GuzzleHttp\http_build_query')) { | ||
|
||
/** | ||
* Generates URL-encoded query string. | ||
* | ||
* This shim exists to make Guzzle 6 PHP 8.1 compatible. | ||
* | ||
* @link https://php.net/manual/en/function.http-build-query.php | ||
* | ||
* @param object|array $data | ||
* May be an array or object containing properties. | ||
* @param string|null $numeric_prefix | ||
* (optional) If numeric indices are used in the base array and this parameter | ||
* is provided, it will be prepended to the numeric index for elements in | ||
* the base array only. | ||
* @param string|null $arg_separator [optional] <p> | ||
* (optional) arg_separator.output is used to separate arguments, unless this | ||
* parameter is specified, and is then used. | ||
* @param int $encoding_type | ||
* (optional) By default, PHP_QUERY_RFC1738. | ||
* | ||
* @return string | ||
* A URL-encoded string. | ||
*/ | ||
function http_build_query($data, $numeric_prefix = '', $arg_separator = '&', $encoding_type = \PHP_QUERY_RFC1738) { | ||
return \http_build_query($data, is_null($numeric_prefix) ? '' : $numeric_prefix, $arg_separator, $encoding_type); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
## Cleanup the vendor tree. The main issue here is that civi Civi is | ||
## deployed as a module inside a CMS, so all its source-code gets published. | ||
## Some libraries distribute admin tools and sample files which should not | ||
## be published. | ||
## | ||
## This script should be idempotent -- if you rerun it several times, it | ||
## should always produce the same post-condition. | ||
|
||
## Replace a line in a file | ||
## This is a bit like 'sed -i', but dumber and more cross-platform. | ||
function simple_replace() { | ||
php -r 'file_put_contents($argv[1], preg_replace($argv[2], $argv[3], file_get_contents($argv[1])));' "$@" | ||
} | ||
|
||
|
||
# add in class_exists test as per CRM-8921. | ||
if ! grep -q ':int' vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php; then | ||
simple_replace vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php '/public function count\(\)$/m' 'public function count() :int' | ||
fi |