cvs: peardoc /en/package/pear/pear-info intro.xml

From: Date: Sat, 14 Jul 2007 22:13:45 +0000
Subject: cvs: peardoc /en/package/pear/pear-info intro.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-9894@lists.php.net to get a copy of this message
farell Sat Jul 14 22:13:45 2007 UTC Modified files: /peardoc/en/package/pear/pear-info intro.xml Log: add example to customize PEAR_Info with constant options, and detailed all options

http://cvs.php.net/viewvc.cgi/peardoc/en/package/pear/pear-info/intro.xml?r1=1.6&r2=1.7&diff_format=u Index: peardoc/en/package/pear/pear-info/intro.xml diff -u peardoc/en/package/pear/pear-info/intro.xml:1.6 peardoc/en/package/pear/pear-info/intro.xml:1.7 --- peardoc/en/package/pear/pear-info/intro.xml:1.6 Tue Oct 17 13:01:25 2006 +++ peardoc/en/package/pear/pear-info/intro.xml Sat Jul 14 22:13:45 2007 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry id="package.pear.pear-info.intro"> <refnamediv> <refname>Introduction</refname> @@ -8,48 +8,273 @@ <title>Introduction to PEAR_Info</title> <para> - PEAR_Info obtains and displays information about your current PEAR + PEAR_Info obtains and displays information about your current PEAR Install. - The PEAR_Info page features an A-Z index for easy searching, aswell - as anchors for each package in the form of pkg_Package_Name (i.e. - url.tld/pearinfo.php#pkg_PEAR_Info) PEAR_Info also features a full 'PEAR - Credits' page, with information about the authors of the packages you - currently have installed. PEAR_Info will also display any later versions + The PEAR_Info page features an A-Z index for easy searching, aswell + as anchors for each package in the form of pkg_Package_Name (i.e. + url.tld/pearinfo.php#pkg_PEAR_Info) PEAR_Info also features a full 'PEAR + Credits' page, with information about the authors of the packages you + currently have installed. PEAR_Info will also display any later versions that are available from PEAR to help keep you up to date. - </para> + </para> <example id="package.pear.pear-info.intro.example"> <title>Using PEAR_Info</title> <programlisting role="php"> <![CDATA[ <?php - require_once 'PEAR/Info.php'; +require_once 'PEAR/Info.php'; - /* - If you need to set a http_proxy value at run-time you can use the - following, this must be called BEFORE instantiating the PEAR_Info object - */ +/* +If you need to set a http_proxy value at run-time that is not set in +your user or system pear configuration file, you can use the +following, this must be called BEFORE instantiating the PEAR_Info object +*/ - PEAR_Info::setProxy('your.proxy.here'); +PEAR_Info::setProxy('your.proxy.here'); - /* - Optional pear_dir variable, allows you to choose where your PEAR - install is, in case its not found - */ +/* +Optional pear_dir variable, allows you to choose where your PEAR +install is, in case its not found +*/ - $pear_dir = "/path/to/your/pear/files"; +$pear_dir = "/path/to/your/pear/files"; - /* - Instantiate PEAR_Info object - */ +/* +Instantiate PEAR_Info object +*/ - $info = new PEAR_Info($pear_dir); +$info = new PEAR_Info($pear_dir); - /* - Show PEAR_Info output - */ +/* +Show PEAR_Info output +*/ - $info->show(); +$info->display(); +?> + ]]> + </programlisting> + </example> + </refsect1> + + <refsect1 id="package.pear.pear-info.intro.options"> + <title>PEAR_Info options</title> + <para> + The output may be customized by passing one or more of the following constants + bitwise values summed together in the optional <emphasis>options</emphasis> + hash parameter. One can also combine the respective constants or bitwise + values together with the + <ulink url="http://www.php.net/manual/en/language.operators.bitwise.php">or</ulink> + operator. + </para> + + <para> + <table> + <title>General page options</title> + <tgroup cols="3"> + <thead> + <row> + <entry>Name</entry> + <entry>Value</entry> + <entry>Description</entry> + </row> + </thead> + <tbody> + <row> + <entry>PEAR_INFO_GENERAL</entry> + <entry>1</entry> + <entry> + The configuration file location, PEAR logo and current install version. + </entry> + </row> + <row> + <entry>PEAR_INFO_CREDITS</entry> + <entry>2</entry> + <entry> + A link to PEAR Credits page. + See also <constant>PEAR_INFO_CREDITS_*</constant> constants. + </entry> + </row> + <row> + <entry>PEAR_INFO_CONFIGURATION</entry> + <entry>4</entry> + <entry>All PEAR settings (keys and values).</entry> + </row> + <row> + <entry>PEAR_INFO_CHANNELS</entry> + <entry>8</entry> + <entry>List available channels</entry> + </row> + <row> + <entry>PEAR_INFO_PACKAGES</entry> + <entry>4080</entry> + <entry> + All package informations. + See all others <constant>PEAR_INFO_PACKAGES_*</constant> constants. + </entry> + </row> + <row> + <entry>PEAR_INFO_PACKAGES_CHANNEL</entry> + <entry>2048</entry> + <entry>Show the package channel</entry> + </row> + <row> + <entry>PEAR_INFO_PACKAGES_SUMMARY</entry> + <entry>1024</entry> + <entry>A short description of the package</entry> + </row> + <row> + <entry>PEAR_INFO_PACKAGES_VERSION</entry> + <entry>512</entry> + <entry>Package version with state and release date.</entry> + </row> + <row> + <entry>PEAR_INFO_PACKAGES_LICENSE</entry> + <entry>256</entry> + <entry>License of the package release</entry> + </row> + <row> + <entry>PEAR_INFO_PACKAGES_DESCRIPTION</entry> + <entry>128</entry> + <entry>A long description of the package</entry> + </row> + <row> + <entry>PEAR_INFO_PACKAGES_DEPENDENCIES</entry> + <entry>64</entry> + <entry>Show package dependency list</entry> + </row> + <row> + <entry>PEAR_INFO_PACKAGES_XML</entry> + <entry>32</entry> + <entry> + Tell what PEAR packager and package xml version (1.0 or 2.0) was used + to build and install the package. + </entry> + </row> + <row> + <entry>PEAR_INFO_PACKAGES_UPDATE</entry> + <entry>16</entry> + <entry> + Show the latest version available. Displayed only if different than + current install version. + </entry> + </row> + <row> + <entry>PEAR_INFO_ALL</entry> + <entry>4095</entry> + <entry>Shows all of the above. This is the default value.</entry> + </row> + </tbody> + </tgroup> + </table> + </para> + + <para> + <table> + <title>Credits page options</title> + <tgroup cols="3"> + <thead> + <row> + <entry>Name</entry> + <entry>Value</entry> + <entry>Description</entry> + </row> + </thead> + <tbody> + <row> + <entry>PEAR_INFO_CREDITS_ALL</entry> + <entry>61440</entry> + <entry> + All credits informations. + See all others <constant>PEAR_INFO_CREDITS_*</constant> constants. + </entry> + </row> + <row> + <entry>PEAR_INFO_CREDITS_GROUP</entry> + <entry>4096</entry> + <entry>Show PEAR Group members list</entry> + </row> + <row> + <entry>PEAR_INFO_CREDITS_DOCS</entry> + <entry>8192</entry> + <entry>Show PEAR Documentation Team list</entry> + </row> + <row> + <entry>PEAR_INFO_CREDITS_WEBSITE</entry> + <entry>16384</entry> + <entry>Show PEAR Website Team list</entry> + </row> + <row> + <entry>PEAR_INFO_CREDITS_PACKAGES</entry> + <entry>32768</entry> + <entry>Show authors (and roles) of package maintainers</entry> + </row> + </tbody> + </tgroup> + </table> + </para> + + <para> + <table> + <title>Common options</title> + <tgroup cols="3"> + <thead> + <row> + <entry>Name</entry> + <entry>Value</entry> + <entry>Description</entry> + </row> + </thead> + <tbody> + <row> + <entry>PEAR_INFO_FULLPAGE</entry> + <entry>65536</entry> + <entry> + Indicates that a complete stand-alone HTML page needs to be printed + including the information indicated by the other flags. This is the + default value. + </entry> + </row> + </tbody> + </tgroup> + </table> + </para> + + <example id="package.pear.pear-info.intro.example2"> + <title>Customize PEAR_Info output</title> + <programlisting role="php"> + <![CDATA[ +<?php +require_once 'PEAR/Info.php'; + +/* +Optional resume option, allows you to choose what information to display. +Here we will display a quick list of package (version only) group by channel. +*/ + +$options = array('resume' => PEAR_INFO_FULLPAGE | + PEAR_INFO_GENERAL | PEAR_INFO_CHANNELS | PEAR_INFO_PACKAGES_VERSION, + 'channels' => array() +); + +/* +Instantiate PEAR_Info object, using PEAR default install configuration +*/ + +$info = new PEAR_Info('', '', '', $options); + +/* +Set you own presentation size and colors, with a simple style sheet. +*/ + +$css_file = "/path/to/your/file.css"; +$info->setStyleSheet($css_file); + +/* +Show PEAR_Info output +*/ + +$info->display(); ?> ]]> </programlisting> @@ -74,5 +299,5 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> +-->
« previous php.pear.doc (#9894) next »