E-book details

The PEAR Installer Manifesto. The PEAR Installer maintainer shows you the power of this code management and deployment system to revolutionize your PHP application development

The PEAR Installer Manifesto. The PEAR Installer maintainer shows you the power of this code management and deployment system to revolutionize your PHP application development

Gregory Beaver

Ebook
PEAR stands for PHP Extension and Application Repository, and its primary purpose is to support code re-use. PEAR provides both an advanced installer and a code repository at http://pear.php.net. PEAR code is organized into discrete re-usable components called packages. A package consists of a group of files and a descriptor file called package.xml that contains metadata about the package's contents, such as the package version, any special dependencies, and textual information such as the package description and authors.
The software that transforms a package from an inert grouping of files into a dynamic software package is called the PEAR Installer and is itself a PEAR package. In other words, the PEAR Installer can be used to upgrade itself. It truly is a very powerful application.
In short, the PEAR Installer is one of the most effective tools for managing a high-quality software library, high-quality applications, or high-quality websites.
This book will show you a new way of organizing your PHP development, by leveraging the full power of the PEAR Installer. In a sense, the PEAR Installer is a step above a software design pattern, a meta-development pattern that can be used to systematically organize all of your PHP development.
You will learn how to organize your code into packages using the package.xml format. You will learn about the revolutionary new PEAR Channel concept, and how to safely and reliably depend on external PHP libraries from sources such as pear.php.net and other PEAR channels. You will learn about the PEAR_PackageFileManager package, and how to customize individual installations of your PHP code through file roles, file tasks, and post-installation scripts.
In addition, you will learn how to use the power of PEAR to manage your web projects with the PEAR installer to bring the power of versioning and rollbacks to your live website. The synergy of the PEAR Installer and a revision control system like CVS or Subversion is also explored in depth.
Next, you will learn how to set up your own PEAR Channel for distributing PHP applications, both open-source and proprietary closed-source PHP applications that can be secured using technology already built into the PEAR Installer.
Finally, you will learn how to embed the PEAR Installer inside your own web application in order to manage plug-ins from a remote server. The book covers in detail designing a custom plug-in system for a fictitious blog application. The plug-in system is used to manage templates, and the PEAR Installer is used to manage the details of querying the remote server for templates, handling dependencies between versioning, and doing the actual installation process as well.
  • The PEAR Installer Manifesto
    • Table of Contents
    • The PEAR Installer Manifesto
    • Credits
    • About the Author
    • About the Reviewers
    • Preface
      • What This Book Covers
      • Conventions
      • Reader Feedback
      • Customer Support
        • Downloading the Example Code for the Book
        • Errata
        • Questions
    • 1. Acquiring PEAR: What is it and How do I Get It?
      • A Democratic Innovation for PHP: PEAR Channels
      • What is PEAR? A Code Repository or an Installer?
        • PEAR Package Repository and PEAR Channel
        • PEAR Installer
      • Installing the PEAR Installer
        • PEAR Bundled with PHP
        • Installation for PHP Versions Older than 5.1.0
        • Other Unofficial Sources
      • Synchronizing to a Server with no Shell Access Using PEAR_RemoteInstaller
      • Summary
    • 2. Mastering PHP Software Management with the PEAR Installer
      • Distributing Libraries and Applications
        • Differences between Libraries and Applications from the Installers Point of View
      • Using Versioning and Dependencies to Help Track and Eliminate Bugs
        • Versioning
        • PEAR Packaging and Strict Version Validation
        • Enterprise-Level Dependency Management
      • Distribution and Upgrades for the End User
      • An Overview of package.xml Structure
      • Tags Shared between package.xml 1.0 and 2.0
        • Package Metadata
          • Package Name/Channel
          • Maintainers (Authors)
          • Package Description and Summary
        • Basic Release Metadata
          • Package Version
          • Package Stability
          • External Dependencies
            • Simplifying XML Validation of package.xml
            • Managing Trust of Dependencies
            • Reliably Depending on PECL Packages
          • Release Notes
          • Release License
          • Changelog
          • File List, or Contents of the Package
      • New Tags in package.xml
      • File/Directory Attributes: name, role, and baseinstalldir
      • Summary
    • 3. Leveraging Full Application Support with the PEAR Installer
      • package.xml Version 2.0: Your Sexy New Friend
      • PEAR Channels: A Revolution in PHP Installation
      • Application Support
        • Introduction to Custom File Roles
          • Creating PEAR_Installer_Role_Chiaramdb2schema Custom Role
          • Full Range of Possible Custom File Roles
        • Introduction to Custom File Tasks
          • Creating the PEAR_Task_Chiara_Managedb Custom Task
          • The Full Range of Possible Custom File Tasks
            • validXml($pkg, $xml, &$config, $fileXml)
            • init($xml, $fileAttributes, $lastVersion)
            • startSession($pkg, $contents, $dest)
            • run($tasks)
        • Post-Installation Scripts for Ultimate Customization
            • Components of a Post-Install Script
      • Bundling Several Packages into a Single Archive
      • Backwards Compatibility: Using package.xml 1.0 and 2.0
      • Why Support Old and Crusty package.xml 1.0?
      • Case Study: The PEAR Package
      • PEAR_PackageFileManager
        • Obtaining PEAR_PackageFileManager
        • PEAR_PackageFileManager Script and the package.xml Files it Generates
        • How PEAR_PackageFileManager Makes a Hard Life Easy
          • Globbing Files for package.xml
          • Managing Changelog
          • Synchronizing package.xml Version 1.0 and package.xml Version 2.0
      • Creating a Package for Installation with the PEAR Installer
      • Summary
    • 4. Clever Website Coordination Using the PEAR Installer
      • Overview of the Problem
      • Understanding the Problem
        • Managing Code Breakage and Reverting to Previous Versions
        • Managing Missing or Extraneous Files
        • Coordinating Development with a Team of Developers
        • Backing Up Code: Redundancy as a Necessary Precaution
      • The Solution, Part I: All-Important Source Control
        • Providing Redundancy and Revision History
        • Installing CVS or Subversion
          • Concurrent Versions System
            • Setting Up a CVS Repository
          • Subversion
            • Setting Up a Subversion Repository
        • Intelligent Source Control
          • Maintaining Branches for Complex Versioning Support
          • Using Tags to Mark Point Releases
      • The Solution, Part II: Using the PEAR Installer to Update the Website
        • Generating package.xml from the Source Control Checkout
        • Packaging: Coordinating Release Versions with Tags and Branches
        • Testing the Release before Uploading
        • Upgrading the Live Server
          • Using the pear upgrade Command
          • The Real Beauty of Using Pear to Fix Problems
      • Summary
    • 5. Releasing to the World: PEAR Channels
      • Distributing a package.xml-Based Package
      • Distributing Packages through a Channel Server
        • The channel.xml File
        • channel.xml Tag Summary
        • Obtaining Chiara_PEAR_Server
        • Configuring the Server; Obtaining a Front End for End Users
        • Adding a Package and Releasing Packages
        • Installing a Public Channel Front End
      • Distributing Pay-For-Use PHP Applications through a Channel
      • Distributing Packages through Static tarballs for Single-Client Installations
        • Who Needs this Feature?
        • Differences in package.xml and Dependencies
        • Releasing Equals Uploading
      • Security Issues Inherent in Remote Installation
        • How do PEAR Installer and Chiara_PEAR_Server Provide Security?
          • Extra Security beyond what PEAR Provides
          • Specific Security Principles Applied in Designing the PEAR Installer and Chiara_PEAR_Server
      • Summary
    • 6. Embedding the PEAR Installer: Designing a Custom Plug-In System
      • Why Embed PEAR?
        • Simplify User Choices for Installation
        • Eliminate Chances for Error
      • Other Plug-In Systems
        • Bundling Plug-Ins Directly in the Source Code
        • Subpackages - PEAR Dependencies
          • Case Study: MDB2
        • Custom Plug-In Systems: Remote Server
          • Case Study: Serendipity Blog's Spartacus Plug-In Manager
          • Case Study: Seagull Framework's Embedded PEAR Installer
      • Designing a Custom PEAR Channel-Based Plug-In System
        • Reusing Existing Functionality
          • PEAR Installer Infrastructure: REST and PEAR Installer Classes
            • PEAR_Config
            • PEAR_Dependency2
            • PEAR_REST and PEAR_REST_10/PEAR_REST_11
            • PEAR_Downloader and PEAR_Downloader_Package
            • PEAR_Installer
        • Extending REST with Custom Information
        • Designing a Lightweight Installer Plug-In: The Code At Last
          • MyBlog_Template_IConfig and MyBlog_Template_Config
          • MyBlog_Template_REST
          • MyBlog_Template_Lister
          • MyBlog_Template_Fetcher
          • The MyBlog Post-Install Script
          • The Rest of the Fake MyBlog Package
          • Improvements for the Ambitious
      • Summary
    • Index
  • Title: The PEAR Installer Manifesto. The PEAR Installer maintainer shows you the power of this code management and deployment system to revolutionize your PHP application development
  • Author: Gregory Beaver
  • Original title: The PEAR Installer Manifesto. The PEAR Installer maintainer shows you the power of this code management and deployment system to revolutionize your PHP application development
  • ISBN: 9781847190130, 9781847190130
  • Date of issue: 2006-10-30
  • Format: Ebook
  • Item ID: e_3blb
  • Publisher: Packt Publishing