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

From: Date: Sat, 05 Jul 2008 12:21:34 +0000
Subject: cvs: peardoc /en/package/php/php-compatinfo intro.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-10940@lists.php.net to get a copy of this message
farell Sat Jul 5 12:21:34 2008 UTC Modified files: /peardoc/en/package/php/php-compatinfo intro.xml Log: first chapter of tutorial (intro) -inital commit http://cvs.php.net/viewvc.cgi/peardoc/en/package/php/php-compatinfo/intro.xml?r1=1.4&r2=1.5&diff_format=u Index: peardoc/en/package/php/php-compatinfo/intro.xml diff -u /dev/null peardoc/en/package/php/php-compatinfo/intro.xml:1.5 --- /dev/null Sat Jul 5 12:21:34 2008 +++ peardoc/en/package/php/php-compatinfo/intro.xml Sat Jul 5 12:21:34 2008 @@ -0,0 +1,78 @@ +<!-- $Revision: 1.5 $ --> +<refentry id="package.php.php-compatinfo.intro"> + <refnamediv> + <refname>Overview</refname> + <refpurpose>PCI features and usage patterns</refpurpose> + </refnamediv> + + <refsect1 id="package.php.php-compatinfo.intro.purpose"> + <title>In brief</title> + <simpara> + There are two types of interface to run a PHP_CompatInfo (alias PCI) + script detection: CLI and web. + All PCI features (since 1.7.0) are available on both interface. + </simpara> + <simpara> + Examples that follow, will be explained with both interface. It's up to you + to choose what is the best usage for you. + </simpara> + </refsect1> + + <refsect1 id="package.php.php-compatinfo.intro.accuracy"> + <title>Accuracy of detection</title> + <para> + PCI may detect without error and with a great precision, any simple PHP scripts + that have <emphasis role="bold">no switch conditions such as</emphasis> these ones : + <methodname>function_exists</methodname> or + <methodname>version_compare</methodname>. + </para> + <para> + <programlisting role="php"> + <![CDATA[ +<?php +// ... +if (function_exists('debug_backtrace')) { + $backtrace = debug_backtrace(); +} else { + $backtrace = false; +} + +if (version_compare(phpversion(), '5.0.0', '<')) { + include_once 'PHP/Compat.php'; + PHP_Compat::loadFunction('ob_get_clean'); + PHP_Compat::loadConstant('PHP_EOL'); +} +// ... +?> + ]]> + </programlisting> + </para> + <para> + Don't be afraid, PCI can still be use, even if your PHP scripts have these + conditions or any others, but you should help it, to adjust the parser accuracy + with one or more options. + See the parser options reference list for details and advanced detection section. + </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 +--> \ No newline at end of file

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