1
0
Fork 0

PlatformRepository library support for libpq (from ext-pq) and librdkafka (from ext-rdkafka) (#11418)

* libpq library version info for ext-pq

* librdkafka library version info for ext-rdkafka

Computes from RD_KAFKA_VERSION, faster than output buffering
pull/11442/head
David Zülke 2023-04-25 13:59:36 +02:00 committed by GitHub
parent 4e17745180
commit e0c1ad1448
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 0 deletions

View File

@ -450,6 +450,32 @@ class PlatformRepository extends ArrayRepository
}
break;
case 'pq':
$info = $this->runtime->getExtensionInfo($name);
// Used Library => Compiled => Linked
// libpq => 14.3 (Ubuntu 14.3-1.pgdg22.04+1) => 15.0.2
if (Preg::isMatch('/^libpq => (?<compiled>.+) => (?<linked>.+)$/im', $info, $matches)) {
$this->addLibrary($name.'-libpq', $matches['linked'], 'libpq for '.$name);
}
break;
case 'rdkafka':
if ($this->runtime->hasConstant('RD_KAFKA_VERSION')) {
/**
* Interpreted as hex \c MM.mm.rr.xx:
* - MM = Major
* - mm = minor
* - rr = revision
* - xx = pre-release id (0xff is the final release)
*
* pre-release ID in practice is always 0xff even for RCs etc, so we ignore it
*/
$libRdKafkaVersionInt = $this->runtime->getConstant('RD_KAFKA_VERSION');
$this->addLibrary($name.'-librdkafka', sprintf('%d.%d.%d', ($libRdKafkaVersionInt & 0xFF000000) >> 24, ($libRdKafkaVersionInt & 0x00FF0000) >> 16, ($libRdKafkaVersionInt & 0x0000FF00) >> 8), 'librdkafka for '.$name);
}
break;
case 'libsodium':
case 'sodium':
if ($this->runtime->hasConstant('SODIUM_LIBRARY_VERSION')) {

View File

@ -960,6 +960,25 @@ Module version => 7.1.33
Revision => $Id: 9c5f356c77143981d2e905e276e439501fe0f419 $',
['lib-pdo_pgsql-libpq' => '12.1'],
],
'pq' => [
'pq',
'pq
PQ Support => enabled
Extension Version => 2.2.0
Used Library => Compiled => Linked
libpq => 14.3 (Ubuntu 14.3-1.pgdg22.04+1) => 15.0.2
',
['lib-pq-libpq' => '15.0.2'],
],
'rdkafka' => [
'rdkafka',
null,
['lib-rdkafka-librdkafka' => '1.9.2'],
[],
[['RD_KAFKA_VERSION', null, 17367807]],
],
'libsodium' => [
'libsodium',
null,