PEAR PackageManager file hierarchy

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

PEAR PackageManager file hierarchy

Post by Ambush Commander »

I have a non-PEAR directory layout for my library:

Code: Select all

/htmlpurifier
    /library
        /HTMLPurifier
    /tests
    /docs
whereas the standard layout would be:

Code: Select all

/htmlpurifier
    /HTMLPurifier
    /tests
    /docs
Thus, I am at a loss as to how to use PEAR Package Manager to include all these directories. Normally speaking, you would use something like:

Code: Select all

$pkg->setOptions(
    array(
        'baseinstalldir' => '/',
        'packagedirectory' => dirname(__FILE__),
        'filelistgenerator' => 'file',
        'include' => array('*'),
        'roles' => array('*' => 'php'),
        'exceptions' => array('tests/*' => 'test', 'docs/*' => 'docs')
    )
);
But if I attempt to do something similar, I end up with:

Code: Select all

$pkg->setOptions(
    array(
        'baseinstalldir' => '/',
        'packagedirectory' => dirname(__FILE__),
        'filelistgenerator' => 'file',
        'roles' => array('*' => 'php'),
        'exceptions' => array('tests/*' => 'test', 'docs/*' => 'docs')
    )
);
Except that now all the class files get cordoned into a library/ directory, which is not what I want!

Furthermore, using the 'include' syntax as such:

Code: Select all

'include' => array('library', 'tests', 'docs')
doesn't seem to work: it always complains that the files can't be found. Hmph. Anyone have a clue?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

I think you have already solved this (you double poster ;)). I believe there is a way to do this in the package XML by specifying a path for each file, or something like that. You might want to check Greg Beaver's blog to see if there is anything there -- or email him.

http://search.yahoo.com/search?p=Greg+B ... s&ei=UTF-8
(#10850)
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

I think you have already solved this (you double poster ;-)).
Heh, I wish. The first topic I was my frustration over an SVN plugin that just flat-out didn't work. Ditched the plugin, and things started working... sortof.
I believe there is a way to do this in the package XML by specifying a path for each file, or something like that.
Yes, if I was writing the XML file by hand this wouldn't be a problem. I'm trying to use an automation tool, however, and it won't give me the results I want. I guess I could fire up DOM and perform the necessary fixes myself, but I'd rather not.
You might want to check Greg Beaver's blog to see if there is anything there -- or email him.
That's a good idea.
Post Reply