Beispiel #1
0
 public function main()
 {
     $packagexml = new PEAR_PackageFileManager();
     $e = $packagexml->setOptions(array('version' => '0.5', 'state' => 'alpha', 'notes' => 'Preview release.', 'pathtopackagefile' => $this->packageFileDir, 'packagedirectory' => $this->baseFilesDir, 'baseinstalldir' => 'phocoa', 'simpleoutput' => true, 'filelistgenerator' => 'file', 'ignore' => array(), 'installexceptions' => array('phpdocs' => '/*'), 'dir_roles' => array('phpdocs' => 'doc')));
     if (PEAR::isError($e)) {
         echo $e->getMessage();
         return;
     }
     $e = $packagexml->writePackageFile();
     if (PEAR::isError($e)) {
         echo $e->getMessage();
     }
 }
 /**
  * Sets PEAR package.xml options, based on class properties.
  *
  * @throws BuildException
  * @return void
  */
 protected function setOptions()
 {
     // 1) first prepare/populate options
     $this->populateOptions();
     // 2) make any final adjustments (this could move into populateOptions() also)
     // default PEAR basedir would be the name of the package (e.g."phing")
     if (!isset($this->preparedOptions['baseinstalldir'])) {
         $this->preparedOptions['baseinstalldir'] = $this->package;
     }
     // unless filelistgenerator has been overridden, we use Phing FileSet generator
     if (!isset($this->preparedOptions['filelistgenerator'])) {
         if (empty($this->filesets)) {
             throw new BuildException("You must use a <fileset> tag to specify the files to include in the package.xml");
         }
         $this->preparedOptions['filelistgenerator'] = 'Fileset';
         $this->preparedOptions['usergeneratordir'] = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pearpackage';
         // Some PHING-specific options needed by our Fileset reader
         $this->preparedOptions['phing_project'] = $this->project;
         $this->preparedOptions['phing_filesets'] = $this->filesets;
     } elseif ($this->preparedOptions['filelistgenerator'] != 'Fileset' && !empty($this->filesets)) {
         throw new BuildException("You cannot use <fileset> element if you have specified the \"filelistgenerator\" option.");
     }
     // 3) Set the options
     // No need for excessive validation here, since the  PEAR class will do its own
     // validation & return errors
     $e = $this->pkg->setOptions($this->preparedOptions);
     if (PEAR::isError($e)) {
         throw new BuildException("Unable to set options.", new Exception($e->getMessage()));
     }
     // convert roles
     foreach ($this->roles as $role) {
         $this->pkg->addRole($role->getExtension(), $role->getRole());
     }
 }
Beispiel #3
0
 /**
  * Return a list of all files in the CVS repository
  *
  * This function is like {@link parent::dirList()} except
  * that instead of retrieving a regular filelist, it first
  * retrieves a listing of all the CVS/Entries files in
  * $directory and all of the subdirectories.  Then, it
  * reads the Entries file, and creates a listing of files
  * that are a part of the CVS repository.  No check is
  * made to see if they have been modified, but newly
  * added or removed files are ignored.
  * @return array list of files in a directory
  * @param string $directory full path to the directory you want the list of
  * @uses _recurDirList()
  * @uses _readCVSEntries()
  */
 function dirList($directory)
 {
     static $in_recursion = false;
     if (!$in_recursion) {
         // include only CVS/Entries files
         $this->_setupIgnore(array('*/CVS/Entries'), 0);
         $this->_setupIgnore(array(), 1);
         $in_recursion = true;
         $entries = parent::dirList($directory);
         $in_recursion = false;
     } else {
         return parent::dirList($directory);
     }
     if (!$entries || !is_array($entries)) {
         return PEAR_PackageFileManager::raiseError(PEAR_PACKAGEFILEMANAGER_NOCVSENTRIES, $directory);
     }
     return $this->_readCVSEntries($entries);
 }
 /**
  * Build a list of files based on the output of the 'p4 have' command.
  *
  * @param   string  $directory  The directory in which to list the files.
  *
  * @return  mixed   An array of full filenames or a PEAR_Error value if
  *                  $directory does not exist.
  */
 function dirList($directory)
 {
     /* Return an error if the directory does not exist. */
     if (@is_dir($directory) === false) {
         return PEAR_PackageFileManager::raiseError(PEAR_PACKAGEFILEMANAGER_DIR_DOESNT_EXIST, $directory);
     }
     /* List the files below $directory that are under Perforce control. */
     exec("p4 have {$directory}/...", $output);
     /* Strip off everything except the filename from each line of output. */
     $files = preg_replace('/^.* \\- /', '', $output);
     /* If we have a list of files to include, remove all other entries. */
     if ($this->ignore[0]) {
         $files = array_filter($files, array($this, '_includeFilter'));
     }
     /* If we have a list of files to ignore, remove them from the array. */
     if ($this->ignore[1]) {
         $files = array_filter($files, array($this, '_ignoreFilter'));
     }
     return $files;
 }
 /**
  * Return a list of all files in the CVS repository
  *
  * This function is like {@link parent::dirList()} except
  * that instead of retrieving a regular filelist, it first
  * retrieves a listing of all the .svn/entries files in
  * $directory and all of the subdirectories.  Then, it
  * reads the entries file, and creates a listing of files
  * that are a part of the Subversion checkout.  No check is
  * made to see if they have been modified, but removed files
  * are ignored.
  *
  * @access protected
  * @return array list of files in a directory
  * @param  string $directory full path to the directory you want the list of
  * @uses   _recurDirList()
  * @uses   _readSVNEntries()
  */
 function dirList($directory)
 {
     static $in_recursion = false;
     if (!$in_recursion) {
         // include only .svn/entries files
         // since subversion keeps its data in a hidden
         // directory we must force PackageFileManager to
         // consider hidden directories.
         $this->_options['addhiddenfiles'] = true;
         $this->_setupIgnore(array('*/.svn/entries'), 0);
         $this->_setupIgnore(array(), 1);
         $in_recursion = true;
         $entries = parent::dirList($directory);
         $in_recursion = false;
     } else {
         return parent::dirList($directory);
     }
     if (!$entries || !is_array($entries)) {
         return PEAR_PackageFileManager::raiseError(PEAR_PACKAGEFILEMANAGER_NOSVNENTRIES, $directory);
     }
     return $this->_readSVNEntries($entries);
 }
Beispiel #6
0
 /**
  * Main entry point.
  * @return void
  */
 public function main()
 {
     if ($this->dir === null) {
         throw new BuildException("You must specify the \"dir\" attribute for PEAR package task.");
     }
     if ($this->package === null) {
         throw new BuildException("You must specify the \"name\" attribute for PEAR package task.");
     }
     $this->pkg = new PEAR_PackageFileManager();
     $this->setOptions();
     $e = $this->pkg->writePackageFile();
     if (PEAR::isError($e)) {
         throw new BuildException("Unable to write package file.", new Exception($e->getMessage()));
     }
 }
require_once 'PEAR/PackageFileManager.php';
$version = '0.20.0';
$state = 'beta';
$notes = <<<EOT
- Request #13564:  bool(false) is converted to empty string
EOT;
$description = <<<EOT
XML_Serializer serializes complex data structures like arrays or object as XML documents.
This class helps you generating any XML document you require without the need for DOM.
Furthermore this package can be used as a replacement to serialize() and unserialize() as it comes with a matching XML_Unserializer that is able to create PHP data structures (like arrays and objects) from XML documents, if type hints are available.
If you use the XML_Unserializer on standard XML files, it will try to guess how it has to be unserialized. In most cases it does exactly what you expect it to do.
Try reading a RSS file with XML_Unserializer and you have the whole RSS file in a structured array or even a collection of objects, similar to XML_RSS.

Since version 0.8.0 the package is able to treat XML documents similar to the simplexml extension of PHP 5.
EOT;
$package = new PEAR_PackageFileManager();
$result = $package->setOptions(array('package' => 'XML_Serializer', 'summary' => 'Swiss-army knife for reading and writing XML files. Creates XML files from data structures and vice versa.', 'description' => $description, 'version' => $version, 'state' => $state, 'license' => 'BSD License', 'filelistgenerator' => 'cvs', 'ignore' => array('package.php', 'package.xml', 'package2.xml'), 'notes' => $notes, 'simpleoutput' => true, 'baseinstalldir' => 'XML', 'packagedirectory' => './', 'dir_roles' => array('docs' => 'doc', 'examples' => 'doc', 'tests' => 'test')));
if (PEAR::isError($result)) {
    echo $result->getMessage();
    die;
}
$package->addMaintainer('schst', 'lead', 'Stephan Schmidt', '*****@*****.**');
$package->addMaintainer('ashnazg', 'lead', 'Chuck Burgess', '*****@*****.**');
$package->addGlobalReplacement('package-info', '@package_version@', 'version');
$package->addDependency('php', '4.2.0', 'ge', 'php', false);
$package->addDependency('PEAR', '', 'has', 'pkg', false);
$package->addDependency('XML_Parser', '1.2.6', 'ge', 'pkg', false);
$package->addDependency('XML_Util', '1.1.1', 'ge', 'pkg', false);
if (isset($_GET['make']) || isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == 'make') {
    $result = $package->writePackageFile();
} else {
Beispiel #8
0
These are written as extensions of base test case classes, each extended with
methods that actually contain test code. Top level test scripts then invoke
the run()  methods on every one of these test cases in order. Each test
method is written to invoke various assertions that the developer expects to
be true such as assertEqual(). If the expectation is correct, then a
successful result is dispatched to the observing test reporter, but any
failure triggers an alert and a description of the mismatch.

These tools are designed for the developer. Tests are written in the PHP
language itself more or less as the application itself is built. The advantage
of using PHP itself as the testing language is that there are no new languages
to learn, testing can start straight away, and the developer can test any part
of the code. Basically, all parts that can be accessed by the application code
can also be accessed by the test code if they are in the same language. 
EOD;
$packagexml = new PEAR_PackageFileManager();
$e = $packagexml->setOptions(array('baseinstalldir' => 'simpletest', 'version' => '1.0.0', 'license' => 'The Open Group Test Suite License', 'packagedirectory' => '/var/www/html/tmp/simpletest', 'state' => 'stable', 'package' => 'simpletest', 'simpleoutput' => true, 'summary' => $shortDesc, 'description' => $longDesc, 'filelistgenerator' => 'file', 'notes' => 'See the CHANGELOG for full list of changes', 'dir_roles' => array('extensions' => 'php', 'test' => 'test'), 'ignore' => array('packages/', 'tutorials/', 'ui/', 'docs/', '*CVS*', 'TODO'), 'roles' => array('php' => 'php', 'html' => 'php', '*' => 'php'), 'exceptions' => array('VERSION' => 'doc', 'HELP_MY_TESTS_DONT_WORK_ANYMORE' => 'doc', 'LICENSE' => 'doc', 'README' => 'doc')));
if (is_a($e, 'PEAR_Error')) {
    echo $e->getMessage();
    die;
}
$e = $packagexml->addMaintainer('lastcraft', 'lead', 'Marcus Baker', '*****@*****.**');
if (is_a($e, 'PEAR_Error')) {
    echo $e->getMessage();
    exit;
}
$e = $packagexml->addMaintainer('tswicegood', 'developer', 'Travis Swicegood', '*****@*****.**');
if (is_a($e, 'PEAR_Error')) {
    echo $e->getMessage();
    exit;
}
<?php

/**
 * A complex example
 * @package PEAR_PackageFileManager
 */
/**
 * Include the package file manager
 */
require_once 'PEAR/PackageFileManager.php';
$test = new PEAR_PackageFileManager();
// directory that phpDocumentor 1.2.2 CVS is located in
$packagedir = 'C:/Web Pages/chiara/phpdoc';
$e = $test->setOptions(array('baseinstalldir' => 'PhpDocumentor', 'version' => '1.2.2', 'packagedirectory' => $packagedir, 'state' => 'stable', 'filelistgenerator' => 'cvs', 'notes' => 'Bugfix release

- DocBook/peardoc2 converter outputs valid DocBook
- fixed Page-Level DocBlock issues, now a page-level
  docblock is the first docblock in a file if it contains
  a @package tag, UNLESS the next element is a class.  Warnings
  raised are much more informative
- removed erroneous warning of duplicate @package tag in certain cases
- fixed these bugs:
 [ 765455 ] phpdoc can\'t find php if it is in /usr/local/bin
 [ 767251 ] broken links when no files in default package
 [ 768947 ] Multiple vars not recognised
 [ 772441 ] nested arrays fail parser
', 'package' => 'PhpDocumentor', 'dir_roles' => array('Documentation' => 'doc', 'Documentation/tests' => 'test'), 'exceptions' => array('index.html' => 'php', 'docbuilder/index.html' => 'php', 'docbuilder/blank.html' => 'php', 'README' => 'doc', 'ChangeLog' => 'doc', 'PHPLICENSE.txt' => 'doc', 'poweredbyphpdoc.gif' => 'data', 'INSTALL' => 'doc', 'FAQ' => 'doc', 'Authors' => 'doc', 'Release-1.2.0beta1' => 'doc', 'Release-1.2.0beta2' => 'doc', 'Release-1.2.0beta3' => 'doc', 'Release-1.2.0rc1' => 'doc', 'Release-1.2.0rc2' => 'doc', 'Release-1.2.0' => 'doc', 'Release-1.2.1' => 'doc', 'Release-1.2.2' => 'doc', 'pear-phpdoc' => 'script', 'pear-phpdoc.bat' => 'script'), 'ignore' => array('package.xml', "{$packagedir}/phpdoc", 'phpdoc.bat', 'LICENSE'), 'installas' => array('pear-phpdoc' => 'phpdoc', 'pear-phpdoc.bat' => 'phpdoc.bat'), 'installexceptions' => array('pear-phpdoc' => '/', 'pear-phpdoc.bat' => '/', 'scripts/makedoc.sh' => '/')));
if (PEAR::isError($e)) {
    echo $e->getMessage();
    exit;
}
Beispiel #10
0
    # -- Constitution d'un tableau de paramètres plus clair (pour mon cerveau)
    for ($i = 0; $i < count($opts[0]); $i++) {
        $opts_h[$opts[0][$i][0]] = isset($opts[0][$i][1]) ? $opts[0][$i][1] : $opts[1][$i];
    }
    # -- Contrôle des paramètres obligatoires
    foreach ($mandatory_opts as $short => $long) {
        if (!in_array($short, $opts_h) && !in_array("--{$long}", $opts_h)) {
            die("!! Paramètre obligatoire non renseigné.\n");
        }
    }
}
// Par défaut, on considère que le package se situe dans le réperoire courant
$pkg_dir = isset($opts_h['--packagedir']) ? $opts_h['--packagedir'] : $opts_h['p'];
$pkg_dir = isset($pkg_dir) ? $pkg_dir : getcwd();
echo "Looking for files in {$pkg_dir}...\n";
$pkgxml = new PEAR_PackageFileManager();
# -- Options
$e = $pkgxml->setOptions(array('baseinstalldir' => '/', 'package' => 'Blogmarks', 'version' => '0.1', 'summary' => 'Stop bookmarking, start blogmarking', 'description' => 'Soon to come...', 'license' => 'GPL', 'packagedirectory' => $pkg_dir, 'filelistgenerator' => 'cvs', 'state' => 'beta', 'notes' => 'first try', 'ignore' => array('make_pkg.php'), 'installexceptions' => array(), 'dir_roles' => array('Blogmarks/tutorials' => 'doc'), 'exceptions' => array()));
# -- Roles
$pkgxml->addRole('ini', 'php');
$pkgxml->addRole('dist', 'php');
# -- Maintainers
$pkgxml->addMaintainer('mbertier', 'lead', 'Tristan Rivoallan', '*****@*****.**');
$pkgxml->addMaintainer('benfle', 'developer', 'Benoit Fleury', '*****@*****.**');
# -- Dépendances
$pkgxml->addDependency('DB_DataObject', '1.5.3', 'ge', 'pkg');
$pkgxml->addDependency('HTTP_Request', '1.2', 'ge', 'pkg');
if (PEAR::isError($e)) {
    echo "*** Erreur: " . $e->getMessage() . "\n";
    exit;
}
Beispiel #11
0
 /**
  * Retrieve a listing of every file in $directory and
  * all subdirectories.
  *
  * The return format is an array of full paths to files
  * @access protected
  * @return array list of files in a directory
  * @param string $directory full path to the directory you want the list of
  * @throws PEAR_PACKAGEFILEMANAGER_DIR_DOESNT_EXIST
  */
 function dirList($directory)
 {
     $ret = false;
     if (@is_dir($directory)) {
         $ret = array();
         $d = @dir($directory);
         // thanks to Jason E Sweat (jsweat@users.sourceforge.net) for fix
         while ($d && false !== ($entry = $d->read())) {
             if ($this->_testFile($directory, $entry)) {
                 if (is_file($directory . '/' . $entry)) {
                     // if include option was set, then only pass included files
                     if ($this->ignore[0]) {
                         if ($this->_checkIgnore($entry, $directory . '/' . $entry, 0)) {
                             continue;
                         }
                     }
                     // if ignore option was set, then only pass included files
                     if ($this->ignore[1]) {
                         if ($this->_checkIgnore($entry, $directory . '/' . $entry, 1)) {
                             continue;
                         }
                     }
                     $ret[] = $directory . '/' . $entry;
                 }
                 if (is_dir($directory . '/' . $entry)) {
                     $tmp = $this->dirList($directory . '/' . $entry);
                     if (is_array($tmp)) {
                         foreach ($tmp as $ent) {
                             $ret[] = $ent;
                         }
                     }
                 }
             }
         }
         if ($d) {
             $d->close();
         }
     } else {
         return PEAR_PackageFileManager::raiseError(PEAR_PACKAGEFILEMANAGER_DIR_DOESNT_EXIST, $directory);
     }
     return $ret;
 }
Beispiel #12
0
<?php

/**
 * Net_growl package generator
 * @package Net_Growl
 */
require_once 'PEAR/PackageFileManager.php';
$version = '0.7.0';
$notes = <<<EOT
Initial release
EOT;
$description = <<<EOT
Growl is a MACOSX application that listen to notifications sent by 
applications and displays them on the desktop using different display 
styles. Net_Growl offers the possibility to send notifications to Growl 
from your PHP application through network communication using UDP.
EOT;
$package = new PEAR_PackageFileManager();
$e = $package->setOptions(array('package' => 'Net_Growl', 'summary' => 'Send notifications to Growl from PHP on MACOSX', 'description' => $description, 'version' => $version, 'state' => 'beta', 'license' => 'BSD', 'filelistgenerator' => 'file', 'ignore' => array('package.php', 'package.xml'), 'notes' => $notes, 'changelogoldtonew' => false, 'simpleoutput' => true, 'baseinstalldir' => 'Net', 'packagedirectory' => '/Volumes/doc/Dev/trunk/Bindings/php/Net_Growl'));
if (PEAR::isError($e)) {
    echo $e->getMessage();
    exit;
}
$package->addMaintainer('mansion', 'lead', 'Bertrand Mansion', '*****@*****.**');
$package->addDependency('PEAR', '1.3.3', 'ge', 'pkg', false);
$e = $package->writePackageFile();
if (PEAR::isError($e)) {
    echo $e->getMessage();
    exit;
}
echo "package.xml generated successfully!\n";
<?php

set_time_limit(0);
require_once 'PEAR/PackageFileManager.php';
$test = new PEAR_PackageFileManager();
$packagedir = 'C:/Web Pages/chiara/phpdoc';
$e = $test->setOptions(array('baseinstalldir' => 'PhpDocumentor', 'version' => '1.3.0RC3', 'packagedirectory' => $packagedir, 'state' => 'beta', 'filelistgenerator' => 'cvs', 'notes' => 'PHP 5 support and more, fix bugs

This will be the last release in the 1.x series.  2.0 is next

Features added to this release include:

 * Full PHP 5 support, phpDocumentor both runs in and parses Zend Engine 2
   language constructs.  Note that you must be running phpDocumentor in
   PHP 5 in order to parse PHP 5 code
 * XML:DocBook/peardoc2:default converter now beautifies the source using
   PEAR\'s XML_Beautifier if available
 * inline {@example} tag - this works just like {@source} except that
   it displays the contents of another file.  In tutorials, it works
   like <programlisting>
 * customizable README/INSTALL/CHANGELOG files
 * phpDocumentor tries to run .ini files out of the current directory
   first, to allow you to put them anywhere you want to
 * multi-national characters are now allowed in package/subpackage names
 * images in tutorials with the <graphic> tag
 * un-modified output with <programlisting role="html">
 * html/xml source highlighting with <programlisting role="tutorial">

From both Windows and Unix, both the command-line version
of phpDocumentor and the web interface will work
out of the box by using command phpdoc - guaranteed :)
Beispiel #14
0
    # -- Constitution d'un tableau de paramètres plus clair (pour mon cerveau)
    for ($i = 0; $i < count($opts[0]); $i++) {
        $opts_h[$opts[0][$i][0]] = isset($opts[0][$i][1]) ? $opts[0][$i][1] : $opts[1][$i];
    }
    # -- Contrôle des paramètres obligatoires
    foreach ($mandatory_opts as $short => $long) {
        if (!in_array($short, $opts_h) && !in_array("--{$long}", $opts_h)) {
            die("!! Paramètre obligatoire non renseigné.\n");
        }
    }
}
// Par défaut, on considère que le package se situe dans le réperoire courant
$pkg_dir = isset($opts_h['--packagedir']) ? $opts_h['--packagedir'] : $opts_h['p'];
$pkg_dir = isset($pkg_dir) ? $pkg_dir : getcwd();
echo "Looking for files in {$pkg_dir}...\n";
$pkgxml = new PEAR_PackageFileManager();
# -- Options
$e = $pkgxml->setOptions(array('baseinstalldir' => '/', 'package' => 'Blogmarks_Server_Atom', 'version' => '0.1', 'summary' => 'Blogmarks\' Atom Server', 'description' => 'Soon to come...', 'license' => 'GPL', 'packagedirectory' => $pkg_dir, 'filelistgenerator' => 'cvs', 'state' => 'beta', 'notes' => 'first try', 'ignore' => array('scripts/make_pkg.php'), 'installexceptions' => array(), 'dir_roles' => array('tutorials' => 'doc'), 'exceptions' => array()));
# -- Maintainers
$pkgxml->addMaintainer('benfle', 'lead', 'Benoit Fleury', '*****@*****.**');
$pkgxml->addMaintainer('mbertier', 'developer', 'Tristan Rivoallan', '*****@*****.**');
# -- Dépendances
$pkgxml->addDependency('Blogmarks', '0.1', 'ge', 'pkg');
if (PEAR::isError($e)) {
    echo "*** Erreur: " . $e->getMessage() . "\n";
    exit;
}
/*
$e = $pkgxml->debugPackageFile( false );

if ( PEAR::isError($e) ) {
These tools are designed for the developer. Tests are written in the PHP
language itself more or less as the application itself is built. The advantage
of using PHP itself as the testing language is that there are no new languages
to learn, testing can start straight away, and the developer can test any part
of the code. Basically, all parts that can be accessed by the application code
can also be accessed by the test code if they are in the same language. 
EOD;
/*---------------------------------------------------------------------------*/
// Modify the maintainers are required
$maintainers = array(array('handle' => 'lastcraft', 'role' => 'lead', 'name' => 'Marcus Baker', 'email' => '*****@*****.**'), array('handle' => 'jsweat', 'role' => 'helper', 'name' => 'Jason Sweat', 'email' => '*****@*****.**'), array('handle' => 'hfuecks', 'role' => 'helper', 'name' => 'Harry Fuecks', 'email' => '*****@*****.**'));
/*---------------------------------------------------------------------------*/
/**
* Code starts here
*/
require_once 'PEAR/PackageFileManager.php';
$PPFM = new PEAR_PackageFileManager();
if (version_compare(phpversion(), '4.3.0', '<') || php_sapi_name() == 'cgi') {
    define('STDOUT', fopen('php://stdout', 'w'));
    define('STDERR', fopen('php://stderr', 'w'));
    register_shutdown_function(create_function('', 'fclose(STDOUT); fclose(STDERR); return true;'));
}
/**
* A giant array to configure the PackageFileManager. For the "roles" see
* http://pear.php.net/manual/en/developers.packagedef.php
*/
$options = array('baseinstalldir' => 'simpletest', 'version' => $version, 'packagedirectory' => $packagedir, 'outputdirectory' => $packagedir, 'pathtopackagefile' => $packagedir, 'state' => $state, 'summary' => $shortDesc, 'description' => $longDesc, 'filelistgenerator' => 'file', 'notes' => $releaseNotes, 'package' => 'SimpleTest', 'license' => 'The Open Group Test Suite License', 'dir_roles' => array('docs' => 'doc', 'test' => 'test', 'extensions' => 'php'), 'exceptions' => array('HELP_MY_TESTS_DONT_WORK_ANYMORE' => 'doc', 'LICENSE' => 'doc', 'README' => 'doc', 'TODO' => 'doc', 'VERSION' => 'doc'), 'ignore' => array("{$packagedir}/packages", "{$packagedir}/ui"));
$status = $PPFM->setOptions($options);
if (PEAR::isError($status)) {
    fwrite(STDERR, $status->getMessage());
    exit;
}
    # -- Constitution d'un tableau de paramètres plus clair (pour mon cerveau)
    for ($i = 0; $i < count($opts[0]); $i++) {
        $opts_h[$opts[0][$i][0]] = isset($opts[0][$i][1]) ? $opts[0][$i][1] : $opts[1][$i];
    }
    # -- Contrôle des paramètres obligatoires
    foreach ($mandatory_opts as $short => $long) {
        if (!in_array($short, $opts_h) && !in_array("--{$long}", $opts_h)) {
            die("!! Paramètre obligatoire non renseigné.\n");
        }
    }
}
// Par défaut, on considère que le package se situe dans le réperoire courant
$pkg_dir = isset($opts_h['--packagedir']) ? $opts_h['--packagedir'] : $opts_h['p'];
$pkg_dir = isset($pkg_dir) ? $pkg_dir : getcwd();
echo "Looking for files in {$pkg_dir}...\n";
$pkgxml = new PEAR_PackageFileManager();
# -- Options
$e = $pkgxml->setOptions(array('baseinstalldir' => '/', 'package' => 'MicroBuilder', 'version' => '0.1', 'summary' => 'MicroBuilder', 'description' => 'Soon to come...', 'license' => 'GPL', 'packagedirectory' => $pkg_dir, 'filelistgenerator' => 'cvs', 'state' => 'beta', 'notes' => 'first try', 'ignore' => array('make_pkg.php'), 'installexceptions' => array(), 'dir_roles' => array(), 'exceptions' => array()));
# -- Roles
$pkgxml->addRole('ini', 'php');
$pkgxml->addRole('dist', 'php');
# -- Maintainers
$pkgxml->addMaintainer('mbertier', 'lead', 'Tristan Rivoallan', '*****@*****.**');
# -- Dépendances
$pkgxml->addDependency('DB_DataObject', '1.5.3', 'ge', 'pkg');
$pkgxml->addDependency('HTTP_Request', '1.2', 'ge', 'pkg');
if (PEAR::isError($e)) {
    echo "*** Erreur: " . $e->getMessage() . "\n";
    exit;
}
/*