PackageFileManager example broken in php5 ?
| From: | Dan Rossi | Date: | Thu, 26 Jan 2006 11:55:39 +0000 |
| Subject: | PackageFileManager example broken in php5 ? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-22687@lists.php.net to get a copy of this message | ||
Hi im looking at the packagefilemanager example, however off the shelf it wouldnt run, here is my error
PEAR_PackageFileManager Error: Run $managerclass->setOptions() before any other methods , any ideas ?
<?php
/**
* A simple example
* @package PEAR_PackageFileManager
*/
/**
* Include the package file manager
*/
require_once('PEAR/PackageFileManager.php');
$test = new PEAR_PackageFileManager;
/*
if (PEAR::isError($test)) {
echo $test->getMessage();
exit;
}
*/
$test->setOptions(
array('baseinstalldir' => 'PEAR',
'version' => '0.1',
'packagedirectory' => '/www/dev/package',
'state' => 'alpha',
'filelistgenerator' => 'file',
'notes' => 'First release of package ',
'ignore' => array('package.xml')));
$test->addDependency('PEAR', '1.1');
$e = $test->writePackageFile();
if (PEAR::isError($e)) {
echo $e->getMessage();} ?>