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