cvs: peardoc /en/package/php/php-compatinfo faq.xml

From: Date: Sat, 28 Jun 2008 09:32:53 +0000
Subject: cvs: peardoc /en/package/php/php-compatinfo faq.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-10917@lists.php.net to get a copy of this message
farell Sat Jun 28 09:32:53 2008 UTC Modified files: /peardoc/en/package/php/php-compatinfo faq.xml Log: two more entries in FAQ ; related to API 1.8 http://cvs.php.net/viewvc.cgi/peardoc/en/package/php/php-compatinfo/faq.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/php/php-compatinfo/faq.xml diff -u peardoc/en/package/php/php-compatinfo/faq.xml:1.2 peardoc/en/package/php/php-compatinfo/faq.xml:1.3 --- peardoc/en/package/php/php-compatinfo/faq.xml:1.2 Wed Jan 23 05:04:31 2008 +++ peardoc/en/package/php/php-compatinfo/faq.xml Sat Jun 28 09:32:53 2008 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="package.php.php-compatinfo.faq"> <refnamediv> <refname>FAQ</refname> @@ -95,6 +95,105 @@ </answer> </qandaentry> </qandadiv> + + <qandadiv><title id="faq3">About new API 1.8.0</title> + <qandaentry> + <question> + <para> + I don't want to have result (PHP array dump) display on the standard output + </para> + </question> + <answer> + <para> + Even it's the new behavior of API 1.8.0, you can still consumes all output + events with the <emphasis>Null</emphasis> renderer. + Give the <emphasis role="bold">null</emphasis> value (case insensitive), as + first parameter to the class constructor. + <programlisting role="php"> + <![CDATA[ +<?php +require_once 'PHP/CompatInfo.php'; + +$pci = new PHP_CompatInfo('null'); + +// display results is only produced by the line below +var_dump($res); +?> + ]]> + </programlisting> + </para> + </answer> + </qandaentry> + <qandaentry> + <question> + <para> + I want to know what is the status of parsing my data source. + </para> + </question> + <answer> + <para> + For a single file, it's not necessary to have a progress bar or a message wait. + But when you parse a directory with many subdirectories and files, it may take + some time. + </para> + <para> + Depending of interface you're running (CLI or Web) you've two ways to display + a progress bar or a message wait. + <warning> + <para> + If you specify a progress bar to wait and you don't have PEAR::Console_ProgressBar + package installed, default use standard text messages (no error stop the process). + <screen> +Wait while parsing data source ... +Wait while parsing file "C:\wamp\tmp\Services_W3C_CSSValidator-0.1.0\CSSValidator.php" + </screen> + </para> + </warning> + </para> + <para> + <emphasis role="bold">On CLI with pci command</emphasis>, + give the -p|--progress switch with either + <literal>bar</literal> (for a progress bar), or <literal>text</literal> + (for a simple text message). + <screen> +pci --summarize --progress bar --dir C:\Temp\beehiveforum082\forum + </screen> + </para> + <para> + <emphasis role="bold">On CLI without pci command</emphasis>, + use the second parameter (driver specific options) of class constructor. + Give <emphasis role="bold">progress</emphasis> key with + <literal>bar</literal> (for a progress bar), or + <literal>text</literal> (for a simple text message). + And don't forget to de-activate silent mode (default is on for behavior + backward compatibility). + <programlisting role="php"> + <![CDATA[ +<?php +require_once 'PHP/CompatInfo.php'; + +$driverType = 'csv'; +$driverOptions = array('silent' => false, 'progress' => 'bar'); + +$pci = new PHP_CompatInfo($driverType, $driverOptions); +?> + ]]> + </programlisting> + It will produce something like: + <screen> +- 79/419 files [====>-----------------] 18.85% Elapsed Time: 00:28.93 + </screen> + </para> + <para> + <emphasis role="bold">For Web SAPI</emphasis> see the full example available + in distribution into examples directory named + <filename>pci180_parsefolder_tohtml.php</filename>. It used the + PEAR::HTML_Progress2 package to produce a progress bar with COMET method + (not AJAX). + </para> + </answer> + </qandaentry> + </qandadiv> </qandaset> </refsect1>

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