ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> pear-dev
pear-dev
[PEAR-DEV] Pear channels, uri, package_filemanager, etc. I cannot make my package
by Coda other posts by this author
Nov 26 2006 5:22AM messages near this date
Re: [PEAR-DEV] PEAR_PackageFileManager User Guide and Tutorial | [PEAR-DEV] Re: Pear channels, uri, package_filemanager, etc. I cannot make my package
Hi,

I'd like to use package_filemanager to generate a package.xml file  
with version 2 format.
Whatever I try, I always get a result like this one :

PEAR_PackageFileManager2 Error: Package validation failed:
Error: Invalid tag order in <package> , found <summary> expected one  
of "channel, uri"
Error: package.xml <package>  tag has no version attribute, or version  
is not 2.0

or other variants.

I don't have a channel setup for my packages yet and I don't know  
what to put in uri since it is not documented apparently.

Here is the code I use to generate my package, it's taken directly  
package_filemanager2 comments:

<code> 

require_once('PEAR/PackageFileManager2.php');
PEAR::setErrorHandling(PEAR_ERROR_DIE);

$packagexml = new PEAR_PackageFileManager2;

$e = $packagexml-> setOptions(
array('baseinstalldir' =>  'Mamasam',
'packagedirectory' =>  dirname(__FILE__).'/..',
'filelistgenerator' =>  'file', // generate from cvs, use file for  
directory
'ignore' =>  array('.svn/', 'tests/'), // ignore TODO, all files in  
tests/
'dir_roles' =>  array('tests' => 'test'),
)); // same for the license
$packagexml-> setPackage('Mamasam_ACL');
$packagexml-> setSummary('Rights and permissions management package');
$packagexml-> setDescription('Rights and permissions management  
package.');
$packagexml-> setAPIVersion('1.0.0');
$packagexml-> setReleaseVersion('0.9.0');
$packagexml-> setReleaseStability('beta');
$packagexml-> setAPIStability('stable');
$packagexml-> setNotes("Initial release");
$packagexml-> setPackageType('php'); // this is a PEAR-style php  
script package

$packagexml-> setPhpDep('5.1.0');
$packagexml-> setPearinstallerDep('1.4.3');
$packagexml-> addMaintainer('lead', 'mansion', 'Bertrand Mansion',  
'golgote@mamasam.com');
$packagexml-> setLicense('New BSD License', 'http://opensource.org/ 
licenses/bsd-license.php');
$packagexml-> generateContents(); // create the <contents> tag
// replace @PHP-BIN@ in this file with the path to php executable!   
pretty neat
$packagexml-> addGlobalReplacement('package-info',  
'@package_version@', 'version');
$pkg = &$packagexml-> exportCompatiblePackageFile1(); // get a  
PEAR_PackageFile object
// note use of {@link debugPackageFile()} - this is VERY important
if (isset($_GET['make']) || (isset($_SERVER['argv']) && @$_SERVER 
['argv'][1] == 'make')) {
     $pkg-> writePackageFile();
     $packagexml-> writePackageFile();
} else {
     $pkg-> debugPackageFile();
     $packagexml-> debugPackageFile();
}

</code> 

Can somebody help me ? Should I write the package2.xml file by hand ?
Or is there a tutorial somewhere on how to do this and maybe also how  
to setup a server with channels.

TIA,

--
Bertrand Mansion
Mamasam
Work : http://www.mamasam.com
Blog : http://golgote.freeflux.net

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thread:
Coda
Laurent Laville
Brett Bieber

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved