-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
The PEAR Installer Manifesto
By :
Chances are, you've seen the acronym PEAR at some point in your use of PHP, whether it was in passing or when installing and using a package from pear.php.net. If you've investigated, you've probably heard of popular software provided by PEAR, such as the DB database abstraction package, or the HTML_QuickForm package. What you may not realize is that PEAR is much more than just a collection of packages that you can use. PEAR also contains the most versatile installation program for PHP, the PEAR installer.
With the PEAR installer, you can do much more than just install packages from pear.php.net. You can install packages from other PEAR channels, distribute your own software projects using your own PEAR channel, and even maintain a complex web project, all using the PEAR installer. Surprised? Well read on, as this book reveals the intimate secrets of the PEAR installer and how it will revolutionize your everyday development with the PHP programming language!
Chapter 1 introduces you to the PEAR installer. We begin with a look at the traditional unzip-and-go method of distributing PHP software and compare its advantages and disadvantages to the PEAR installer's package-based method of distributing PHP software. You will see the innovation of PEAR channels, take a peek inside how the PEAR installer installs files from packages, and learn how it knows where to install them. Finally, you will see the many ways to acquire the PEAR installer and even how to install PEAR remotely onto a web host that does not provide shell access.
Chapter 2 is a must-read for all PHP developers, as it explains the basic workings of package.xml, the heart of the PEAR installer. package.xml is used to control almost everything the PEAR installer can do. You will learn about the importance of versioning in controlling the quality of packages installed, the importance of dependencies, and how the PEAR installer manages this important link between libraries and applications. You will also learn how package.xml organizes package metadata such as the package name, authors, release notes, and changelog, and has critical installation data such as files, dependencies, and versioning organized.
Chapter 3 goes further in depth for developers who want to take advantage of the full application-support features introduced in package.xml version 2.0.
Chapter 4 takes a break from looking at the details of the PEAR installer, and dives into using the PEAR installer to develop and to maintain a complicated and rapidly evolving website.
Chapter 5 covers PEAR channels. Channels are designed to make it easy to install packages from any location, but difficult to compromise your system in the process, following a basic security principle: always design things so that the easiest way to do them is the most secure.
Channels open up pear.php.net's monopoly over the PEAR installer to the entire Internet. Custom-built packages distributed through your channel can even be sold and made available to specific users while co-existing peacefully with publicly available open-source packages.
Chapter 6 teaches you how to embed the PEAR installer to create a plug-in manager. The chapter creates a fake blog application that provides the ability to seamlessly query a remote PEAR channel server designed to distribute templates. Using the internal classes of the PEAR installer, our blog web application intelligently installs and upgrades templates with all of the sophistication expected from the PEAR installer.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
There are three styles for code. Code words in text are shown as follows: "Next, you need to create a configuration file for the remote machine using the config-create command."
A block of code will be set as follows:
<file name="blah.php" role="php"> <tasks:replace from="@DATABASE-URL@" to="database_url" type="pear-config" /> </file>
When we wish to draw your attention to a particular part of a code block, the relevant lines or items will be made bold:
if (is_object($infoplugin)) {
$bag = new serendipity_property_bag;
$infoplugin->introspect($bag);
if ($bag->get('version') == $data['version']) {
$installable = false;
} elseif (version_compare($bag->get('version'),
$data['version'], '<')) {
$data['upgradable'] = true;
$data['upgrade_version'] = $data['version'];
$data['version'] = $bag->get('version');
Any command-line input and output is written as follows:
$ pear c pear.ini remote-install o DB_DataObject
New terms and important words are introduced in a bold-type font. Words that you see on the screen, in menus or dialog boxes for example, appear in our text like this: "clicking the Next button moves you to the next screen".
Warnings or important notes appear in a box like this.
Tips and tricks appear like this.
Feedback from our readers is always welcome. Let us know what you think about this book, what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply drop an email to < [email protected]>, making sure to mention the book title in the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or email <[email protected]>.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Visit http://www.packtpub.com/support, and select this book from the list of titles to download any example code or extra resources for this book. The files available for download will then be displayed.
The downloadable files contain instructions on how to use them.
Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in text or code—we would be grateful if you would report this to us. By doing this you can save other readers from frustration, and help to improve subsequent versions of this book. If you find any errata, report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the Submit Errata link, and entering the details of your errata. Once your errata have been verified, your submission will be accepted and the errata added to the list of existing errata. The existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
You can contact us at <[email protected]> if you are having a problem with some aspect of the book, and we will do our best to address it.
Change the font size
Change margin width
Change background colour