mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 09:25:35 +08:00
add ldap patches (why ext-ldap doesn't use pkg-config to find ldap?)
This commit is contained in:
23
src/SPC/builder/extension/ldap.php
Normal file
23
src/SPC/builder/extension/ldap.php
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
|
use SPC\builder\Extension;
|
||||||
|
use SPC\store\FileSystem;
|
||||||
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
|
#[CustomExt('ldap')]
|
||||||
|
class ldap extends Extension
|
||||||
|
{
|
||||||
|
public function patchBeforeConfigure(): bool
|
||||||
|
{
|
||||||
|
$output = shell()->execWithResult('$PKG_CONFIG --libs-only-l --static ldap');
|
||||||
|
if (!empty($output[1][0])) {
|
||||||
|
$libs = $output[1][0];
|
||||||
|
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/configure', '-lldap ', $libs . ' ');
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user