xref: /PHP-8.1/ext/ldap/ldap.stub.php (revision 6a47831e)
1<?php
2
3/** @generate-class-entries */
4
5namespace LDAP {
6
7    /**
8     * @strict-properties
9     * @not-serializable
10     */
11    final class Connection
12    {
13    }
14
15    /**
16     * @strict-properties
17     * @not-serializable
18     */
19    final class Result
20    {
21    }
22
23    /**
24     * @strict-properties
25     * @not-serializable
26     */
27    final class ResultEntry
28    {
29    }
30
31}
32
33namespace {
34
35    #ifdef HAVE_ORALDAP
36    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 {}
37    #else
38    function ldap_connect(?string $uri = null, int $port = 389): LDAP\Connection|false {}
39    #endif
40
41    function ldap_unbind(LDAP\Connection $ldap): bool {}
42
43    /** @alias ldap_unbind */
44    function ldap_close(LDAP\Connection $ldap): bool {}
45
46    function ldap_bind(LDAP\Connection $ldap, ?string $dn = null, ?string $password = null): bool {}
47
48    function ldap_bind_ext(LDAP\Connection $ldap, ?string $dn = null, ?string $password = null, ?array $controls = null): LDAP\Result|false {}
49
50    #ifdef HAVE_LDAP_SASL
51    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 {}
52    #endif
53
54    /** @param LDAP\Connection|array $ldap */
55    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 {}
56
57    /** @param LDAP\Connection|array $ldap */
58    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 {}
59
60    /** @param LDAP\Connection|array $ldap */
61    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 {}
62
63    function ldap_free_result(LDAP\Result $result): bool {}
64
65    function ldap_count_entries(LDAP\Connection $ldap, LDAP\Result $result): int {}
66
67    function ldap_first_entry(LDAP\Connection $ldap, LDAP\Result $result): LDAP\ResultEntry|false {}
68
69    function ldap_next_entry(LDAP\Connection $ldap, LDAP\ResultEntry $entry): LDAP\ResultEntry|false {}
70
71    /**
72     * @return array<int|string, int|array>|false
73     * @refcount 1
74     */
75    function ldap_get_entries(LDAP\Connection $ldap, LDAP\Result $result): array|false {}
76
77    function ldap_first_attribute(LDAP\Connection $ldap, LDAP\ResultEntry $entry): string|false {}
78
79    function ldap_next_attribute(LDAP\Connection $ldap, LDAP\ResultEntry $entry): string|false {}
80
81    /**
82     * @return array<int|string, int|string|array>
83     * @refcount 1
84     */
85    function ldap_get_attributes(LDAP\Connection $ldap, LDAP\ResultEntry $entry): array {}
86
87    /**
88     * @return array<int|string, int|string>|false
89     * @refcount 1
90     */
91    function ldap_get_values_len(LDAP\Connection $ldap, LDAP\ResultEntry $entry, string $attribute): array|false {}
92
93    /**
94     * @return array<int|string, int|string>|false
95     * @refcount 1
96     * @alias ldap_get_values_len
97     */
98    function ldap_get_values(LDAP\Connection $ldap, LDAP\ResultEntry $entry, string $attribute): array|false {}
99
100    function ldap_get_dn(LDAP\Connection $ldap, LDAP\ResultEntry $entry): string|false {}
101
102    /**
103     * @return array<int|string, int|string>|false
104     * @refcount 1
105     */
106    function ldap_explode_dn(string $dn, int $with_attrib): array|false {}
107
108    function ldap_dn2ufn(string $dn): string|false {}
109
110    function ldap_add(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): bool {}
111
112    function ldap_add_ext(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): LDAP\Result|false {}
113
114    function ldap_delete(LDAP\Connection $ldap, string $dn, ?array $controls = null): bool {}
115
116    function ldap_delete_ext(LDAP\Connection $ldap, string $dn, ?array $controls = null): LDAP\Result|false {}
117
118    function ldap_modify_batch(LDAP\Connection $ldap, string $dn, array $modifications_info, ?array $controls = null): bool {}
119
120    function ldap_mod_add(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): bool {}
121
122    function ldap_mod_add_ext(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): LDAP\Result|false {}
123
124    function ldap_mod_replace(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): bool {}
125
126    /** @alias ldap_mod_replace */
127    function ldap_modify(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): bool {}
128
129    function ldap_mod_replace_ext(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): LDAP\Result|false {}
130
131    function ldap_mod_del(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): bool {}
132
133    function ldap_mod_del_ext(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): LDAP\Result|false {}
134
135    function ldap_errno(LDAP\Connection $ldap): int {}
136
137    function ldap_error(LDAP\Connection $ldap): string {}
138
139    function ldap_err2str(int $errno): string {}
140
141    function ldap_compare(LDAP\Connection $ldap, string $dn, string $attribute, string $value, ?array $controls = null): bool|int {}
142
143    #if (LDAP_API_VERSION > 2000) || defined(HAVE_ORALDAP)
144    function ldap_rename(LDAP\Connection $ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, ?array $controls = null): bool {}
145
146    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 {}
147
148    /** @param array|string|int $value */
149    function ldap_get_option(LDAP\Connection $ldap, int $option, &$value = null): bool {}
150
151    /** @param array|string|int|bool $value */
152    function ldap_set_option(?LDAP\Connection $ldap, int $option, $value): bool {}
153
154    function ldap_count_references(LDAP\Connection $ldap, LDAP\Result $result): int {}
155
156    function ldap_first_reference(LDAP\Connection $ldap, LDAP\Result $result): LDAP\ResultEntry|false {}
157
158    function ldap_next_reference(LDAP\Connection $ldap, LDAP\ResultEntry $entry): LDAP\ResultEntry|false {}
159
160    #ifdef HAVE_LDAP_PARSE_REFERENCE
161    /** @param array $referrals */
162    function ldap_parse_reference(LDAP\Connection $ldap, LDAP\ResultEntry $entry, &$referrals): bool {}
163    #endif
164
165    #ifdef HAVE_LDAP_PARSE_RESULT
166    /**
167     * @param int $error_code
168     * @param string $matched_dn
169     * @param string $error_message
170     * @param array $referrals
171     * @param array $controls
172     */
173    function ldap_parse_result(LDAP\Connection $ldap, LDAP\Result $result, &$error_code, &$matched_dn = null, &$error_message = null, &$referrals = null, &$controls = null): bool {}
174    #endif
175    #endif
176
177    #if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC)
178    function ldap_set_rebind_proc(LDAP\Connection $ldap, ?callable $callback): bool {}
179    #endif
180
181    #ifdef HAVE_LDAP_START_TLS_S
182    function ldap_start_tls(LDAP\Connection $ldap): bool {}
183    #endif
184
185    function ldap_escape(string $value, string $ignore = "", int $flags = 0): string {}
186
187    #ifdef STR_TRANSLATION
188    function ldap_t61_to_8859(string $value): string|false {}
189
190    function ldap_8859_to_t61(string $value): string|false {}
191    #endif
192
193
194    #ifdef HAVE_LDAP_EXTENDED_OPERATION_S
195    /**
196     * @param string $response_data
197     * @param string $response_oid
198     */
199    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 {}
200    #endif
201
202    #ifdef HAVE_LDAP_PASSWD
203    /**
204     * @param array $controls
205     */
206    function ldap_exop_passwd(LDAP\Connection $ldap, string $user = "", string $old_password = "", string $new_password = "", &$controls = null): string|bool {}
207    #endif
208
209
210    #ifdef HAVE_LDAP_WHOAMI_S
211    function ldap_exop_whoami(LDAP\Connection $ldap): string|false {}
212    #endif
213
214    #ifdef HAVE_LDAP_REFRESH_S
215    function ldap_exop_refresh(LDAP\Connection $ldap, string $dn, int $ttl): int|false {}
216    #endif
217
218    #ifdef HAVE_LDAP_PARSE_EXTENDED_RESULT
219    /**
220     * @param string $response_data
221     * @param string $response_oid
222     */
223    function ldap_parse_exop(LDAP\Connection $ldap, LDAP\Result $result, &$response_data = null, &$response_oid = null): bool {}
224    #endif
225
226}
227