Creating a PEAR2 Package

From PEAR Wiki

Jump to: navigation, search

[edit] How to create a PEAR2 package

The easiest way to create a Pyrus installable package is to set up a standard filesystem layout, and auto-generate the package.xml manifest for installation.

The source layout is as follows:

PackageName/src/      [role="php"]
PackageName/examples/ [role="doc"]
PackageName/doc/      [role="doc"]
PackageName/data/     [role="data"]
PackageName/tests/    [role="test"]
PackageName/www/      [role="www"]
PackageName/scripts/  [role="script"]


In the root of your package directory create the following files:

CREDITS (this file contains the project lead info) example

; maintainers of PackageName
Brett Bieber [saltybeagle] <brett.bieber@gmail.com> (lead)


README (this file contains the summary and description for the package) example

This package is for use with blah

With this package you can do blah, blah, blah blah. My extended
description goes here. 

RELEASE-0.1.0 (This file contains the release notes) example

This is the first alpha release.

Take a look at the Pyrus_Developer package for more info.

You can create your PEAR2 installable package by using the Pyrus_Developer package and using a file like this: makepackage.php

<?php
error_reporting(E_ALL);
ini_set('display_errors',true);
require 'pyrus/src/PEAR2/Autoload.php';

$a = new PEAR2_Pyrus_Developer_PackageFile_PEAR2SVN(dirname(__FILE__), 'PEAR2_MyNewPackage');


Then run the file to generate the package.xml and install your package:

php makepackage.php
cd ~/pyrus
php ~/PEAR2_SVN/PEAR2/Pyrus/pyrus.phar install PackageName/package.xml
Personal tools