<?php
require_once 'PEAR/PackageFileManager/Frontend.php';
function varDump($var)
{
$available = PEAR_PackageFileManager2::isIncludeable('Var_Dump.php');
if ($available) {
include_once 'Var_Dump.php';
Var_Dump::display($var, false, array('display_mode' => 'HTML4_Table'));
} else {
$styles = array('');
echo '<pre style="background-color:#eee; color:#000; padding:1em;">';
var_dump($var);
echo '</pre>';
}
}
function haltOnError($err)
{
if ($err['level'] == 'error') {
echo __FUNCTION__;
varDump($err);
return PEAR_ERRORSTACK_DIE;
}
}
session_start();
// configuration options
$conf['pfm']['baseinstalldir'] = 'PEAR';
$config = array($conf, 'phparray');
// where to find package sources
$pkgDir = 'E:/PEAR/PEAR/PEAR_PackageFileManager-1.6.0a7';
PEAR_ErrorStack::staticPushCallback('haltOnError');
$web =& PEAR_PackageFileManager_Frontend::singleton('Web', $pkgDir);
$web->loadPreferences($config);
echo '<h1>All maintainers</h1>';
$maint = $web->getMaintList();
varDump($maint);
echo '<h1>Leader only </h1>';
$maint = $web->getMaintList('lead');
varDump($maint);
echo '<h1>Developper only </h1>';
$maint = $web->getMaintList('developer');
varDump($maint);
echo '<h1>unknown users </h1>';
$maint = $web->getMaintList('users');
varDump($maint);
print 'still alive !';
?>