Edit report at http://bugs.php.net/bug.php?id=42060&edit=1
ID: 42060 Updated by: [email protected] Reported by: iarenuno at eteo dot mondragon dot edu Summary: [PATCH] LDAP: Add pagedResults support and more -Status: Assigned +Status: Closed Type: Feature/Change Request Package: *General Issues Operating System: * PHP Version: 5CVS, 6CVS (2008-11-01) Assigned To: pajoye New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2010-05-27 15:52:26] jeanseb at au-fil-du dot net Any feedback on the patch ? ------------------------------------------------------------------------ [2010-05-21 17:35:54] jeanseb at au-fil-du dot net http://bugs.php.net/patch-display.php?bug_id=42060&patch=php-trunk_ldap-pagination.patch&revision=latest is against trunk ------------------------------------------------------------------------ [2010-05-21 17:27:54] [email protected] As I said there, 5.2/3 are in bug fixes mode only. Pls provide a patch against trunk. ------------------------------------------------------------------------ [2010-05-21 17:23:52] jeanseb at au-fil-du dot net The feature is very important for us too. I extracted the pagination feature and add some phpt from the patch of Pierangelo and Iñaki and I ported it for the trunk. Please find attached patch. NB : this patch adds 2 new calls, see below A 5.2 version of this patch is available there http://bugs.php.net/bug.php?id=51869 Test script: --------------- $ds = ldap_connect($ldapHost, $ldapPort); ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_bind($ds, $ldapUser, $ldapPass); $cookie = ''; do { ldap_ctrl_paged_results($ds, $pageSize, true, $cookie); $result = ldap_search($ds, $dn, $filter, $justthese); $entries = ldap_get_entries($ds, $result); ldap_ctrl_paged_results_resp($ds, $result, $cookie); } while($cookie !== null && $cookie != ''); ------------------------------------------------------------------------ [2010-02-25 07:28:01] ashley at netspot dot com dot au I used Iñaki's patch from http://www.eteo.mondragon.edu/descargas/php-ldap/ (tested both the 5.1.6 and 5.2.10 patches) and it works very well without any issues. It successfully pulled down 200,000+ records in a single search, using a page size of 500. I used this sample code as a reference for implementing the paging functions: http://wiki.github.com/jcharaoui/mdl19-cegep/php-ldap-paging Note: you should also check ldap_errno() and break out of the paging loop if any error occur, because, for example, if the LDAP server goes offline in the middle of the paging, that code gets stuck in an infinate loop because the cookie never gets unset (happened to me). Thanks for your work.. would love to see this included in the core release. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/bug.php?id=42060 -- Edit this bug report at http://bugs.php.net/bug.php?id=42060&edit=1
