<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://commons.oreilly.com/wiki/skins/common/feed.css?97"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://commons.oreilly.com/wiki/index.php?title=PHP_Cookbook/PEAR&amp;action=history&amp;feed=atom</id>
		<title>PHP Cookbook/PEAR - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://commons.oreilly.com/wiki/index.php?title=PHP_Cookbook/PEAR&amp;action=history&amp;feed=atom"/>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=PHP_Cookbook/PEAR&amp;action=history"/>
		<updated>2013-05-25T08:54:33Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.11.0</generator>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=PHP_Cookbook/PEAR&amp;diff=7333&amp;oldid=prev</id>
		<title>Docbook2Wiki: Initial conversion from Docbook</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=PHP_Cookbook/PEAR&amp;diff=7333&amp;oldid=prev"/>
				<updated>2008-03-07T13:36:04Z</updated>
		
		<summary type="html">&lt;p&gt;Initial conversion from Docbook&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 13:36, 7 March 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;/table&gt;</summary>
		<author><name>Docbook2Wiki</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=PHP_Cookbook/PEAR&amp;diff=3145&amp;oldid=prev</id>
		<title>Evanlenz: 1 revision(s)</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=PHP_Cookbook/PEAR&amp;diff=3145&amp;oldid=prev"/>
				<updated>2008-03-06T22:30:18Z</updated>
		
		<summary type="html">&lt;p&gt;1 revision(s)&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 22:30, 6 March 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;/table&gt;</summary>
		<author><name>Evanlenz</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=PHP_Cookbook/PEAR&amp;diff=3144&amp;oldid=prev</id>
		<title>Docbook2Wiki: Initial conversion from Docbook</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=PHP_Cookbook/PEAR&amp;diff=3144&amp;oldid=prev"/>
				<updated>2008-03-06T22:28:45Z</updated>
		
		<summary type="html">&lt;p&gt;Initial conversion from Docbook&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{PHP Cookbook/TOC}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
PEAR is the PHP Extension and Application Repository, a collection of open source classes that work together. Developers can use PEAR classes to generate HTML, make SOAP requests, send MIME mail, and a variety of other common tasks. A pear is also a tasty fruit.&lt;br /&gt;
&lt;br /&gt;
To find general information on PEAR, read the PEAR manual; to discover the latest PEAR packages, go to ''http://pear.php.net''. A summary of each week's happenings can be found at ''http://pear.php.net/weeklynews.php''.&lt;br /&gt;
&lt;br /&gt;
Only a few core PEAR packages are bundled with the main PHP release. However, part of PEAR is a program called, appropriately enough, ''pear'' , that makes it easy for you to download and install additional PEAR packages. This program is also known as the PEAR package manager. [[PHP Cookbook/PEAR#Using the PEAR Package Manager|Recipe 21.2]] shows how to use the PEAR package manager.&lt;br /&gt;
&lt;br /&gt;
PEAR packages divide into two major parts. One is the PHP Foundation Classes — object-oriented code written in PHP that's high quality and usable in production environments on any platform and web server. The other is PECL, or PHP Extension Code Library. PECL, pronounced pickle, is a series of extensions to PHP written in C. These extensions are just like ones distributed with the main PHP release, but they're of more specialized interest — such as an interface to the XMMS multimedia player or the ImageMagick graphics library.&lt;br /&gt;
&lt;br /&gt;
Additionally, the PEAR package manager allows you to use the PEAR class management infrastructure with your personal projects. By creating your own packages that follow the PEAR format, your users can use ''pear'' to download and install the files from your project's web site.&lt;br /&gt;
&lt;br /&gt;
This chapter explains how to find a PEAR package you may want to use and how to install it on your machine. Because PEAR has many classes, you need an easy way to browse them. [[PHP Cookbook/PEAR#Finding PEAR Packages|Recipe 21.3]] covers the different ways to find PEAR packages; once you've found a package's name, [[PHP Cookbook/PEAR#Finding Information About a Package|Recipe 21.4]] shows how to view package details and information.&lt;br /&gt;
&lt;br /&gt;
Once you locate a class you want to use, you need to run ''pear'' to transfer the class to your machine and install it in the correct location on your server. Installing PEAR packages and PECL extensions are the subjects of [[PHP Cookbook/PEAR#Installing PEAR Packages|Recipe 21.5]] and [[PHP Cookbook/PEAR#Installing PECL Packages|Recipe 21.6]], respectively. [[PHP Cookbook/PEAR#Upgrading PEAR Packages|Recipe 21.7]] shows how discover if any upgrades are available to packages on your machine and how to install the latest versions. If you want to remove a package, see [[PHP Cookbook/PEAR#Uninstalling PEAR Packages|Recipe 21.8]].&lt;br /&gt;
&lt;br /&gt;
Finally, [[PHP Cookbook/PEAR#Documenting Classes with PHPDoc|Recipe 21.9]] describes how PEAR developers can write classes that abide by PEAR's coding standards and how to document your class with PHPDoc.&lt;br /&gt;
&lt;br /&gt;
PHP 4.3 includes the first stable release of PEAR. Earlier copies of PHP bundled versions of PEAR prior to PEAR 1.0, but ''pear'' and the other packages weren't guaranteed to work, as they were still in beta. If you are having problems using PEAR, you should remove any old files that may be interfering with the release version. This includes the ''pear'' application itself; it can't always upgrade itself to the latest release.&lt;br /&gt;
&lt;br /&gt;
If you can't upgrade to PHP 4.3 and need to bootstrap a copy of PEAR onto your system, run the following:&lt;br /&gt;
&lt;br /&gt;
 % '''&amp;lt;nowiki&amp;gt;lynx -source http://go-pear.org | php -q&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
 Welcome to go-pear!&lt;br /&gt;
 &lt;br /&gt;
 Go-pear will install the 'pear' command and all the files needed by&lt;br /&gt;
 it.  This command is your tool for PEAR installation and maintenance.&lt;br /&gt;
 &lt;br /&gt;
 Go-pear also lets you download and install the PEAR packages bundled&lt;br /&gt;
 with PHP: DB, Net_Socket, Net_SMTP, Mail, XML_Parser.&lt;br /&gt;
 &lt;br /&gt;
 If you wish to abort, press Control-C now, or press Enter to continue:&lt;br /&gt;
&lt;br /&gt;
This downloads a PHP script from the PEAR web site and hands it to PHP for execution. The program downloads all files needed to run ''pear'' and gets you up and running.&lt;br /&gt;
&lt;br /&gt;
On some Unix systems, you may need to run ''links'' instead of ''lynx''. If you have the command-line version of PHP installed, remove the &amp;lt;tt&amp;gt;-q&amp;lt;/tt&amp;gt; flag to PHP; the CLI version automatically suppresses HTTP headers. If ''go-pear'' seems to hang, set &amp;lt;tt&amp;gt;output_buffering&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;off&amp;lt;/tt&amp;gt; in your ''php.ini'' configuration file.&lt;br /&gt;
&lt;br /&gt;
Installation on Windows is a two-step process:&lt;br /&gt;
&lt;br /&gt;
 C:\&amp;gt; '''&amp;lt;nowiki&amp;gt;php-cli -r 'readfile(&amp;quot;http://go-pear.org&amp;quot;);' &amp;gt; go-pear&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
 c:\&amp;gt; '''php-cli go-pear'''&lt;br /&gt;
          &lt;br /&gt;
&lt;br /&gt;
The ''go-pear'' script requires PHP 4.1 or greater. For the Windows installation, ''php-cli'' is the command-line version of PHP.&lt;br /&gt;
&lt;br /&gt;
PHP installs PEAR by default, so if you're running PHP 4.3, you should be able to use PEAR without any additional setup.&amp;lt;ref&amp;gt;If you disable building the command-line version of PHP with &amp;lt;tt&amp;gt;--disable-cli&amp;lt;/tt&amp;gt;, PHP doesn't install PEAR.&amp;lt;/ref&amp;gt; Out of the box, PEAR installs ''pear'' in the same directory as ''php'' and places PEAR packages in ''prefix/lib/php''.&amp;lt;ref&amp;gt;This is probably ''/usr/local/lib/php''.&amp;lt;/ref&amp;gt; To install PEAR in another directory, add &amp;lt;tt&amp;gt;--with-pear=DIR&amp;lt;/tt&amp;gt; when configuring PHP.&lt;br /&gt;
&lt;br /&gt;
Once a PEAR package is installed, use it in your PHP scripts by calling &amp;lt;tt&amp;gt;require&amp;lt;/tt&amp;gt;. For example, here's how to include the &amp;lt;tt&amp;gt;Net_Dig&amp;lt;/tt&amp;gt; package:&lt;br /&gt;
&lt;br /&gt;
 require 'Net/Dig.php';&lt;br /&gt;
&lt;br /&gt;
If a package name contains an underscore, replace it with a slash, and add ''.php'' to the end.&lt;br /&gt;
&lt;br /&gt;
Some packages may require you to include multiple classes, such as SOAP, so instead of requiring ''SOAP.php'', you include ''SOAP/Client.php'' or ''SOAP/Server.php''. Read the documentation to discover if a particular package requires nonstandard file includes.&lt;br /&gt;
&lt;br /&gt;
Because PEAR packages are included as regular PHP files, make sure the directory containing the PEAR classes is in your &amp;lt;tt&amp;gt;include_path&amp;lt;/tt&amp;gt;. If it isn't, &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;require&amp;lt;/tt&amp;gt; can't find PEAR classes.&lt;br /&gt;
&lt;br /&gt;
To view instructions and examples showing how to use a particular PEAR class, check the PEAR Manual at ''http://pear.php.net/manual/en/packages.php'' or read the top section of the package's PHP files. For an example of a full-featured PEAR class in action, see the discussion of PEAR's database library in [[PHP Cookbook/Database Access#Connecting to a SQL Database|Recipe 10.4]].&lt;br /&gt;
&lt;br /&gt;
== Using the PEAR Package Manager ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
&lt;br /&gt;
You want to use the PEAR package manager, ''pear''. This allows you to install new packages, and upgrade and get information about your existing PEAR packages.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
To execute a command with the PEAR package manager, type the command name as the first argument on the command line:&lt;br /&gt;
&lt;br /&gt;
 % '''pear''' &lt;br /&gt;
                ''command''&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
=== Discussion ===&lt;br /&gt;
&lt;br /&gt;
Here's how to list all installed PEAR packages with the &amp;lt;tt&amp;gt;list&amp;lt;/tt&amp;gt; command:&amp;lt;ref&amp;gt;In early versions of ''pear'', this command was &amp;lt;tt&amp;gt;list-installed&amp;lt;/tt&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 % '''pear list'''&lt;br /&gt;
 Installed packages:&lt;br /&gt;
 =  ==  ==  ==  ==  ==  ==  ==  ==  ==&lt;br /&gt;
 +-----------------+----------+--------+&lt;br /&gt;
 | Package         | Version  | State  |&lt;br /&gt;
 | Archive_Tar     | 0.9      | stable |&lt;br /&gt;
 | Console_Getopt  | 0.11     | beta   |&lt;br /&gt;
 | DB              | 1.3      | stable |&lt;br /&gt;
 | HTTP            | 1.2      | stable |&lt;br /&gt;
 | Mail            | 1.0.1    | stable |&lt;br /&gt;
 | Mail_Mime       | 1.2.1    | stable |&lt;br /&gt;
 | Net_SMTP        | 1.0      | stable |&lt;br /&gt;
 | Net_Socket      | 1.0.1    | stable |&lt;br /&gt;
 | Net_URL         | 1.0.4    | stable |&lt;br /&gt;
 | PEAR            | 0.91-dev | beta   |&lt;br /&gt;
 | XML_Parser      | 1.0      | stable |&lt;br /&gt;
 | XML_RPC         | 1.0.3    | stable |&lt;br /&gt;
 +-----------------+----------+--------+&lt;br /&gt;
&lt;br /&gt;
For a list of all valid PEAR commands, use &amp;lt;tt&amp;gt;list-commands&amp;lt;/tt&amp;gt; . Many commands also have abbreviated names; for example, &amp;lt;tt&amp;gt;list&amp;lt;/tt&amp;gt; is also just &amp;lt;tt&amp;gt;l&amp;lt;/tt&amp;gt;. These names are usually the first few letters of the command name. See [[PHP Cookbook/PEAR#phpckbk-CHP-21-TABLE-1|Table 21-1]] for a list of frequently used commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;phpckbk-CHP-21-TABLE-1&amp;quot;&amp;gt;&lt;br /&gt;
'''Table 21-1. PEAR package manager commands'''&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Command name !! Shortcut !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;install&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;i&amp;lt;/tt&amp;gt; || Download and install packages&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;upgrade&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;up&amp;lt;/tt&amp;gt; || Upgrade installed packages&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;uninstall&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;un&amp;lt;/tt&amp;gt; || Remove installed packages&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;list&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;l&amp;lt;/tt&amp;gt; || List installed packages&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;list-upgrades&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;lu&amp;lt;/tt&amp;gt; || List all available upgrades for installed packages&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;search&amp;lt;/tt&amp;gt; || None || Search for packages&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''pear'' has commands both for using and for developing PEAR classes; as a result, you may not need all the commands. The &amp;lt;tt&amp;gt;package&amp;lt;/tt&amp;gt; command, for example, creates a new PEAR package. If you only run other peoples' packages, you can safely ignore this command.&lt;br /&gt;
&lt;br /&gt;
Like all programs, if you want to run ''pear'', you must have permission to execute it. If you can run ''pear'' while running as root, but not as a regular user, make sure the group- or world-execute bit is set. Similarly, for some actions, ''pear'' creates a lock file in the directory containing the PEAR files. You must have write permission to the file named ''.lock'' located in that directory.&lt;br /&gt;
&lt;br /&gt;
To find where your PEAR packages are located, run the &amp;lt;tt&amp;gt;config-get php_dir&amp;lt;/tt&amp;gt; command. You can check the value of the &amp;lt;tt&amp;gt;include_path&amp;lt;/tt&amp;gt; by calling &amp;lt;tt&amp;gt;ini_get('include_path')&amp;lt;/tt&amp;gt; from within PHP or by looking at your ''php.ini'' file. If you can't alter ''php.ini'' because you're in a shared hosting environment, add the directory to the &amp;lt;tt&amp;gt;include_path&amp;lt;/tt&amp;gt; at the top of your script before including the file. See [[PHP Cookbook/Web Basics#Setting Configuration Variables|Recipe 8.24]] for more on setting configuration variables from within PHP.&lt;br /&gt;
&lt;br /&gt;
If you're behind a HTTP proxy server, configure PEAR to use it with the command:&lt;br /&gt;
&lt;br /&gt;
 % '''pear config-set http_proxy proxy.example.com:8080'''&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
You can configure PEAR package manager settings using:&lt;br /&gt;
&lt;br /&gt;
 % '''pear set-config''' &lt;br /&gt;
                ''setting value''&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;tt&amp;gt;''setting''&amp;lt;/tt&amp;gt; is the name of the parameter to modify and &amp;lt;tt&amp;gt;''value''&amp;lt;/tt&amp;gt; is the new value. To see all your current settings, use the &amp;lt;tt&amp;gt;config-show&amp;lt;/tt&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
 % '''pear config-show'''&lt;br /&gt;
 Configuration:&lt;br /&gt;
 =  ==  ==  ==  ==  ==  ==  =&lt;br /&gt;
 +---------------------+-----------------+-------------------------------------+&lt;br /&gt;
 | PEAR executables    | bin_dir         | /usr/local/bin                      |&lt;br /&gt;
 | directory           |                 |                                     |&lt;br /&gt;
 | PEAR documentation  | doc_dir         | /usr/local/lib/php/docs             |&lt;br /&gt;
 | directory           |                 |                                     |&lt;br /&gt;
 | PHP extension       | ext_dir         | /usr/local/lib/php/extensions/no-de |&lt;br /&gt;
 | directory           |                 | bug-non-zts-20020429                |&lt;br /&gt;
 | PEAR directory      | php_dir         | /usr/local/lib/php                  |&lt;br /&gt;
 | PEAR data directory | data_dir        | /usr/local/lib/php/data             |&lt;br /&gt;
 | PEAR test directory | test_dir        | /usr/local/lib/php/tests            |&lt;br /&gt;
 | HTTP Proxy Server   | http_proxy      | &amp;lt;not set&amp;gt;                           |&lt;br /&gt;
 | Address             |                 |                                     |&lt;br /&gt;
 | PEAR server         | master_server   | pear.php.net                        |&lt;br /&gt;
 | PEAR password (for  | password        | &amp;lt;not set&amp;gt;                           |&lt;br /&gt;
 | maintainers)        |                 |                                     |&lt;br /&gt;
 | PEAR username (for  | username        | &amp;lt;not set&amp;gt;                           |&lt;br /&gt;
 | maintainers)        |                 |                                     |&lt;br /&gt;
 | Preferred Package   | preferred_state | stable                              |&lt;br /&gt;
 | State               |                 |                                     |&lt;br /&gt;
 | Unix file mask      | umask           | 18                                  |&lt;br /&gt;
 | Debug Log Level     | verbose         | 1                                   |&lt;br /&gt;
 +---------------------+-----------------+-------------------------------------+&lt;br /&gt;
&lt;br /&gt;
For a brief description of each configuration option, use the &amp;lt;tt&amp;gt;config-help&amp;lt;/tt&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
== Finding PEAR Packages ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
&lt;br /&gt;
You want a listing of PEAR packages. From this list you want to learn more about each package and decide if you want to install the package.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
Browse packages at ''http://pear.php.net/packages.php'' or search for packages at ''http://pear.php.net/package-search.php''. Use ''pear'' 's &amp;lt;tt&amp;gt;remote-list&amp;lt;/tt&amp;gt; command to get listing of PEAR packages or the &amp;lt;tt&amp;gt;search&amp;lt;/tt&amp;gt; command to search for packages.&lt;br /&gt;
&lt;br /&gt;
=== Discussion ===&lt;br /&gt;
&lt;br /&gt;
There are a few ways to review PEAR's packages. First, to browse the listings in a directory-style fashion, go to ''http://pear.php.net/packages.php''. From there you can burrow into each individual PEAR category.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can search through the listings at ''http://pear.php.net/package-search.php''. The search page allows you to search by package name, author, category, and release date.&lt;br /&gt;
&lt;br /&gt;
You can ask the PEAR package manager to provide you with a listing using the &amp;lt;tt&amp;gt;remote-list&amp;lt;/tt&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
 % '''pear remote-list'''&lt;br /&gt;
 Available packages:&lt;br /&gt;
 =  ==  ==  ==  ==  ==  ==  ==  ==  ==&lt;br /&gt;
 +----------------------+---------+&lt;br /&gt;
 | Package              | Version |&lt;br /&gt;
 | Archive_Tar          | 0.9     |&lt;br /&gt;
 | Auth                 | 1.0.2   |&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 | XML_Transformer      | 0.3     |&lt;br /&gt;
 | XML_Tree             | 1.1     |&lt;br /&gt;
 +----------------------+---------+&lt;br /&gt;
&lt;br /&gt;
The short form of &amp;lt;tt&amp;gt;remote-list&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;rl&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To search for package names from the command line, use the &amp;lt;tt&amp;gt;search&amp;lt;/tt&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
 % '''pear search auth'''&lt;br /&gt;
 Matched packages:&lt;br /&gt;
 =  ==  ==  ==  ==  ==  ==  ==  ==&lt;br /&gt;
 +-----------+--------+-------+------------------------------------+&lt;br /&gt;
 | Package   | Latest | Local |                                    |&lt;br /&gt;
 | Auth      | 1.0.2  | 1.0.2 | Creating an authentication system. |&lt;br /&gt;
 | Auth_HTTP | 1.0.1  | 1.0.1 | HTTP authentication for PHP        |&lt;br /&gt;
 +-----------+--------+-------+------------------------------------+&lt;br /&gt;
&lt;br /&gt;
This does a case-insensitive search of package names and returns the package name, the latest version number, the version you have installed (if any), and a short description about the package.&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
&lt;br /&gt;
[[PHP Cookbook/PEAR#Finding Information About a Package|Recipe 21.4]] to find out more information about a package.&lt;br /&gt;
&lt;br /&gt;
== Finding Information About a Package ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
&lt;br /&gt;
You want to gather information about a package, such a description of what it does, who maintains it, what version you have installed, and which license it's released under.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
If the package is installed on your machine, use the PEAR package manager's &amp;lt;tt&amp;gt;info&amp;lt;/tt&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
 % '''pear info Net_URL'''&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
Otherwise, use the &amp;lt;tt&amp;gt;remote-info&amp;lt;/tt&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
 % '''pear remote-info SOAP'''&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
You can also view the package's home page on ''http://pear.php.net''.&lt;br /&gt;
&lt;br /&gt;
=== Discussion ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;info&amp;lt;/tt&amp;gt; command provides summary information about a package:&lt;br /&gt;
&lt;br /&gt;
 % '''pear info Net_URL'''&lt;br /&gt;
 About Net_URL-1.0.4&lt;br /&gt;
 =  ==  ==  ==  ==  ==  ==  ==  ==  ==&lt;br /&gt;
 +-----------------+-----------------------------------------+&lt;br /&gt;
 | Package         | Net_URL                                 |&lt;br /&gt;
 | Summary         | Easy parsing of Urls                    |&lt;br /&gt;
 | Description     | Provides easy parsing of URLs and their |&lt;br /&gt;
 |                 | constituent parts.                      |&lt;br /&gt;
 | Maintainers     | Richard heyes &amp;lt;richard@php.net&amp;gt; (lead)  |&lt;br /&gt;
 | Version         | 1.0.4                                   |&lt;br /&gt;
 | Release Date    | 2002-07-27                              |&lt;br /&gt;
 | Release License | BSD                                     |&lt;br /&gt;
 | Release State   | stable                                  |&lt;br /&gt;
 | Release Notes   | License change                          |&lt;br /&gt;
 | Last Modified   | 2002-08-23                              |&lt;br /&gt;
 +-----------------+-----------------------------------------+&lt;br /&gt;
&lt;br /&gt;
If you don't have the package installed, ask the remote server for a description:&lt;br /&gt;
&lt;br /&gt;
 % '''pear remote-info Net_URL'''&lt;br /&gt;
 Package details:&lt;br /&gt;
 =  ==  ==  ==  ==  ==  ==  ==  =&lt;br /&gt;
 +-------------+-----------------------------------------+&lt;br /&gt;
 | Latest      | 1.0.4                                   |&lt;br /&gt;
 | Installed   | 1.0.4                                   |&lt;br /&gt;
 | Package     | Net_URL                                 |&lt;br /&gt;
 | License     | BSD                                     |&lt;br /&gt;
 | Category    | Networking                              |&lt;br /&gt;
 | Summary     | Easy parsing of Urls                    |&lt;br /&gt;
 | Description | Provides easy parsing of URLs and their |&lt;br /&gt;
 |             | constituent parts.                      |&lt;br /&gt;
 +-------------+-----------------------------------------+&lt;br /&gt;
&lt;br /&gt;
This request displays a slightly different set of information. It doesn't include the release data but does include the general PEAR category and the latest version number for the package.&lt;br /&gt;
&lt;br /&gt;
The package home page provides a more complete view and also provides links to earlier releases, a change log, and browseable access to the CVS repository. You can also view package download statistics. [[PHP Cookbook/PEAR#phpckbk-CHP-21-FIG-1|Figure 21-1]] shows a sample package information page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;phpckbk-CHP-21-FIG-1&amp;quot;&amp;gt;&lt;br /&gt;
'''Figure 21-1. Net_URL Package Information page on PEAR web site'''&lt;br /&gt;
&lt;br /&gt;
[[Image:PHP Cookbook_I_21_tt1185.png|Net_URL Package Information page on PEAR web site]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
&lt;br /&gt;
[[PHP Cookbook/PEAR#Finding PEAR Packages|Recipe 21.3]] to search for packages.&lt;br /&gt;
&lt;br /&gt;
== Installing PEAR Packages ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
&lt;br /&gt;
You want to install a PEAR package.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
Download and install the package from your PEAR server using the PEAR package manager:&lt;br /&gt;
&lt;br /&gt;
 % '''pear install''' &lt;br /&gt;
                ''Package_Name''&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
You can also install from any location on the Internet:&lt;br /&gt;
&lt;br /&gt;
 % '''&amp;lt;nowiki&amp;gt;pear install http://pear.example.com/&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
                ''Package_Name-1.0.tgz''&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
Here's how to install if you have a local copy of a package:&lt;br /&gt;
&lt;br /&gt;
 % '''pear install''' &lt;br /&gt;
                ''Package_Name-1.0.tgz''&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
=== Discussion ===&lt;br /&gt;
&lt;br /&gt;
To install PEAR packages, you need write permission where the packages are stored; this defaults to ''/usr/local/lib/php/''.&lt;br /&gt;
&lt;br /&gt;
You can also request multiple packages at the same time:&lt;br /&gt;
&lt;br /&gt;
 % '''pear install HTML_Common HTML_Javascript'''&lt;br /&gt;
 downloading HTML_Common-1.0.tgz ...&lt;br /&gt;
 ...done: 2,959 bytes&lt;br /&gt;
 install ok: HTML_Common 1.0&lt;br /&gt;
 downloading HTML_Javascript-1.0.0.tgz ...&lt;br /&gt;
 ...done: 4,141 bytes&lt;br /&gt;
 install ok: HTML_Javascript 1.0.0&lt;br /&gt;
&lt;br /&gt;
When installing a package, PEAR checks that you have all the necessary PHP functions and PEAR packages the new package depends on. If this check fails, PEAR reports on the dependencies:&lt;br /&gt;
&lt;br /&gt;
 % '''pear install HTML_Table'''&lt;br /&gt;
 downloading HTML_Table-1.1.tgz ...&lt;br /&gt;
 ...done: 5,168 bytes&lt;br /&gt;
 &lt;br /&gt;
 requires package `HTML_Common' &amp;gt;= 1.0&lt;br /&gt;
 HTML_Table: dependencies failed&lt;br /&gt;
&lt;br /&gt;
To fix this problem, download and install the missing packages first. If you want to ignore these dependencies, force installation with &amp;lt;tt&amp;gt;-n&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;--nodeps&amp;lt;/tt&amp;gt;. You can then later install the required package.&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
&lt;br /&gt;
[[PHP Cookbook/PEAR#Installing PECL Packages|Recipe 21.6]] for information on installing PECL packages; [[PHP Cookbook/PEAR#Upgrading PEAR Packages|Recipe 21.7]] for more on upgrading an existing package; [[PHP Cookbook/PEAR#Uninstalling PEAR Packages|Recipe 21.8]] to uninstall a package.&lt;br /&gt;
&lt;br /&gt;
== Installing PECL Packages ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
&lt;br /&gt;
You want to install a PECL package; this builds a PHP extension written in C to use inside PHP.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have all the necessary extension libraries and then use the PEAR package manager &amp;lt;tt&amp;gt;install&amp;lt;/tt&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
 % '''pear install xmms'''&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
To use the extension from PHP, load it using &amp;lt;tt&amp;gt;dl( )&amp;lt;/tt&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 dl('xmms.so');&lt;br /&gt;
&lt;br /&gt;
=== Discussion ===&lt;br /&gt;
&lt;br /&gt;
The frontend process for installing PECL packages is just like installing PEAR packages for code written in PHP. However, the behind-the-scenes tasks are very different. Because PECL extensions are written in C, the package manager needs to compile the extension and configure it to work with the installed version of PHP. As a result, at present, you can build PECL packages on Unix machines and on Windows machines if you use MSDev.&lt;br /&gt;
&lt;br /&gt;
Unlike PHP-based PEAR packages, PECL extensions don't automatically inform you when you lack a library necessary to compile the extension. Instead, you are responsible for correctly preinstalling these files. If you are having trouble getting a PECL extension to build, check the ''README'' file and the other documentation that comes with the package. The package manager installs these files inside the ''docs'' directory under your PEAR hierarchy.&lt;br /&gt;
&lt;br /&gt;
When you install a PECL extension, the PEAR package manager downloads the file, extracts it, runs ''phpize'' to configure the extension for the version of PHP installed on the machine, and then makes and installs the extension. It may also prompt you for the location of libraries:&lt;br /&gt;
&lt;br /&gt;
 % '''pear install xmms'''&lt;br /&gt;
 downloading xmms-0.2.tgz ...&lt;br /&gt;
 ...done: 11,968 bytes&lt;br /&gt;
 4 source files, building&lt;br /&gt;
 running: phpize&lt;br /&gt;
 PHP Api Version        : 20020307&lt;br /&gt;
 Zend Module Api No     : 20020429&lt;br /&gt;
 Zend Extension Api No  : 20020731&lt;br /&gt;
 Xmms library install dir? [autodetect] : &lt;br /&gt;
 building in /var/tmp/pear-build-adam/xmms-0.2&lt;br /&gt;
 running: /tmp/pearKIv63P/xmms-0.2/configure --with-xmms&lt;br /&gt;
 running: make&lt;br /&gt;
 xmms.so copied to /tmp/pearKIv63P/xmms-0.2/xmms.so&lt;br /&gt;
 install ok: xmms 0.2&lt;br /&gt;
&lt;br /&gt;
If these libraries are in a standard location, hitting Return selects the &amp;lt;tt&amp;gt;autodetect&amp;lt;/tt&amp;gt; option. PHP then searches for the libraries and selects them; you don't need to enter an explicit pathname, as in the case of the xmms library shown earlier.&lt;br /&gt;
&lt;br /&gt;
PECL extensions are stored in different places than non-PECL packages. If you want to run ''pear'', you must be able to write inside the PHP ''extensions'' directory. Some PECL packages, such as xmms, install files in the same directory as the PHP binary. Because of this, you may want to install these packages while running as the same user you used to install PHP. Also, check the execute permissions of these files; because most PEAR files aren't executable, your umask may not provide those executable files with the correct set of permissions.&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
&lt;br /&gt;
[[PHP Cookbook/PEAR#Installing PEAR Packages|Recipe 21.5]] for information on installing PEAR packages; [[PHP Cookbook/PEAR#Upgrading PEAR Packages|Recipe 21.7]] for more on upgrading an existing package; [[PHP Cookbook/PEAR#Uninstalling PEAR Packages|Recipe 21.8]] to uninstall a package.&lt;br /&gt;
&lt;br /&gt;
== Upgrading PEAR Packages ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
&lt;br /&gt;
You want to upgrade a package on your system to the latest version for additional functionality and bug fixes.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
Find out if any upgrades are available and then tell ''pear'' to upgrade the packages you want:&lt;br /&gt;
&lt;br /&gt;
 % '''pear list-upgrades'''&lt;br /&gt;
 % '''pear upgrade''' &lt;br /&gt;
                ''Package_Name''&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
=== Discussion ===&lt;br /&gt;
&lt;br /&gt;
Upgrading to a new version of a package is a simple task with the PEAR Package Manager. If you know a specific package is out of date, you can upgrade it directly. However, you may also want to just periodically check to see if any new releases are available.&lt;br /&gt;
&lt;br /&gt;
To do this, user the &amp;lt;tt&amp;gt;list-upgrades&amp;lt;/tt&amp;gt; command, which prints out a table showing package names, the new version number, and the size of the download:&lt;br /&gt;
&lt;br /&gt;
 % '''pear list-upgrades'''&lt;br /&gt;
 Available Upgrades (stable):&lt;br /&gt;
 =  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  =&lt;br /&gt;
 +-------------+---------+--------+&lt;br /&gt;
 | Package     | Version | Size   |&lt;br /&gt;
 | Archive_Tar | 0.9     | 8.9kB  |&lt;br /&gt;
 | Auth        | 1.0.2   | 8.8kB  |&lt;br /&gt;
 | Auth_HTTP   | 1.0.1   | 1.7kB  |&lt;br /&gt;
 | DB          | 1.3     | 58kB   |&lt;br /&gt;
 | HTTP        | 1.1     | 2.9kB  |&lt;br /&gt;
 | Mail        | 1.0.1   | 11.6kB |&lt;br /&gt;
 | Mail_Mime   | 1.2.1   | 15.0kB |&lt;br /&gt;
 | Net_Ping    | 1.0.1   | 2.1kB  |&lt;br /&gt;
 | Net_SMTP    | 1.0     | 2.8kB  |&lt;br /&gt;
 | Net_Socket  | 1.0.1   | 3.5kB  |&lt;br /&gt;
 | PEAR        | 0.9     | 40kB   |&lt;br /&gt;
 | XML_Parser  | 1.0     | 4.8kB  |&lt;br /&gt;
 | XML_RPC     | 1.0.3   | 11.9kB |&lt;br /&gt;
 | XML_RSS     | 0.9.1   | 3.1kB  |&lt;br /&gt;
 | XML_Tree    | 1.1     | 4.7kB  |&lt;br /&gt;
 +-------------+---------+--------+&lt;br /&gt;
&lt;br /&gt;
If you're up to date, ''pear'' prints:&lt;br /&gt;
&lt;br /&gt;
 No upgrades available&lt;br /&gt;
&lt;br /&gt;
To upgrade a particular package, use the &amp;lt;tt&amp;gt;upgrade&amp;lt;/tt&amp;gt; command. For example:&lt;br /&gt;
&lt;br /&gt;
 % '''pear upgrade DB'''&lt;br /&gt;
 downloading DB-1.3.tgz ...&lt;br /&gt;
 ...done: 59,332 bytes&lt;br /&gt;
&lt;br /&gt;
The short command for &amp;lt;tt&amp;gt;list-upgrades&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;lu&amp;lt;/tt&amp;gt;; for &amp;lt;tt&amp;gt;upgrade&amp;lt;/tt&amp;gt; it's &amp;lt;tt&amp;gt;up&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
PEAR also has an RSS feed listing new packages available at ''http://pear.php.net/rss.php''.&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
&lt;br /&gt;
[[PHP Cookbook/PEAR#Installing PEAR Packages|Recipe 21.5]] and [[PHP Cookbook/PEAR#Installing PECL Packages|Recipe 21.6]] for information on installing PEAR and PECL packages; [[PHP Cookbook/PEAR#Uninstalling PEAR Packages|Recipe 21.8]] to uninstall a package; [[PHP Cookbook/XML#Reading RSS Feeds|Recipe 12.12]] for more on parsing RSS feeds.&lt;br /&gt;
&lt;br /&gt;
== Uninstalling PEAR Packages ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
&lt;br /&gt;
You wish to remove a PEAR package from your system.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;uninstall&amp;lt;/tt&amp;gt; command tells the PEAR package manager to delete packages:&lt;br /&gt;
&lt;br /&gt;
 % '''pear uninstall HTML_Common'''&lt;br /&gt;
 uninstall HTML_Common ok&lt;br /&gt;
&lt;br /&gt;
=== Discussion ===&lt;br /&gt;
&lt;br /&gt;
Uninstalling a package removes it completely from your system. If you want to reinstall it, you must begin as if the package was never installed. PEAR doesn't warn you if you try to remove a package that's dependent on another package, so be careful when you uninstall.&lt;br /&gt;
&lt;br /&gt;
There is no way to automatically roll back an upgrade to an earlier version of a package using &amp;lt;tt&amp;gt;uninstall&amp;lt;/tt&amp;gt;. Also, PEAR complains if you try to install an earlier version over a later one. To force PEAR to overwrite a newer version, use &amp;lt;tt&amp;gt;install -f&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;install --force&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 % '''pear install --force Net_URL'''&lt;br /&gt;
 downloading Net_URL-1.0.4.tgz ...&lt;br /&gt;
 ...done: 3,540 bytes&lt;br /&gt;
 install ok: Net_URL 1.0.4&lt;br /&gt;
&lt;br /&gt;
The short command for &amp;lt;tt&amp;gt;uninstall&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;un&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
&lt;br /&gt;
[[PHP Cookbook/PEAR#Installing PEAR Packages|Recipe 21.5]] and [[PHP Cookbook/PEAR#Installing PECL Packages|Recipe 21.6]] for information on installing PEAR and PECL packages.&lt;br /&gt;
&lt;br /&gt;
== Documenting Classes with PHPDoc ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
&lt;br /&gt;
You want to be able to integrate documentation with your code.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
Use PHPDoc. This allows PEAR to accurately list your class, and you can use the PHPDoc tools to automatically generate API documentation in HTML and XML.&lt;br /&gt;
&lt;br /&gt;
PHPDoc syntax is based on Javadoc. The following tags are available for use: &amp;lt;tt&amp;gt;@access&amp;lt;/tt&amp;gt; , &amp;lt;tt&amp;gt;@author&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;@package&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;@param&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;@return&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;@since&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;@var&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;@version&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You can then use PEAR's PHPDoc utility to generate documentation.&lt;br /&gt;
&lt;br /&gt;
=== Discussion ===&lt;br /&gt;
&lt;br /&gt;
PHPDoc has a special inline documentation style. By formatting your comments in a particular way, the PHPDoc script can parse your code to not only generate which parameters a function take and what type of variable it returns, but also associate comments and other useful information with objects, functions, and variables.&lt;br /&gt;
&lt;br /&gt;
PHPDoc comments are based on the same formatting and naming conventions as Javadoc. So, to flag a comment block to grab PHPDoc's attention, use a traditional C-style comment but use two asterisks after the opening slash:&lt;br /&gt;
&lt;br /&gt;
 /**&lt;br /&gt;
 * This is a PHPDoc comment block&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
Inside of a block, certain keywords have special meaning. These keywords all begin with an at sign. [[PHP Cookbook/PEAR#phpckbk-CHP-21-TABLE-2|Table 21-2]] lists the keywords and what they stand for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;phpckbk-CHP-21-TABLE-2&amp;quot;&amp;gt;&lt;br /&gt;
'''Table 21-2. PHPDoc keywords'''&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Keyword !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;@access&amp;lt;/tt&amp;gt; || Method access: public or private&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;@author&amp;lt;/tt&amp;gt; || Package author&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;@package&amp;lt;/tt&amp;gt; || Package name&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;@param&amp;lt;/tt&amp;gt; || Function parameter&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;@return&amp;lt;/tt&amp;gt; || Function return value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;@see&amp;lt;/tt&amp;gt; || See also reference&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;@since&amp;lt;/tt&amp;gt; || Debut version of PHP&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;@var&amp;lt;/tt&amp;gt; || Object variable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;@version&amp;lt;/tt&amp;gt; || Package release number&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A more fully fleshed out example looks like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;/**&lt;br /&gt;
* Example_Class is a sample class for demonstrating PHPDoc&lt;br /&gt;
*&lt;br /&gt;
* Example_Class is a class that has no real actual code, but merely&lt;br /&gt;
* exists to help provide people with an understanding as to how the&lt;br /&gt;
* various PHPDoc tags are used.&lt;br /&gt;
*&lt;br /&gt;
* Example usage:&lt;br /&gt;
* if (Example_Class::example()) {&lt;br /&gt;
*    print &amp;quot;I am an example.&amp;quot;;&lt;br /&gt;
* }&lt;br /&gt;
*&lt;br /&gt;
* @package  Example&lt;br /&gt;
* @author   David Sklar &amp;lt;david@example.com&amp;gt;&lt;br /&gt;
* @author   Adam Trachtenberg &amp;lt;adam@example.com&amp;gt;&lt;br /&gt;
* @version  $Revision: 1.6 $&lt;br /&gt;
* @access   public&lt;br /&gt;
* @see      http://www.example.com/pear&lt;br /&gt;
*/&lt;br /&gt;
class Example extends PEAR&lt;br /&gt;
{&lt;br /&gt;
    /**&lt;br /&gt;
    * returns the sample data&lt;br /&gt;
    *&lt;br /&gt;
    * @param  string  $sample the sample data&lt;br /&gt;
    * @return array   all of the exciting sample options&lt;br /&gt;
    * @access private&lt;br /&gt;
    */&lt;br /&gt;
    function _sampleMe($sample)&lt;br /&gt;
    {&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any text following a keyword is treated as the value assigned to it. So, in this example, the value of &amp;lt;tt&amp;gt;@package&amp;lt;/tt&amp;gt; is &amp;quot;Example.&amp;quot; It can be okay to have two instances of the same keyword, depending upon the situation. For instance, it's perfectly legal to have multiple &amp;lt;tt&amp;gt;@param&amp;lt;/tt&amp;gt; keywords, but it's illegal to have multiple &amp;lt;tt&amp;gt;@return&amp;lt;/tt&amp;gt; keywords.&lt;br /&gt;
&lt;br /&gt;
PHPDoc and the PEAR web site use this information to generate hyperlinked references, so it's important to use a consistent naming scheme, or the cross-references won't work correctly.&lt;br /&gt;
&lt;br /&gt;
To generate PHPDoc, first install the PHPDoc PEAR package. Inside that package is a program named ''phpdoc'' ; run it from the command line, and use the &amp;lt;tt&amp;gt;-s&amp;lt;/tt&amp;gt; flag to pass in the directory of the source files. By default, documentation is generated in ''/usr/local/doc/pear/'', so be sure the ''phpdoc'' program has write permission to that location, or use &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; to alter the destination directory.&lt;br /&gt;
&lt;br /&gt;
To permanently modify the default values, edit the values at the top of the script. Pass &amp;lt;tt&amp;gt;-h&amp;lt;/tt&amp;gt; for a listing of all possible command-line parameters.&lt;br /&gt;
&lt;br /&gt;
PHPDoc isn't very efficient, so be patient. Generating documentation may take a while, depending upon the size of your files. A faster program is currently under development.&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
&lt;br /&gt;
PEAR coding standards at ''http://pear.php.net/manual/en/standards.php''; PHPDoc at ''http://pear.php.net/package-info.php?package=PHPDoc''.&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Docbook2Wiki</name></author>	</entry>

	</feed>