Commit graph

61 commits

Author SHA1 Message Date
DanielEScherzer
ddd33fd7e4
Generated arginfo headers: combine preprocessor conditional blocks (2) (#18667)
When global constants' or class constants' availability is based on some
preprocessor condition, the generated arginfo header files wrap the
declarations in the preprocessor `#if` conditional blocks, one per declaration,
even if they are in the same conditional block based on comments in the stub
file. Instead of having multiple conditional blocks one after the other with
the same condition, combine them into a single conditional block.
2025-06-22 14:35:28 -07:00
Remi Collet
1e6909d25e
allow ldap_get_option to retrieve global option 2025-05-19 07:40:09 +02:00
DanielEScherzer
5dd0575698
Generated arginfo header files: combine preprocessor conditional blocks (#15736)
When functions' or class methods' availability is based on some preprocessor
condition, the generated arginfo header files wrap the declarations in the
preprocessor `#if` conditional blocks, one per declaration, even if they are in
the same conditional block based on comments in the stub file. Instead of
having multiple conditional blocks one after the other with the same condition,
combine them into a single conditional block.
2024-09-04 13:04:22 +02:00
DanielEScherzer
53cb89670c
Generated arginfo header files: remove empty zend_function_entry arrays (#15705)
When a class (or enum) has no methods, rather than using an array that only
contains `ZEND_FE_END`, use `NULL` for the functions. The implementation of
class registration for internal classes, `do_register_internal_class()` in
zend_API.c, already skips classes where the functions are `NULL`. By removing
these unneeded arrays, we can reduce the size of the header files, while also
removing an unneeded call to zend_register_functions() for each internal class
with no extra methods.
2024-09-03 23:19:53 +02:00
Máté Kocsis
8d12f666ae
Fix registration of internal readonly child classes (#15459)
Currently, internal classes are registered with the following code:

INIT_CLASS_ENTRY(ce, "InternalClass", class_InternalClass_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
class_entry->ce_flags |= ...;

This has worked well so far, except if InternalClass is readonly. It is because some inheritance checks are run by zend_register_internal_class_ex before ZEND_ACC_READONLY_CLASS is added to ce_flags.

The issue is fixed by adding a zend_register_internal_class_with_flags() zend API function that stubs can use from now on. This function makes sure to add the flags before running any checks. Since the new API is not available in lower PHP versions, gen_stub.php has to keep support for the existing API for PHP 8.3 and below.
2024-08-24 12:36:54 +02:00
haszi
9864d91ea6
Fix typo in LDAP stub (#14313)
Co-authored-by: haszi <haszika80@gmail.com>
2024-05-25 13:31:54 +02:00
Máté Kocsis
3876225763
Fix casing of NULL default values 2024-04-27 23:45:55 +02:00
Máté Kocsis
f2e199e878
Implement "support doc comments for internal classes and functions" (#13266)
Fixes #13130
2024-02-25 08:41:31 +01:00
Máté Kocsis
10957e498c
Do not generate frameless info items when func info generation is disabled
While here, I fixed newlines around arginfo and function entry generation. Previously, newlines were repeated.
2024-02-18 11:39:00 +01:00
Steve Wall
f6016c702f ext/ldap: Add LDAP_OPT_X_TLS_PROTOCOL_MAX and LDAP_OPT_X_TLS_PROTOCOL_TLS1_3
close GH-13405.
2024-02-15 21:43:46 +00:00
Máté Kocsis
b3bd55f244 Implement ldap_exop_sync 2023-07-18 12:59:21 +02:00
Máté Kocsis
72aada3c7c Implement ldap_connect_wallet() 2023-07-18 12:59:21 +02:00
Máté Kocsis
e733ebf30e
Add parenthesis around preprocessor conditions in stubs
gen_stub.php concatenates nested #ifs into one #if so let's make sure the semantics remain the same.
2022-09-02 16:21:28 +02:00
Máté Kocsis
b4ec3e9bc0
Do not generate CONST_CS when registering constants (#9439) 2022-08-28 08:27:19 +02:00
Máté Kocsis
e328c68305
Rename @cname to @cvalue in stubs (#9043)
@cname currently refers to the constant name in C. However, it is not always a (constant) name, but sometimes a function invocation, so naming it as @cvalue would be more appropriate.
2022-07-19 15:11:42 +02:00
Remi Collet
55a88f36b6
add SensitiveParameter as known string and use it in arginfo 2022-07-18 11:43:33 +02:00
Tim Düsterhus
342e18f105
Support the actual #[\SensitiveParameter] attribute in stubs (#8836) 2022-07-12 12:43:44 +02:00
Pierrick Charron
6fd2b39397
Indent with TAB in .h files generated by gen_stub 2022-06-13 08:55:54 -04:00
Tim Düsterhus
788b7a0c6c Mark parameter in ext/ldap as sensitive 2022-06-13 11:09:12 +02:00
Máté Kocsis
e7c30c059c
Declare ext/ldap constants in stubs (#8717) 2022-06-06 21:30:10 +02:00
Máté Kocsis
6a47831e6e
Add more specific array return type hints for various extensions - part 3 (#7467) 2021-09-06 12:27:28 +02:00
Máté Kocsis
2378f35787
Use single line phpdoc in stubs where possible 2021-07-20 13:16:56 +02:00
Joe Watkins
570d9b63e9
Not serializable flag permeation 2021-07-20 12:28:35 +02:00
Máté Kocsis
b382883696
Indent stubs inside global namespace blocks (#7261) 2021-07-20 10:23:58 +02:00
Ayesh Karunaratne
e0b947a8da
Move resource-object classes of LDAP to \LDAP namespaces (#6963)
Another change as per accepted [namespaces in bundled extensions RFC](https://wiki.php.net/rfc/namespaces_in_bundled_extensions).

Related: #6925, #5945, #6960
2021-05-09 22:20:21 +02:00
Máté Kocsis
cd40fc3cb1
Convert resources to objects in ext/ldap
Closes GH-6770
2021-03-21 10:43:25 +01:00
Máté Kocsis
66f16f4eb2
Merge branch 'PHP-8.0'
* Fix crash in LDAP search functions during argument validation
* Fix ldap_next_entry() parameter name
2021-03-16 09:34:41 +01:00
Máté Kocsis
465aa1d38f
Fix ldap_next_entry() parameter name 2021-03-16 09:31:46 +01:00
Máté Kocsis
cad66533f0
Generate class entries from stubs for ldap, libxml, mbstring and mysqli
Closes GH-6684
2021-02-16 14:46:19 +01:00
Christoph M. Becker
f33105dcb6 ldap_search() and friends can return array
See the description of <https://www.php.net/ldap-search>, and also the
implementation.

Closes GH-6620.
2021-01-19 10:35:17 +01:00
Christoph M. Becker
c3734f9ae1 ldap_exop_whoami() does not return TRUE
Closes GH-6496.
2020-12-08 11:44:04 +01:00
Côme Chilliet
15a3eca3ef Change $controls parameter to default to null in ext/ldap
It appeared that not passing $controls and passing [] caused different
 behaviors, when not passing it the controls set through ldap_set_option
 would be used, when passing [] they would not.

So, this parameter is now nullable and defaults to null to have a
 consistent behavior.
2020-10-15 11:48:47 +02:00
Nikita Popov
1610e81b51 Mark ldap_exop() param as UNKNOWN
This function actually has very different behavior depending on
whether $response_data is passed or not.
2020-10-14 16:38:56 +02:00
Côme Chilliet
550a4f2fa8 Remove deprecated functions from php-ldap
Remove ldap_control_paged_result and ldap_control_paged_result_response
 which have been deprecated in PHP 7.4, in favor of new $controls
 parameters for ldap request functions.
2020-10-01 10:15:27 +02:00
Côme Chilliet
1945355435 Improve parameter names in ext/ldap
Merging PR 6153
2020-09-29 16:31:08 +02:00
Côme Chilliet
1d3787ee94 Rename $link parameters to $ldap in ldap functions
Also fixed ldap_set_option places where $newvalue was still used
2020-09-29 16:31:08 +02:00
Côme Chilliet
fa1f86f11c Explicitely mark nullable strings 2020-09-29 16:31:07 +02:00
Côme Chilliet
c2a6da5ab2 Fix parameter names in ext/ldap
Renamed all parameters to be consistent and concise
2020-09-29 16:31:07 +02:00
Côme Chilliet
2a34d35a66 Fix "null" case in ldap.stub.php 2020-09-29 16:31:07 +02:00
Côme Chilliet
eeec37d31d Remove dummy_ber parameter from ldap_first_attribute and ldap_next_attribute
It has been unused and deprecated since PHP 5.2.4
2020-09-29 16:31:07 +02:00
Côme Chilliet
caa0cd7705 Set all parameters to ldap_sasl_bind as NULL by default
For mech, realm, authcid, authzid and props NULL means do not change
 current server setting.
2020-09-29 16:31:07 +02:00
Côme Chilliet
74b634751b Default bind dn and password to NULL in ldap_bind_ext 2020-09-29 16:31:07 +02:00
Côme Chilliet
14385fb203 Default bind dn and password to NULL in ldap_bind 2020-09-29 16:31:07 +02:00
Côme Chilliet
6b77252f18 Make URI parameter in ldap_connect default to NULL 2020-09-29 16:31:07 +02:00
Máté Kocsis
36fd95b524
Generate arginfos 2020-09-16 21:28:27 +02:00
Máté Kocsis
8107a1da5a
Use ZPP instead of custom type checks
We can add these types as a native type declaration to stubs as a side-effect. Closes GH-6068
2020-09-04 14:32:34 +02:00
Máté Kocsis
046cc5e4c2
Add another round of missing parameter types to stubs
Closes GH-5950
2020-08-07 16:48:45 +02:00
Máté Kocsis
6b7e2f0d15
Fix stub hash of ext/ldap 2020-08-03 01:06:21 +02:00
Máté Kocsis
79981a394e
Add a bunch of missing argument types to stubs 2020-08-03 00:45:51 +02:00
Paweł Tomulik
915abeb699 Add ldap_count_references()
Closes GH-5784
2020-07-01 09:29:46 +02:00