Edit report at http://bugs.php.net/bug.php?id=42060&edit=1
ID: 42060 Comment by: jeanseb at au-fil-du dot net Reported by: iarenuno at eteo dot mondragon dot edu Summary: [PATCH] LDAP: Add pagedResults support and more Status: Assigned Type: Feature/Change Request Package: Feature/Change Request Operating System: * PHP Version: 5CVS, 6CVS (2008-11-01) Assigned To: patrickallaert New Comment: 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 != ''); Previous Comments: ------------------------------------------------------------------------ [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. ------------------------------------------------------------------------ [2010-02-23 04:14:11] ashley at netspot dot com dot au This is critical! Paged results are essential. I'm having to rewrite some functions of my PHP app in Perl to work around this issue.. :( ------------------------------------------------------------------------ [2010-01-20 12:56:46] asp at iportalmais dot pt Hello, I have the same problem. I think it's very important to add this feature, because a lot of people can not change AD settings for security reasons. If it's works with ASP why it not works with PHP? ------------------------------------------------------------------------ [2010-01-02 21:39:01] danhstevens at gmail dot com Why is this patch still being overlooked? pajoye: You said there would be a patch committed in a few days - that was well over a year ago and as far as I can see nothing has been committed. Can we get this patch pushed through? Is there any good reason this hasn't been implemented yet? PLEASE tell us when to expect this patch, if ever. ------------------------------------------------------------------------ [2009-12-17 14:36:28] chris at sogetthis dot com Who is Alexey and where is the updated patch? ------------------------------------------------------------------------ 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