cvs: pear /Net_LDAP/LDAP Filter.php
| From: | Benedikt Hallinger | Date: | Fri, 21 Sep 2007 06:59:28 +0000 |
| Subject: | cvs: pear /Net_LDAP/LDAP Filter.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-48638@lists.php.net to get a copy of this message | ||
beni Fri Sep 21 06:59:28 2007 UTC
Modified files:
/pear/Net_LDAP/LDAP Filter.php
Log:
* Added perl compatible print() method to Net_LDAP_Filter
http://cvs.php.net/viewvc.cgi/pear/Net_LDAP/LDAP/Filter.php?r1=1.8&r2=1.9&diff_format=u
Index: pear/Net_LDAP/LDAP/Filter.php
diff -u pear/Net_LDAP/LDAP/Filter.php:1.8 pear/Net_LDAP/LDAP/Filter.php:1.9
--- pear/Net_LDAP/LDAP/Filter.php:1.8 Fri Sep 21 06:48:26 2007
+++ pear/Net_LDAP/LDAP/Filter.php Fri Sep 21 06:59:28 2007
@@ -22,7 +22,7 @@
// | Authors: Benedikt Hallinger |
// +--------------------------------------------------------------------------+
//
-// $Id: Filter.php,v 1.8 2007/09/21 06:48:26 beni Exp $
+// $Id: Filter.php,v 1.9 2007/09/21 06:59:28 beni Exp $
require_once("PEAR.php");
require_once('Util.php');
@@ -59,7 +59,7 @@
*
* @package Net_LDAP
* @author Benedikt Hallinger <beni@php.net>
-* @version $Revision: 1.8 $
+* @version $Revision: 1.9 $
*/
class Net_LDAP_Filter extends PEAR
@@ -283,6 +283,27 @@
}
/**
+ * Print the text representation of the filter to FH, or the currently selected output handle if
FH is not given
+ *
+ * This method is onlay for compatibility to the perl interface.
+ *
+ * @param resource $FH (optional) A filehandle resource
+ * @return true|Net_LDAP_Error
+ */
+ function print($FH = false)
+ {
+ if (!is_resource($FH)) {
+ print($this->asString());
+ } else {
+ $res = fwrite($FH, $this->asString());
+ if (false === $res) {
+ PEAR::raiseError("Unable to write filter string to filehandle \$FH!");
+ }
+ }
+ return true;
+ }
+
+ /**
* This can be used to escape a string to provide a valid LDAP-Filter.
*
* LDAP will only recognise certain characters as the