[dev] patch for lib/VFS/sql.php

Ronnie Garcia r.garcia@netia.net
Tue Oct 29 08:52:03 2002


At 21:01 28/10/2002 -0500, you wrote:
>Here is a patch to convert some '=' to '==' that was missed in the last 
>commit.

  There is a good "trick" to avoid this kind of common error.
  Put the constant value on the left of the "==" sign, so the parser will 
throw a syntax error if you miss one "="

  I know, this may not look like "natural" for most of us developers, but 
it saves time when you are tracking down for an invisible error.

  This is in the "PHP Coding Standards" document, by Fredrik Kristiansen / 
DB Medialab :

http://utvikler.start.no/code/php_coding_standard.html

  (This is not an "official" document, just pick up what you think to be 
usefull).

Rgds,
Ronnie.

>Amith
>
>
>Index: lib/VFS/sql.php
>===================================================================
>RCS file: /repository/horde/lib/VFS/sql.php,v
>retrieving revision 1.31
>diff -r1.31 sql.php
>185c185
><                                             (empty($path) &&
>$this->_db->dbsyntax = 'oci8') ? ' IS NULL' : ' = ' . 
>$this->_db->quote($path),
>---
> >                                             (empty($path) &&
>$this->_db->dbsyntax == 'oci8') ? ' IS NULL' : ' = ' . 
>$this->_db->quote($path),
>311c311
><                                             (empty($path) &&
>$this->_db->dbsyntax = 'oci8') ? ' IS NULL' : ' = ' . 
>$this->_db->quote($path),
>---
> >                                             (empty($path) &&
>$this->_db->dbsyntax == 'oci8') ? ' IS NULL' : ' = ' . 
>$this->_db->quote($path),
>
>--
>Horde developers mailing list
>Frequently Asked Questions: http://horde.org/faq/
>To unsubscribe, mail: dev-unsubscribe@lists.horde.org