Re: cvs: pear /Net_LDAP LDAP.php package.xml /Net_LDAP/LDAP Entry.php
| From: | Mirco 'meebey' Bauer | Date: | Wed, 19 Nov 2003 20:19:32 +0000 |
| Subject: | Re: cvs: pear /Net_LDAP LDAP.php package.xml /Net_LDAP/LDAP Entry.php | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-23752@lists.php.net to get a copy of this message | ||
Hi,
I saw your CVS commit on pear-cvs@lists.php.net and I want to let you
know that this commit contains code which is not conform to the PEAR
Coding Standards (http://pear.php.net/manual/en/standards.php)
the "if()" statements are ok, but the function calls and "->" operators
are not conform.
It would be nice if you can recheck the PEAR CS, and apply it to your
code.
thanks
Mirco Bauer aka meebey
On Thu, 2003-11-13 at 10:06, Tarjei Huse wrote:
> tarjei Thu Nov 13 04:06:58 2003 EDT
>
> Modified files:
> /pear/Net_LDAP LDAP.php package.xml
> /pear/Net_LDAP/LDAP Entry.php
> Log:
> Minor bugfix
>
>
>
> Index: pear/Net_LDAP/LDAP.php
> diff -u pear/Net_LDAP/LDAP.php:1.13 pear/Net_LDAP/LDAP.php:1.14
> --- pear/Net_LDAP/LDAP.php:1.13 Wed Nov 12 05:53:13 2003
> +++ pear/Net_LDAP/LDAP.php Thu Nov 13 04:06:57 2003
> @@ -5,7 +5,7 @@
> * (the perl Net::LDAP way)
> *
> * @author Tarjei Huse
> - * @version $Id: LDAP.php,v 1.13 2003/11/12 10:53:13 jw Exp $
> + * @version $Id: LDAP.php,v 1.14 2003/11/13 09:06:57 tarjei Exp $
> * @package Net_LDAP
> */
>
> @@ -540,10 +540,20 @@
> */
> function dnExists($dn)
> {
> - $base = $dn;
> - $filter = '(objectclass=*)';
> - $result = ldap_list( $this -> _link, $base,$filter, array(),1,1);
> - if (ldap_count_entries($result)>0) {
> + $dns = explode(",",$dn);
> + $filter = array_shift($dns);
> + $base= implode($dns,',');
> + //$base = $dn;
> + //$filter = '(objectclass=*)';
> +
> + $result = @ldap_list( $this -> _link, $base,$filter, array(),1,1);
> + if (ldap_errno($this -> _link) == 32) {
> + return false;
> + }
> + if (ldap_errno($this -> _link) != 0) {
> + $this -> raiseError( ldap_error($this->_link),ldap_errno($this ->
> _link));
> + }
> + if (@ldap_count_entries($this->_link, $result)) {
> return true;
> }
> return false;
> Index: pear/Net_LDAP/package.xml
> diff -u pear/Net_LDAP/package.xml:1.8 pear/Net_LDAP/package.xml:1.9
> --- pear/Net_LDAP/package.xml:1.8 Wed Nov 12 07:54:19 2003
> +++ pear/Net_LDAP/package.xml Thu Nov 13 04:06:57 2003
> @@ -113,7 +113,6 @@
> The new Net_ldap_entry::modify() method seems to work very nice now.
> </notes>
> </release>
> - <release>
> <release>
> <version>0.6</version>
> <state>beta</state>
> Index: pear/Net_LDAP/LDAP/Entry.php
> diff -u pear/Net_LDAP/LDAP/Entry.php:1.11 pear/Net_LDAP/LDAP/Entry.php:1.12
> --- pear/Net_LDAP/LDAP/Entry.php:1.11 Wed Nov 12 05:53:13 2003
> +++ pear/Net_LDAP/LDAP/Entry.php Thu Nov 13 04:06:58 2003
> @@ -5,7 +5,7 @@
> *
> * @package Net_LDAP
> * @author Tarjei Huse
> - * @version $Id: Entry.php,v 1.11 2003/11/12 10:53:13 jw Exp $
> + * @version $Id: Entry.php,v 1.12 2003/11/13 09:06:58 tarjei Exp $
> */
>
> /**
> @@ -210,7 +210,7 @@
> if ($v == '') continue;
> if ($this->exists($k)) {
> if (!is_array($this->_attrs[$k])) {
> - $this->raiseError("Possible malformed array as parameter to
> Net_LDAP::add().");
> + return $this->raiseError("Possible malformed array as parameter to
> Net_LDAP::add().");
> }
> array_push($this->_attrs[$k],$v);
> $this->_attrs[$k]['count']++;