From 432815df673d85e6df8553ef2d621459a4fef5b5 Mon Sep 17 00:00:00 2001 From: Christian Riesen Date: Fri, 22 Jun 2012 15:46:36 +0200 Subject: [PATCH] Added more libraries to PlatformRepository --- .../Repository/PlatformRepository.php | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php index a61fb2a64..5947a8442 100644 --- a/src/Composer/Repository/PlatformRepository.php +++ b/src/Composer/Repository/PlatformRepository.php @@ -69,32 +69,50 @@ class PlatformRepository extends ArrayRepository } // Another quick loop, just for possible libraries + // Doing it this way to know that functions or constants exist before + // relying on them. foreach ($loadedExtensions as $name) { switch ($name) { // Skipped "extensions" case 'standard': case 'Core': continue; - - // Curl exposes its version by the curl_version function + case 'curl': $curlVersion = curl_version(); $prettyVersion = $curlVersion['version']; break; - + + case 'iconv': + $prettyVersion = ICONV_VERSION; + break; + case 'libxml': $prettyVersion = LIBXML_DOTTED_VERSION; break; - + case 'openssl': $prettyVersion = str_replace('OpenSSL', '', OPENSSL_VERSION_TEXT); $prettyVersion = trim($prettyVersion); break; - + + case 'mysqli': + // not so pretty version + $prettyVersion = mysqli_get_client_version(); + break; + case 'pcre': $prettyVersion = PCRE_VERSION; break; + case 'uuid': + $prettyVersion = UUID_VERSION; + break; + + case 'xsl': + $prettyVersion = LIBXSLT_DOTTED_VERSION; + break; + default: // None handled extensions have no special cases, skip continue;