Skip to content

Commit

Permalink
Add ldap_exop_sync() polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
IonBazan committed Jul 31, 2023
1 parent 8fd715e commit 64a5f49
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Php83/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/

use Symfony\Polyfill\Php83 as p;
use LDAP;

if (\PHP_VERSION_ID >= 80300) {
return;
Expand All @@ -26,3 +27,11 @@ function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $
if (!function_exists('stream_context_set_options')) {
function stream_context_set_options($context, array $options): bool { return stream_context_set_option($context, $options); }
}

if (!function_exists('ldap_exop_sync') && function_exists('ldap_exop')) {
if (\PHP_VERSION_ID >= 80100) {
function ldap_exop_sync(LDAP\Connection $ldap, string $request_oid, ?string $request_data = null, ?array $controls = null, &$response_data = null, &$response_oid = null): bool { return ldap_exop($ldap, $request_oid, $request_data, $controls, $response_data, $response_oid); }
} else {
function ldap_exop_sync($ldap, string $request_oid, ?string $request_data = null, ?array $controls = null, &$response_data = null, &$response_oid = null): bool { return ldap_exop($ldap, $request_oid, $request_data, $controls, $response_data, $response_oid); }
}
}

0 comments on commit 64a5f49

Please sign in to comment.