1
0
Fork 0

Fix problem report when requiring "ext-zend opcache", refs #2509

pull/7015/merge
Jordi Boggiano 2018-01-22 13:41:32 +01:00
parent 5a1765c838
commit 471b012e3a
2 changed files with 5 additions and 1 deletions

View File

@ -108,6 +108,10 @@ class Problem
// handle php extensions
if (0 === stripos($job['packageName'], 'ext-')) {
if (false !== strpos($job['packageName'], ' ')) {
return "\n - The requested PHP extension ".$job['packageName'].' should be required as '.str_replace(' ', '-', $job['packageName']).'.';
}
$ext = substr($job['packageName'], 4);
$error = extension_loaded($ext) ? 'has the wrong version ('.(phpversion($ext) ?: '0').') installed' : 'is missing from your system';

View File

@ -24,7 +24,7 @@ use Composer\Util\Silencer;
*/
class PlatformRepository extends ArrayRepository
{
const PLATFORM_PACKAGE_REGEX = '{^(?:php(?:-64bit|-ipv6|-zts|-debug)?|hhvm|(?:ext|lib)-[^/]+)$}i';
const PLATFORM_PACKAGE_REGEX = '{^(?:php(?:-64bit|-ipv6|-zts|-debug)?|hhvm|(?:ext|lib)-[^/ ]+)$}i';
private $versionParser;