Issue #3439591 by quietone, mstrelan, pradhumanjain2311, andypost, catch, mfb, longwave, coaston, penyaskito: Add composer dependency on ext-zlib
parent
539c50a257
commit
0a4f122fcb
|
@ -495,7 +495,7 @@
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"url": "core",
|
"url": "core",
|
||||||
"reference": "a04ae36ab48fdc8d48a813f739cdfeeddb7517eb"
|
"reference": "ff1a97312bafb66b9f39cc05fa161d99956a15be"
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"asm89/stack-cors": "^2.1",
|
"asm89/stack-cors": "^2.1",
|
||||||
|
@ -517,6 +517,7 @@
|
||||||
"ext-spl": "*",
|
"ext-spl": "*",
|
||||||
"ext-tokenizer": "*",
|
"ext-tokenizer": "*",
|
||||||
"ext-xml": "*",
|
"ext-xml": "*",
|
||||||
|
"ext-zlib": "*",
|
||||||
"guzzlehttp/guzzle": "^7.5",
|
"guzzlehttp/guzzle": "^7.5",
|
||||||
"guzzlehttp/psr7": "^2.4.5",
|
"guzzlehttp/psr7": "^2.4.5",
|
||||||
"masterminds/html5": "^2.7",
|
"masterminds/html5": "^2.7",
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
"ext-SPL": "*",
|
"ext-SPL": "*",
|
||||||
"ext-tokenizer": "*",
|
"ext-tokenizer": "*",
|
||||||
"ext-xml": "*",
|
"ext-xml": "*",
|
||||||
|
"ext-zlib": "*",
|
||||||
"php": ">=8.3.0",
|
"php": ">=8.3.0",
|
||||||
"symfony/console": "^7.1@beta",
|
"symfony/console": "^7.1@beta",
|
||||||
"symfony/dependency-injection": "^7.1@beta",
|
"symfony/dependency-injection": "^7.1@beta",
|
||||||
|
|
|
@ -80,9 +80,6 @@ class UrlHelper {
|
||||||
* The data compressed into a URL-safe string.
|
* The data compressed into a URL-safe string.
|
||||||
*/
|
*/
|
||||||
public static function compressQueryParameter(string $data): string {
|
public static function compressQueryParameter(string $data): string {
|
||||||
if (!\extension_loaded('zlib')) {
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
// Use 'base64url' encoding. Note that the '=' sign is only used for padding
|
// Use 'base64url' encoding. Note that the '=' sign is only used for padding
|
||||||
// on the right of the string, and is otherwise not part of the data.
|
// on the right of the string, and is otherwise not part of the data.
|
||||||
// @see https://datatracker.ietf.org/doc/html/rfc4648#section-5
|
// @see https://datatracker.ietf.org/doc/html/rfc4648#section-5
|
||||||
|
@ -104,9 +101,6 @@ class UrlHelper {
|
||||||
* uncompressed.
|
* uncompressed.
|
||||||
*/
|
*/
|
||||||
public static function uncompressQueryParameter(string $compressed): string {
|
public static function uncompressQueryParameter(string $compressed): string {
|
||||||
if (!\extension_loaded('zlib')) {
|
|
||||||
return $compressed;
|
|
||||||
}
|
|
||||||
// Because this comes from user data, suppress the PHP warning that
|
// Because this comes from user data, suppress the PHP warning that
|
||||||
// gzcompress() throws if the base64-encoded string is invalid.
|
// gzcompress() throws if the base64-encoded string is invalid.
|
||||||
$return = @gzuncompress(base64_decode(str_replace(['-', '_'], ['+', '/'], $compressed)));
|
$return = @gzuncompress(base64_decode(str_replace(['-', '_'], ['+', '/'], $compressed)));
|
||||||
|
|
|
@ -60,15 +60,14 @@ class AssetDumper implements AssetDumperUriInterface {
|
||||||
catch (FileException $e) {
|
catch (FileException $e) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
// If CSS/JS gzip compression is enabled and the zlib extension is available
|
// If CSS/JS gzip compression is enabled then create a gzipped version of
|
||||||
// then create a gzipped version of this file. This file is served
|
// this file. This file is served conditionally to browsers that accept gzip
|
||||||
// conditionally to browsers that accept gzip using .htaccess rules.
|
// using .htaccess rules. It's possible that the rewrite rules in .htaccess
|
||||||
// It's possible that the rewrite rules in .htaccess aren't working on this
|
// aren't working on this server, but there's no harm (other than the time
|
||||||
// server, but there's no harm (other than the time spent generating the
|
// spent generating the file) in generating the file anyway. Sites on
|
||||||
// file) in generating the file anyway. Sites on servers where rewrite rules
|
// servers where rewrite rules aren't working can set css.gzip to FALSE in
|
||||||
// aren't working can set css.gzip to FALSE in order to skip
|
// order to skip generating a file that won't be used.
|
||||||
// generating a file that won't be used.
|
if (\Drupal::config('system.performance')->get($file_extension . '.gzip')) {
|
||||||
if (extension_loaded('zlib') && \Drupal::config('system.performance')->get($file_extension . '.gzip')) {
|
|
||||||
try {
|
try {
|
||||||
if (!file_exists($uri . '.gz') && !$this->fileSystem->saveData(gzencode($data, 9, FORCE_GZIP), $uri . '.gz', FileExists::Replace)) {
|
if (!file_exists($uri . '.gz') && !$this->fileSystem->saveData(gzencode($data, 9, FORCE_GZIP), $uri . '.gz', FileExists::Replace)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -84,17 +84,6 @@ abstract class UpdatePathTestBase extends BrowserTestBase {
|
||||||
*/
|
*/
|
||||||
protected $strictConfigSchema = FALSE;
|
protected $strictConfigSchema = FALSE;
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
protected function setUp(): void {
|
|
||||||
if (!extension_loaded('zlib')) {
|
|
||||||
$this->markTestSkipped('The zlib extension is not available.');
|
|
||||||
}
|
|
||||||
|
|
||||||
parent::setUp();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overrides BrowserTestBase::installDrupal() for update testing.
|
* Overrides BrowserTestBase::installDrupal() for update testing.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue