php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #76546 ldap_exop_refresh function not available in 7.2
Submitted: 2018-06-29 10:33 UTC Modified: 2018-07-16 07:47 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: post at rolandgruber dot de Assigned: mcmic (profile)
Status: Closed Package: LDAP related
PHP Version: 7.2.7 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: post at rolandgruber dot de
New email:
PHP Version: OS:

 

 [2018-06-29 10:33 UTC] post at rolandgruber dot de
Description:
------------
The function "ldap_exop_refresh" is not available as described in the documentation. See http://php.net/manual/en/function.ldap-exop-refresh.php.

I get: Uncaught Error: Call to undefined function ldap_exop_refresh()

Try the test script. It will output other LDAP exop functions but not the refresh one. According to documentation it should be available since 7.2.0 (I tried with 7.2.4).
Please make it available and update the documentation with the correct version number.

Test script:
---------------
$functions = get_defined_functions();
foreach ($functions['internal'] as $function) {
    if (strpos($function, 'ldap_exop') !== false) {
        echo $function . "<br>";
    }
}


Expected result:
----------------
ldap_exop_refresh can be used in code.

Actual result:
--------------
Uncaught Error: Call to undefined function ldap_exop_refresh()

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-06-29 11:03 UTC] requinix@php.net
-Summary: ldap_exop_refresh function not available +Summary: ldap_exop_refresh function not available in 7.2 -Status: Open +Status: Verified -Type: Bug +Type: Documentation Problem
 [2018-06-29 11:03 UTC] requinix@php.net
ldap_exop_refresh is being added in 7.3.
https://github.com/php/php-src/commit/5e56d050e582d845e977377a1f8ba8deb15ab082
 [2018-06-29 11:06 UTC] post at rolandgruber dot de
Thanks a lot for the info.

Can you also add it in 7.2? Seems HAVE_LDAP_REFRESH_S is missing here:

https://github.com/php/php-src/blob/PHP-7.2.7/ext/ldap/config.w32

AC_DEFINE('HAVE_LDAP_REFRESH_S', 1);

The ldap.c file of 7.2.7 already contains the code for the refresh command.
 [2018-06-29 11:08 UTC] requinix@php.net
-Assigned To: +Assigned To: mcmic
 [2018-06-29 11:08 UTC] requinix@php.net
I would expect that if it could be added to 7.2 then it would have been...

@mcmic?
 [2018-07-02 06:59 UTC] mcmic@php.net
I don’t know why it was not added in 7.2, it might have been a mistake, or maybe I missed the deadline I can’t remember.

I’m not sure we can add a feature in a 7.2 minor release now.
 [2018-07-03 14:48 UTC] cmb@php.net
> […] or maybe I missed the deadline […]

That.  The respective commit was made on 2017-07-20, but feature
freeze was on 2017-07-18.

> The ldap.c file of 7.2.7 already contains the code for the
> refresh command.

While I can see the LDAP_EXOP_REFRESH constant, I can't find the
ldap_exop_refresh() function there.
 [2018-07-03 16:41 UTC] post at rolandgruber dot de
True, I was in wrong branch. The code is not part of 7.2. So documentation error only.

For anybody who faces the same issue here is a workaround for 7.2:

$dn= 'cn=user,dc=test,dc=org';
$ttl = 3600;
$data = '';
$data .= '80' . sprintf("%'.02x", strlen($dn)) . bin2hex($dn);
$data .= '81' . sprintf("%'.02x", 4) . sprintf("%'.08x", $ttl);
$data = hex2bin('30' . sprintf("%'.02x", strlen($data)/2) . $data);
$success = @ldap_exop($ldapHandle, LDAP_EXOP_REFRESH, $data);
 [2018-07-04 08:29 UTC] mcmic@php.net
Automatic comment from SVN on behalf of mcmic
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=345267
Log: Fix php version information error for ldap_exop_refresh

issue #76546
 [2018-07-04 09:15 UTC] mcmic@php.net
@rolandgruber Documentation should be fixed in the next update.

Do not hesitate to add your work-around in a user note on the documentation page, it may be useful to others.
 [2018-07-16 07:47 UTC] mcmic@php.net
-Status: Verified +Status: Closed
 [2018-07-16 07:47 UTC] mcmic@php.net
Fixed in documentation
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC