Keep in mind
that you need to add the PEAR base directory to your include_path directive; otherwise,
an error similar to the following will occur:
Fatal error: Class 'MDB2' not found in /home/www/htdocs/book/11/database.php
on line 3
Those of you with particularly keen eyes might have noticed that in the earlier
example involving the Numbers_Roman package, a directory was also referenced:
require_once("Numbers/Roman.php");
A directory is referenced because the Numbers_Roman package falls under the Numbers
category, meaning that, for purposes of organization, a corresponding hierarchy will be
created, with Roman.php placed in a directory named Numbers. You can determine the
package??™s location in the hierarchy simply by looking at the package name. Each underscore
is indicative of another level in the hierarchy, so in the case of Numbers_Roman, it??™s
Numbers/Roman.php. In the case of MDB2, it??™s just MDB2.php.
?– Note See Chapter 2 for more information about the include_path directive.
Upgrading Packages
All PEAR packages must be actively maintained, and most are in a regular state of
development. That said, to take advantage of the latest enhancements and bug fixes,
you should regularly check whether a new package version is available. You can upgrade
a specific package, or all packages at once.
Upgrading a Single Package
The general syntax for upgrading a single package looks like this:
%>pear upgrade [package name]
CHAPTER 11 ?– PEAR 321
For instance, on occasion you??™ll want to upgrade the PEAR package, responsible
for managing your package environment.
Pages:
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397