PEAR logo

PEAR_PackageFileManager : The Definitive Guide



Chapter 8. Maintaining users list

Table of Contents

Add a new user on maintainers list
Remove a user on maintainers list
Change full name, email address, role or status of a maintainer
Getting list of maintainer

This lesson :

Add a new user on maintainers list

No big change since API 1.5.x that manage package.xml 1.0; We use the same method name addMaintainer() with parameters :

role

role of maintainer

Every maintainer has one of four possible roles:

  • lead: the primary maintainer
  • developer: an important developer on the project
  • contributor: self-explanatory
  • helper: ditto
handle

username on pear.php.net of maintainer

name

full name of maintainer

email

email address of maintainer

active

status of maintainer (active = 'yes', inactive = 'no')

[Important] Important
No checking of duplicates is performed, use updateMaintainer() for that purpose.
[Warning] Warning
Role, and Handle parameters are not given in same order. See example below:

To produce a package.xml version 1.0

  1. <?php
  2. require_once 'PEAR/PackageFileManager.php';
  3.  
  4. PEAR::setErrorHandling(PEAR_ERROR_DIE);
  5.  
  6. $p1 = new PEAR_PackageFileManager();
  7. //...
  8. $p1->addMaintainer('jeichorn', 'lead', 'Joshua Eichorn', 'josh@bluga.net');
  9. $p1->addMaintainer('davidc', 'lead', 'David Coallier', 'davidc@php.net');
  10. ?>

To produce a package.xml version 2.0

  1. <?php
  2. require_once 'PEAR/PackageFileManager2.php';
  3.  
  4. PEAR::setErrorHandling(PEAR_ERROR_DIE);
  5.  
  6. $p2 = new PEAR_PackageFileManager2();
  7. //...
  8. $p2->addMaintainer('lead', 'jeichorn', 'Joshua Eichorn', 'josh@bluga.net');
  9. $p2->addMaintainer('lead', 'davidc', 'David Coallier', 'davidc@php.net', 'no');
  10. ?>
[Tip] Tip
You may now with PEAR_PackageFileManager 1.6.0+ add a new user with a default inactive status. It was not possible with package xml 1.0; When a user was added as maintainer, it was considered as active. No way to made him inactive, except to remove him definitively.

See previous example with "davidc", added as inactive.

PEAR_PackageFileManager : The Definitive Guide v 1.6.0 : November 17, 2006