ldap.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <?php
  2. /** @generate-class-entries */
  3. namespace LDAP {
  4. /**
  5. * @strict-properties
  6. * @not-serializable
  7. */
  8. final class Connection
  9. {
  10. }
  11. /**
  12. * @strict-properties
  13. * @not-serializable
  14. */
  15. final class Result
  16. {
  17. }
  18. /**
  19. * @strict-properties
  20. * @not-serializable
  21. */
  22. final class ResultEntry
  23. {
  24. }
  25. }
  26. namespace {
  27. #ifdef HAVE_ORALDAP
  28. function ldap_connect(?string $uri = null, int $port = 389, string $wallet = UNKNOWN, string $password = UNKNOWN, int $auth_mode = GSLC_SSL_NO_AUTH): LDAP\Connection|false {}
  29. #else
  30. function ldap_connect(?string $uri = null, int $port = 389): LDAP\Connection|false {}
  31. #endif
  32. function ldap_unbind(LDAP\Connection $ldap): bool {}
  33. /** @alias ldap_unbind */
  34. function ldap_close(LDAP\Connection $ldap): bool {}
  35. function ldap_bind(LDAP\Connection $ldap, ?string $dn = null, ?string $password = null): bool {}
  36. function ldap_bind_ext(LDAP\Connection $ldap, ?string $dn = null, ?string $password = null, ?array $controls = null): LDAP\Result|false {}
  37. #ifdef HAVE_LDAP_SASL
  38. function ldap_sasl_bind(LDAP\Connection $ldap, ?string $dn = null, ?string $password = null, ?string $mech = null, ?string $realm = null, ?string $authc_id = null, ?string $authz_id = null, ?string $props = null): bool {}
  39. #endif
  40. /** @param LDAP\Connection|array $ldap */
  41. function ldap_read($ldap, array|string $base, array|string $filter, array $attributes = [], int $attributes_only = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, ?array $controls = null): LDAP\Result|array|false {}
  42. /** @param LDAP\Connection|array $ldap */
  43. function ldap_list($ldap, array|string $base, array|string $filter, array $attributes = [], int $attributes_only = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, ?array $controls = null): LDAP\Result|array|false {}
  44. /** @param LDAP\Connection|array $ldap */
  45. function ldap_search($ldap, array|string $base, array|string $filter, array $attributes = [], int $attributes_only = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, ?array $controls = null): LDAP\Result|array|false {}
  46. function ldap_free_result(LDAP\Result $result): bool {}
  47. function ldap_count_entries(LDAP\Connection $ldap, LDAP\Result $result): int {}
  48. function ldap_first_entry(LDAP\Connection $ldap, LDAP\Result $result): LDAP\ResultEntry|false {}
  49. function ldap_next_entry(LDAP\Connection $ldap, LDAP\ResultEntry $entry): LDAP\ResultEntry|false {}
  50. /**
  51. * @return array<int|string, int|array>|false
  52. * @refcount 1
  53. */
  54. function ldap_get_entries(LDAP\Connection $ldap, LDAP\Result $result): array|false {}
  55. function ldap_first_attribute(LDAP\Connection $ldap, LDAP\ResultEntry $entry): string|false {}
  56. function ldap_next_attribute(LDAP\Connection $ldap, LDAP\ResultEntry $entry): string|false {}
  57. /**
  58. * @return array<int|string, int|string|array>
  59. * @refcount 1
  60. */
  61. function ldap_get_attributes(LDAP\Connection $ldap, LDAP\ResultEntry $entry): array {}
  62. /**
  63. * @return array<int|string, int|string>|false
  64. * @refcount 1
  65. */
  66. function ldap_get_values_len(LDAP\Connection $ldap, LDAP\ResultEntry $entry, string $attribute): array|false {}
  67. /**
  68. * @return array<int|string, int|string>|false
  69. * @refcount 1
  70. * @alias ldap_get_values_len
  71. */
  72. function ldap_get_values(LDAP\Connection $ldap, LDAP\ResultEntry $entry, string $attribute): array|false {}
  73. function ldap_get_dn(LDAP\Connection $ldap, LDAP\ResultEntry $entry): string|false {}
  74. /**
  75. * @return array<int|string, int|string>|false
  76. * @refcount 1
  77. */
  78. function ldap_explode_dn(string $dn, int $with_attrib): array|false {}
  79. function ldap_dn2ufn(string $dn): string|false {}
  80. function ldap_add(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): bool {}
  81. function ldap_add_ext(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): LDAP\Result|false {}
  82. function ldap_delete(LDAP\Connection $ldap, string $dn, ?array $controls = null): bool {}
  83. function ldap_delete_ext(LDAP\Connection $ldap, string $dn, ?array $controls = null): LDAP\Result|false {}
  84. function ldap_modify_batch(LDAP\Connection $ldap, string $dn, array $modifications_info, ?array $controls = null): bool {}
  85. function ldap_mod_add(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): bool {}
  86. function ldap_mod_add_ext(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): LDAP\Result|false {}
  87. function ldap_mod_replace(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): bool {}
  88. /** @alias ldap_mod_replace */
  89. function ldap_modify(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): bool {}
  90. function ldap_mod_replace_ext(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): LDAP\Result|false {}
  91. function ldap_mod_del(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): bool {}
  92. function ldap_mod_del_ext(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): LDAP\Result|false {}
  93. function ldap_errno(LDAP\Connection $ldap): int {}
  94. function ldap_error(LDAP\Connection $ldap): string {}
  95. function ldap_err2str(int $errno): string {}
  96. function ldap_compare(LDAP\Connection $ldap, string $dn, string $attribute, string $value, ?array $controls = null): bool|int {}
  97. #if (LDAP_API_VERSION > 2000) || defined(HAVE_ORALDAP)
  98. function ldap_rename(LDAP\Connection $ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, ?array $controls = null): bool {}
  99. function ldap_rename_ext(LDAP\Connection $ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, ?array $controls = null): LDAP\Result|false {}
  100. /** @param array|string|int $value */
  101. function ldap_get_option(LDAP\Connection $ldap, int $option, &$value = null): bool {}
  102. /** @param array|string|int|bool $value */
  103. function ldap_set_option(?LDAP\Connection $ldap, int $option, $value): bool {}
  104. function ldap_count_references(LDAP\Connection $ldap, LDAP\Result $result): int {}
  105. function ldap_first_reference(LDAP\Connection $ldap, LDAP\Result $result): LDAP\ResultEntry|false {}
  106. function ldap_next_reference(LDAP\Connection $ldap, LDAP\ResultEntry $entry): LDAP\ResultEntry|false {}
  107. #ifdef HAVE_LDAP_PARSE_REFERENCE
  108. /** @param array $referrals */
  109. function ldap_parse_reference(LDAP\Connection $ldap, LDAP\ResultEntry $entry, &$referrals): bool {}
  110. #endif
  111. #ifdef HAVE_LDAP_PARSE_RESULT
  112. /**
  113. * @param int $error_code
  114. * @param string $matched_dn
  115. * @param string $error_message
  116. * @param array $referrals
  117. * @param array $controls
  118. */
  119. function ldap_parse_result(LDAP\Connection $ldap, LDAP\Result $result, &$error_code, &$matched_dn = null, &$error_message = null, &$referrals = null, &$controls = null): bool {}
  120. #endif
  121. #endif
  122. #if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC)
  123. function ldap_set_rebind_proc(LDAP\Connection $ldap, ?callable $callback): bool {}
  124. #endif
  125. #ifdef HAVE_LDAP_START_TLS_S
  126. function ldap_start_tls(LDAP\Connection $ldap): bool {}
  127. #endif
  128. function ldap_escape(string $value, string $ignore = "", int $flags = 0): string {}
  129. #ifdef STR_TRANSLATION
  130. function ldap_t61_to_8859(string $value): string|false {}
  131. function ldap_8859_to_t61(string $value): string|false {}
  132. #endif
  133. #ifdef HAVE_LDAP_EXTENDED_OPERATION_S
  134. /**
  135. * @param string $response_data
  136. * @param string $response_oid
  137. */
  138. function ldap_exop(LDAP\Connection $ldap, string $request_oid, ?string $request_data = null, ?array $controls = NULL, &$response_data = UNKNOWN, &$response_oid = null): LDAP\Result|bool {}
  139. #endif
  140. #ifdef HAVE_LDAP_PASSWD
  141. /**
  142. * @param array $controls
  143. */
  144. function ldap_exop_passwd(LDAP\Connection $ldap, string $user = "", string $old_password = "", string $new_password = "", &$controls = null): string|bool {}
  145. #endif
  146. #ifdef HAVE_LDAP_WHOAMI_S
  147. function ldap_exop_whoami(LDAP\Connection $ldap): string|false {}
  148. #endif
  149. #ifdef HAVE_LDAP_REFRESH_S
  150. function ldap_exop_refresh(LDAP\Connection $ldap, string $dn, int $ttl): int|false {}
  151. #endif
  152. #ifdef HAVE_LDAP_PARSE_EXTENDED_RESULT
  153. /**
  154. * @param string $response_data
  155. * @param string $response_oid
  156. */
  157. function ldap_parse_exop(LDAP\Connection $ldap, LDAP\Result $result, &$response_data = null, &$response_oid = null): bool {}
  158. #endif
  159. }