cvs: peardoc /en/package/php/php-compatinfo/php-compatinfo addlistener.xml removelistener.xml

From: Date: Sun, 06 Jul 2008 15:04:53 +0000
Subject: cvs: peardoc /en/package/php/php-compatinfo/php-compatinfo addlistener.xml removelistener.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-10949@lists.php.net to get a copy of this message
farell Sun Jul 6 15:04:53 2008 UTC Added files: /peardoc/en/package/php/php-compatinfo/php-compatinfo addlistener.xml removelistener.xml Log: initial commit http://cvs.php.net/viewvc.cgi/peardoc/en/package/php/php-compatinfo/php-compatinfo/addlistener.xml?view=markup&rev=1.1 Index: peardoc/en/package/php/php-compatinfo/php-compatinfo/addlistener.xml +++ peardoc/en/package/php/php-compatinfo/php-compatinfo/addlistener.xml <!-- $Revision: 1.1 $ --> <refentry id="package.php.php-compatinfo.php-compatinfo.addlistener"> <refnamediv> <refname> <function>PHP_CompatInfo::addListener</function> </refname> <refpurpose>Registers a new listener</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once &apos;PHP/CompatInfo.php&apos;; </funcsynopsisinfo> <funcprototype> <funcdef> void <function>PHP_CompatInfo::addListener</function> </funcdef> <paramdef> mixed <parameter>$callback</parameter> </paramdef> <paramdef> string <parameter> <optional>$nName = EVENT_DISPATCHER_GLOBAL</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.php.php-compatinfo.php-compatinfo.addlistener.desc"> &title.desc; <para> Registers a new listener with the given criteria </para> </refsect1> <refsect1 id="package.php.php-compatinfo.php-compatinfo.addlistener.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.mixed; <parameter>$callback</parameter> </term> <listitem> <para> A PHP callback </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.string; <parameter>$nName</parameter> </term> <listitem> <para> (optional) Expected notification name </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.php.php-compatinfo.php-compatinfo.addlistener.returns"> &title.returns; <para> <emphasis>returns</emphasis> void </para> </refsect1> <refsect1 id="package.php.php-compatinfo.php-compatinfo.addlistener.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="package.php.php-compatinfo.php-compatinfo.addlistener.since"> &title.since; <para> <emphasis>since</emphasis> version 1.8.0b3 (2008-06-07) </para> </refsect1> <refsect1 id="package.php.php-compatinfo.php-compatinfo.addlistener.note"> &title.note; &note.notstatic; </refsect1> <refsect1 id="package.php.php-compatinfo.php-compatinfo.addlistener.example"> &title.example; <para> Attach a simple function that will listen all PHP_CompatInfo events, which write start and end audit results in a flat file defined by a php constant. <programlisting role="php"> <![CDATA[ <?php require_once 'PHP/CompatInfo.php'; define('DEST_PCI_LOG', '/var/log/pciEvents.log'); function debugNotify(&$auditEvent) { $notifyName = $auditEvent->getNotificationName(); $notifyInfo = $auditEvent->getNotificationInfo(); if ($notifyName == PHP_COMPATINFO_EVENT_AUDITSTARTED) { error_log($notifyName.':'. PHP_EOL . var_export($notifyInfo, true) . PHP_EOL, 3, DEST_PCI_LOG); } elseif ($notifyName == PHP_COMPATINFO_EVENT_AUDITFINISHED) { error_log($notifyName.':'. PHP_EOL . var_export($notifyInfo, true) . PHP_EOL, 3, DEST_PCI_LOG); } } $cbObserver = 'debugNotify'; $pci = new PHP_CompatInfo(); $pci->addListener($cbObserver); // ... $source = ''; // <- identify the date source to parse $options = array(); // <- some parser options $pci->parseData($source, $options); $pci->removeListener($cbObserver); ?> ]]> </programlisting> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/package/php/php-compatinfo/php-compatinfo/removelistener.xml?view=markup&rev=1.1 Index: peardoc/en/package/php/php-compatinfo/php-compatinfo/removelistener.xml +++ peardoc/en/package/php/php-compatinfo/php-compatinfo/removelistener.xml <!-- $Revision: 1.1 $ --> <refentry id="package.php.php-compatinfo.php-compatinfo.removelistener"> <refnamediv> <refname> <function>PHP_CompatInfo::removeListener</function> </refname> <refpurpose>Removes a registered listener</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once &apos;PHP/CompatInfo.php&apos;; </funcsynopsisinfo> <funcprototype> <funcdef> bool <function>PHP_CompatInfo::removeListener</function> </funcdef> <paramdef> mixed <parameter>$callback</parameter> </paramdef> <paramdef> string <parameter> <optional>$nName = EVENT_DISPATCHER_GLOBAL</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.php.php-compatinfo.php-compatinfo.removelistener.desc"> &title.desc; <para> Removes a registered listener that correspond to the given criteria. </para> </refsect1> <refsect1 id="package.php.php-compatinfo.php-compatinfo.removelistener.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.mixed; <parameter>$callback</parameter> </term> <listitem> <para> A PHP callback </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.string; <parameter>$nName</parameter> </term> <listitem> <para> (optional) Expected notification name </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.php.php-compatinfo.php-compatinfo.removelistener.returns"> &title.returns; <para> <emphasis>returns</emphasis> True if listener was removed, false otherwise. </para> </refsect1> <refsect1 id="package.php.php-compatinfo.php-compatinfo.removelistener.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="package.php.php-compatinfo.php-compatinfo.removelistener.since"> &title.since; <para> <emphasis>since</emphasis> version 1.8.0b3 (2008-06-07) </para> </refsect1> <refsect1 id="package.php.php-compatinfo.php-compatinfo.removelistener.note"> &title.note; &note.notstatic; </refsect1> <refsect1 id="package.php.php-compatinfo.php-compatinfo.removelistener.example"> &title.example; <para> <emphasis>see</emphasis> <link linkend="package.php.php-compatinfo.php-compatinfo.addlistener.example"> <function>PHP_CompatInfo::addListener</function> </link> example </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->

« previous php.pear.doc (#10949) next »