From 71ddc487fec43696d5905c1d6928a8b262bac2c4 Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Thu, 4 Jun 2020 23:05:22 +0700 Subject: [PATCH] Platform Check: Add a special case for `zend-opcache`. Ref #8946 The platform-check feature maps `ext-X` to `extension_loaded('X')` calls. While most of the extensions can be tested this way, the `zend-opcache` extension requires `zend opcache` to be probed instead of the `zend-opcache` name. This commit adds a special case for `zend-opcache` to use the correct name in `extension_loaded()` calls in generated `platform_check.php` file. --- src/Composer/Autoload/AutoloadGenerator.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index 4dee65417..b74e4bd9b 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -640,6 +640,10 @@ EOF; } } + if ($match[1] === 'zend-opcache') { + $match[1] = 'zend opcache'; + } + $extension = var_export($match[1], true); if ($match[1] === 'pcntl' || $match[1] === 'readline') { $requiredExtensions[$extension] = "PHP_SAPI !== 'cli' || extension_loaded($extension) || \$missingExtensions[] = $extension;\n";