Skip to content

Commit f72f359

Browse files
committed
[LDAP] Rename \LDAP\LDAP to \LDAP\Connection
1 parent 56402ee commit f72f359

8 files changed

+104
-104
lines changed

NEWS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ PHP NEWS
6464
. Implemented FR #73385 (Add xxHash support). (Anatol)
6565

6666
- LDAP:
67-
. Convert resource<ldap link> to object \LDAP\LDAP. (Máté)
67+
. Convert resource<ldap link> to object \LDAP\Connection. (Máté)
6868
. Convert resource<ldap result> to object \LDAP\Result. (Máté)
6969
. Convert resource<ldap result entry> to object \LDAP\ResultEntry. (Máté)
7070

UPGRADING

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ PHP 8.1 UPGRADE NOTES
7171
instead of resources.
7272

7373
- LDAP:
74-
. The LDAP functions now accept and return, respectively, LDAP\LDAP objects
74+
. The LDAP functions now accept and return, respectively, LDAP\Connection objects
7575
instead of "ldap link" resources. Return value checks using is_resource()
7676
should be replaced with checks for `false`.
7777
. The LDAP functions now accept and return, respectively, LDAP\Result objects

ext/ldap/ldap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static zend_object *ldap_link_create_object(zend_class_entry *class_type) {
121121
}
122122

123123
static zend_function *ldap_link_get_constructor(zend_object *object) {
124-
zend_throw_error(NULL, "Cannot directly construct LDAP\\LDAP, use ldap_create() instead");
124+
zend_throw_error(NULL, "Cannot directly construct LDAP\\Connection, use ldap_create() instead");
125125
return NULL;
126126
}
127127

@@ -826,7 +826,7 @@ PHP_MINIT_FUNCTION(ldap)
826826
{
827827
REGISTER_INI_ENTRIES();
828828

829-
ldap_link_ce = register_class_LDAP_LDAP();
829+
ldap_link_ce = register_class_LDAP_Connection();
830830
ldap_link_ce->create_object = ldap_link_create_object;
831831
ldap_link_ce->serialize = zend_class_serialize_deny;
832832
ldap_link_ce->unserialize = zend_class_unserialize_deny;

ext/ldap/ldap.stub.php

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace LDAP {
66
/** @strict-properties */
7-
final class LDAP
7+
final class Connection
88
{
99
}
1010

@@ -22,115 +22,115 @@ final class ResultEntry
2222
namespace {
2323

2424
#ifdef HAVE_ORALDAP
25-
function ldap_connect(?string $uri = null, int $port = 389, string $wallet = UNKNOWN, string $password = UNKNOWN, int $auth_mode = GSLC_SSL_NO_AUTH): LDAP\LDAP|false {}
25+
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 {}
2626
#else
27-
function ldap_connect(?string $uri = null, int $port = 389): LDAP\LDAP|false {}
27+
function ldap_connect(?string $uri = null, int $port = 389): LDAP\Connection|false {}
2828
#endif
2929

30-
function ldap_unbind(LDAP\LDAP $ldap): bool {}
30+
function ldap_unbind(LDAP\Connection $ldap): bool {}
3131

3232
/** @alias ldap_unbind */
33-
function ldap_close(LDAP\LDAP $ldap): bool {}
33+
function ldap_close(LDAP\Connection $ldap): bool {}
3434

35-
function ldap_bind(LDAP\LDAP $ldap, ?string $dn = null, ?string $password = null): bool {}
35+
function ldap_bind(LDAP\Connection $ldap, ?string $dn = null, ?string $password = null): bool {}
3636

37-
function ldap_bind_ext(LDAP\LDAP $ldap, ?string $dn = null, ?string $password = null, ?array $controls = null): LDAP\Result|false {}
37+
function ldap_bind_ext(LDAP\Connection $ldap, ?string $dn = null, ?string $password = null, ?array $controls = null): LDAP\Result|false {}
3838

3939
#ifdef HAVE_LDAP_SASL
40-
function ldap_sasl_bind(LDAP\LDAP $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 {}
40+
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 {}
4141
#endif
4242

43-
/** @param LDAP\LDAP|array $ldap */
43+
/** @param LDAP\Connection|array $ldap */
4444
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 {}
4545

46-
/** @param LDAP\LDAP|array $ldap */
46+
/** @param LDAP\Connection|array $ldap */
4747
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 {}
4848

49-
/** @param LDAP\LDAP|array $ldap */
49+
/** @param LDAP\Connection|array $ldap */
5050
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 {}
5151

5252
function ldap_free_result(LDAP\Result $result): bool {}
5353

54-
function ldap_count_entries(LDAP\LDAP $ldap, LDAP\Result $result): int {}
54+
function ldap_count_entries(LDAP\Connection $ldap, LDAP\Result $result): int {}
5555

56-
function ldap_first_entry(LDAP\LDAP $ldap, LDAP\Result $result): LDAP\ResultEntry|false {}
56+
function ldap_first_entry(LDAP\Connection $ldap, LDAP\Result $result): LDAP\ResultEntry|false {}
5757

58-
function ldap_next_entry(LDAP\LDAP $ldap, LDAP\ResultEntry $entry): LDAP\ResultEntry|false {}
58+
function ldap_next_entry(LDAP\Connection $ldap, LDAP\ResultEntry $entry): LDAP\ResultEntry|false {}
5959

60-
function ldap_get_entries(LDAP\LDAP $ldap, LDAP\Result $result): array|false {}
60+
function ldap_get_entries(LDAP\Connection $ldap, LDAP\Result $result): array|false {}
6161

62-
function ldap_first_attribute(LDAP\LDAP $ldap, LDAP\ResultEntry $entry): string|false {}
62+
function ldap_first_attribute(LDAP\Connection $ldap, LDAP\ResultEntry $entry): string|false {}
6363

64-
function ldap_next_attribute(LDAP\LDAP $ldap, LDAP\ResultEntry $entry): string|false {}
64+
function ldap_next_attribute(LDAP\Connection $ldap, LDAP\ResultEntry $entry): string|false {}
6565

66-
function ldap_get_attributes(LDAP\LDAP $ldap, LDAP\ResultEntry $entry): array {}
66+
function ldap_get_attributes(LDAP\Connection $ldap, LDAP\ResultEntry $entry): array {}
6767

68-
function ldap_get_values_len(LDAP\LDAP $ldap, LDAP\ResultEntry $entry, string $attribute): array|false {}
68+
function ldap_get_values_len(LDAP\Connection $ldap, LDAP\ResultEntry $entry, string $attribute): array|false {}
6969

7070
/** @alias ldap_get_values_len */
71-
function ldap_get_values(LDAP\LDAP $ldap, LDAP\ResultEntry $entry, string $attribute): array|false {}
71+
function ldap_get_values(LDAP\Connection $ldap, LDAP\ResultEntry $entry, string $attribute): array|false {}
7272

73-
function ldap_get_dn(LDAP\LDAP $ldap, LDAP\ResultEntry $entry): string|false {}
73+
function ldap_get_dn(LDAP\Connection $ldap, LDAP\ResultEntry $entry): string|false {}
7474

7575
function ldap_explode_dn(string $dn, int $with_attrib): array|false {}
7676

7777
function ldap_dn2ufn(string $dn): string|false {}
7878

79-
function ldap_add(LDAP\LDAP $ldap, string $dn, array $entry, ?array $controls = null): bool {}
79+
function ldap_add(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): bool {}
8080

81-
function ldap_add_ext(LDAP\LDAP $ldap, string $dn, array $entry, ?array $controls = null): LDAP\Result|false {}
81+
function ldap_add_ext(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): LDAP\Result|false {}
8282

83-
function ldap_delete(LDAP\LDAP $ldap, string $dn, ?array $controls = null): bool {}
83+
function ldap_delete(LDAP\Connection $ldap, string $dn, ?array $controls = null): bool {}
8484

85-
function ldap_delete_ext(LDAP\LDAP $ldap, string $dn, ?array $controls = null): LDAP\Result|false {}
85+
function ldap_delete_ext(LDAP\Connection $ldap, string $dn, ?array $controls = null): LDAP\Result|false {}
8686

87-
function ldap_modify_batch(LDAP\LDAP $ldap, string $dn, array $modifications_info, ?array $controls = null): bool {}
87+
function ldap_modify_batch(LDAP\Connection $ldap, string $dn, array $modifications_info, ?array $controls = null): bool {}
8888

89-
function ldap_mod_add(LDAP\LDAP $ldap, string $dn, array $entry, ?array $controls = null): bool {}
89+
function ldap_mod_add(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): bool {}
9090

91-
function ldap_mod_add_ext(LDAP\LDAP $ldap, string $dn, array $entry, ?array $controls = null): LDAP\Result|false {}
91+
function ldap_mod_add_ext(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): LDAP\Result|false {}
9292

93-
function ldap_mod_replace(LDAP\LDAP $ldap, string $dn, array $entry, ?array $controls = null): bool {}
93+
function ldap_mod_replace(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): bool {}
9494

9595
/** @alias ldap_mod_replace */
96-
function ldap_modify(LDAP\LDAP $ldap, string $dn, array $entry, ?array $controls = null): bool {}
96+
function ldap_modify(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): bool {}
9797

98-
function ldap_mod_replace_ext(LDAP\LDAP $ldap, string $dn, array $entry, ?array $controls = null): LDAP\Result|false {}
98+
function ldap_mod_replace_ext(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): LDAP\Result|false {}
9999

100-
function ldap_mod_del(LDAP\LDAP $ldap, string $dn, array $entry, ?array $controls = null): bool {}
100+
function ldap_mod_del(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): bool {}
101101

102-
function ldap_mod_del_ext(LDAP\LDAP $ldap, string $dn, array $entry, ?array $controls = null): LDAP\Result|false {}
102+
function ldap_mod_del_ext(LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): LDAP\Result|false {}
103103

104-
function ldap_errno(LDAP\LDAP $ldap): int {}
104+
function ldap_errno(LDAP\Connection $ldap): int {}
105105

106-
function ldap_error(LDAP\LDAP $ldap): string {}
106+
function ldap_error(LDAP\Connection $ldap): string {}
107107

108108
function ldap_err2str(int $errno): string {}
109109

110-
function ldap_compare(LDAP\LDAP $ldap, string $dn, string $attribute, string $value, ?array $controls = null): bool|int {}
110+
function ldap_compare(LDAP\Connection $ldap, string $dn, string $attribute, string $value, ?array $controls = null): bool|int {}
111111

112112
#if (LDAP_API_VERSION > 2000) || defined(HAVE_ORALDAP)
113-
function ldap_rename(LDAP\LDAP $ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, ?array $controls = null): bool {}
113+
function ldap_rename(LDAP\Connection $ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, ?array $controls = null): bool {}
114114

115-
function ldap_rename_ext(LDAP\LDAP $ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, ?array $controls = null): LDAP\Result|false {}
115+
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 {}
116116

117117
/**
118118
* @param array|string|int $value
119119
*/
120-
function ldap_get_option(LDAP\LDAP $ldap, int $option, &$value = null): bool {}
120+
function ldap_get_option(LDAP\Connection $ldap, int $option, &$value = null): bool {}
121121

122122
/** @param array|string|int|bool $value */
123-
function ldap_set_option(?LDAP\LDAP $ldap, int $option, $value): bool {}
123+
function ldap_set_option(?LDAP\Connection $ldap, int $option, $value): bool {}
124124

125-
function ldap_count_references(LDAP\LDAP $ldap, LDAP\Result $result): int {}
125+
function ldap_count_references(LDAP\Connection $ldap, LDAP\Result $result): int {}
126126

127-
function ldap_first_reference(LDAP\LDAP $ldap, LDAP\Result $result): LDAP\ResultEntry|false {}
127+
function ldap_first_reference(LDAP\Connection $ldap, LDAP\Result $result): LDAP\ResultEntry|false {}
128128

129-
function ldap_next_reference(LDAP\LDAP $ldap, LDAP\ResultEntry $entry): LDAP\ResultEntry|false {}
129+
function ldap_next_reference(LDAP\Connection $ldap, LDAP\ResultEntry $entry): LDAP\ResultEntry|false {}
130130

131131
#ifdef HAVE_LDAP_PARSE_REFERENCE
132132
/** @param array $referrals */
133-
function ldap_parse_reference(LDAP\LDAP $ldap, LDAP\ResultEntry $entry, &$referrals): bool {}
133+
function ldap_parse_reference(LDAP\Connection $ldap, LDAP\ResultEntry $entry, &$referrals): bool {}
134134
#endif
135135

136136
#ifdef HAVE_LDAP_PARSE_RESULT
@@ -141,16 +141,16 @@ function ldap_parse_reference(LDAP\LDAP $ldap, LDAP\ResultEntry $entry, &$referr
141141
* @param array $referrals
142142
* @param array $controls
143143
*/
144-
function ldap_parse_result(LDAP\LDAP $ldap, LDAP\Result $result, &$error_code, &$matched_dn = null, &$error_message = null, &$referrals = null, &$controls = null): bool {}
144+
function ldap_parse_result(LDAP\Connection $ldap, LDAP\Result $result, &$error_code, &$matched_dn = null, &$error_message = null, &$referrals = null, &$controls = null): bool {}
145145
#endif
146146
#endif
147147

148148
#if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC)
149-
function ldap_set_rebind_proc(LDAP\LDAP $ldap, ?callable $callback): bool {}
149+
function ldap_set_rebind_proc(LDAP\Connection $ldap, ?callable $callback): bool {}
150150
#endif
151151

152152
#ifdef HAVE_LDAP_START_TLS_S
153-
function ldap_start_tls(LDAP\LDAP $ldap): bool {}
153+
function ldap_start_tls(LDAP\Connection $ldap): bool {}
154154
#endif
155155

156156
function ldap_escape(string $value, string $ignore = "", int $flags = 0): string {}
@@ -167,31 +167,31 @@ function ldap_8859_to_t61(string $value): string|false {}
167167
* @param string $response_data
168168
* @param string $response_oid
169169
*/
170-
function ldap_exop(LDAP\LDAP $ldap, string $request_oid, ?string $request_data = null, ?array $controls = NULL, &$response_data = UNKNOWN, &$response_oid = null): LDAP\Result|bool {}
170+
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 {}
171171
#endif
172172

173173
#ifdef HAVE_LDAP_PASSWD
174174
/**
175175
* @param array $controls
176176
*/
177-
function ldap_exop_passwd(LDAP\LDAP $ldap, string $user = "", string $old_password = "", string $new_password = "", &$controls = null): string|bool {}
177+
function ldap_exop_passwd(LDAP\Connection $ldap, string $user = "", string $old_password = "", string $new_password = "", &$controls = null): string|bool {}
178178
#endif
179179

180180

181181
#ifdef HAVE_LDAP_WHOAMI_S
182-
function ldap_exop_whoami(LDAP\LDAP $ldap): string|false {}
182+
function ldap_exop_whoami(LDAP\Connection $ldap): string|false {}
183183
#endif
184184

185185
#ifdef HAVE_LDAP_REFRESH_S
186-
function ldap_exop_refresh(LDAP\LDAP $ldap, string $dn, int $ttl): int|false {}
186+
function ldap_exop_refresh(LDAP\Connection $ldap, string $dn, int $ttl): int|false {}
187187
#endif
188188

189189
#ifdef HAVE_LDAP_PARSE_EXTENDED_RESULT
190190
/**
191191
* @param string $response_data
192192
* @param string $response_oid
193193
*/
194-
function ldap_parse_exop(LDAP\LDAP $ldap, LDAP\Result $result, &$response_data = null, &$response_oid = null): bool {}
194+
function ldap_parse_exop(LDAP\Connection $ldap, LDAP\Result $result, &$response_data = null, &$response_oid = null): bool {}
195195
#endif
196196

197197
}

0 commit comments

Comments
 (0)