1
0
Fork 0

Fix openssl/pcre matches, and skip other exts properly

pull/824/head
Jordi Boggiano 2012-06-22 20:07:41 +02:00
parent 887d913eb6
commit 95bc5c4898
1 changed files with 21 additions and 20 deletions

View File

@ -80,12 +80,13 @@ class PlatformRepository extends ArrayRepository
break;
case 'openssl':
$prettyVersion = str_replace('OpenSSL', '', OPENSSL_VERSION_TEXT);
$prettyVersion = trim($prettyVersion);
$prettyVersion = preg_replace_callback('{^(?:OpenSSL\s*)?([0-9.]+)([a-z]?).*}', function ($match) {
return $match[1] . (empty($match[2]) ? '' : '.'.(ord($match[2]) - 96));
}, OPENSSL_VERSION_TEXT);
break;
case 'pcre':
$prettyVersion = PCRE_VERSION;
$prettyVersion = preg_replace('{^(\S+).*}', '$1', PCRE_VERSION);
break;
case 'uuid':
@ -98,7 +99,7 @@ class PlatformRepository extends ArrayRepository
default:
// None handled extensions have no special cases, skip
continue;
continue 2;
}
try {
@ -107,9 +108,9 @@ class PlatformRepository extends ArrayRepository
continue;
}
$ext = new MemoryPackage('lib-'.$name, $version, $prettyVersion);
$ext->setDescription('The '.$name.' PHP library');
parent::addPackage($ext);
$lib = new MemoryPackage('lib-'.$name, $version, $prettyVersion);
$lib->setDescription('The '.$name.' PHP library');
parent::addPackage($lib);
}
}
}