For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > March 2007 > PackageManager input options for a directory structure









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PackageManager input options for a directory structure
Edward Z. Yang

2007-03-02, 7:02 pm

Hi, I am a developer who would like to use the PEAR infrastructure to
distribute my packages. Because my codebase is large, I am using PEAR
PackageManager to dynamically generate the package.xml file for me.
However, I've run into some snags.

My directory structure is as follows:
htmlpurifier/
library/
HTMLPurifier/
(lots of class files)
HTMLPurifier.php
tests/
docs /

Normally speaking, "htmlpurifier/library" would be added to the class
path for someone to use my library. So, the contents of that folder
should be added to PEAR's root directory for PHP code. Desired XML
output looks like:

<dir baseinstalldir="/" name="/">
<file name="HTMLPurifier.php" role="php" />
<dir name="HTMLPurifier">
<!-- class files here -->
</dir>
</dir>

However, if I register /htmlpurifier as the 'packagedirectory' option
for PackageManager, all the class files will get cordoned off into
another library/ folder, which is completely unacceptable.

I have attempted to solve the problem by setting /htmlpurifier/library
as the packagedirectory, but this prevents me from including the other
directories: tests/ and docs/, in the PEAR distribution. I have tried:

'include' => array('*', '../tests/*', '../docs/*')

But to no avail. Can anyone help me out? Any help would be greatly
appreciated, even if it's a firm declaration that what I'm looking for
is impossible and I should just change my directory structure.
Edward Z. Yang

2007-03-05, 7:04 pm

Edward Z. Yang wrote:
> Hi, I am a developer who would like to use the PEAR infrastructure to
> distribute my packages. Because my codebase is large, I am using PEAR
> PackageManager to dynamically generate the package.xml file for me.
> However, I've run into some snags. [snip]


Anyone?
Gregory Beaver

2007-03-05, 7:04 pm

Edward Z. Yang wrote:
> Hi, I am a developer who would like to use the PEAR infrastructure to
> distribute my packages. Because my codebase is large, I am using PEAR
> PackageManager to dynamically generate the package.xml file for me.
> However, I've run into some snags.
>
> My directory structure is as follows:
> htmlpurifier/
> library/
> HTMLPurifier/
> (lots of class files)
> HTMLPurifier.php
> tests/
> docs /
>
> Normally speaking, "htmlpurifier/library" would be added to the class
> path for someone to use my library. So, the contents of that folder
> should be added to PEAR's root directory for PHP code. Desired XML
> output looks like:
>
> <dir baseinstalldir="/" name="/">
> <file name="HTMLPurifier.php" role="php" />
> <dir name="HTMLPurifier">
> <!-- class files here -->
> </dir>
> </dir>
>
> However, if I register /htmlpurifier as the 'packagedirectory' option
> for PackageManager, all the class files will get cordoned off into
> another library/ folder, which is completely unacceptable.
>
> I have attempted to solve the problem by setting /htmlpurifier/library
> as the packagedirectory, but this prevents me from including the other
> directories: tests/ and docs/, in the PEAR distribution. I have tried:
>
> 'include' => array('*', '../tests/*', '../docs/*')
>
> But to no avail. Can anyone help me out? Any help would be greatly
> appreciated, even if it's a firm declaration that what I'm looking for
> is impossible and I should just change my directory structure.


Hi Edward,

What you are looking for is the 'installexceptions' value.

'installexceptions' => array('library/HTMLPurifier/*' => 'HTMLPurifier/')

http://pear.php.net/manual/en/packa....setoptions.php

is the full documentation for options.

Greg
Edward Z. Yang

2007-03-07, 4:00 am

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gregory Beaver wrote:
> What you are looking for is the 'installexceptions' value.
>
> 'installexceptions' => array('library/HTMLPurifier/*' => 'HTMLPurifier/')
>
> http://pear.php.net/manual/en/packa....setoptions.php
>
> is the full documentation for options.


Thank you for the pointer. I will try it out.

What I think would be really helpful is if there were more example
use-cases of the class in the documentation. Just a thought...

- --
Edward Z. Yang Personal: edwardzyang@thewritingpot.com
SN:Ambush Commander Website: http://www.thewritingpot.com/
GPGKey:0x869C48DA http://www.thewritingpot.com/gpgpubkey.asc
3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF7km2qTO+fYacSNoRAnPkAJ9XEMLS/9vMMRdnE96kU/P1HdwCUACeNiwp
xxf+W9I7GCuZyjbVJu6d5sw=
=OX3u
-----END PGP SIGNATURE-----
Gregory Beaver

2007-03-07, 4:00 am

Edward Z. Yang wrote:
> Gregory Beaver wrote:
> 'HTMLPurifier/')
> http://pear.php.net/manual/en/packa....setoptions.php
>
> Thank you for the pointer. I will try it out.
>
> What I think would be really helpful is if there were more example
> use-cases of the class in the documentation. Just a thought...


Hi Edward,

I agree. The docs are sorely out of date compared to the package
itself, and my only excuse is I've been focusing my attentions elsewhere
for a while. Feel free to open a bug with a patch containing
documentation (in any format), which I could convert to docbook. Use
cases from new "recruits" are also always appreciated, to see how users
are interpreting the docs as well. This helps me to understand my own
assumptions and prevent them from obscuring the docs too much :).

Thanks,
Greg
Edward Z. Yang

2007-03-13, 4:03 am

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gregory Beaver wrote:
> I agree. The docs are sorely out of date compared to the package
> itself, and my only excuse is I've been focusing my attentions elsewhere
> for a while. Feel free to open a bug with a patch containing
> documentation (in any format), which I could convert to docbook. Use
> cases from new "recruits" are also always appreciated, to see how users
> are interpreting the docs as well. This helps me to understand my own
> assumptions and prevent them from obscuring the docs too much :).


I'll try to toss in some effort into this project in the form of
documentation patches once my schedule clears up a little. Being able to
package libraries for PEAR is a must for people who want to harness the
immense power of PEAR Server and the PEAR installer. :-)

- --
Edward Z. Yang Personal: edwardzyang@thewritingpot.com
SN:Ambush Commander Website: http://www.thewritingpot.com/
GPGKey:0x869C48DA http://www.thewritingpot.com/gpgpubkey.asc
3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF9g60qTO+fYacSNoRAnD3AKCDxwSN0kBa
eEj5BDoEVafxcVQzRgCghoKX
gT/Rd6ZhnUGpDPu6bN/f8Fo=
=FFoA
-----END PGP SIGNATURE-----
Edward Z. Yang

2007-03-24, 7:00 pm

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gregory Beaver wrote:
> What you are looking for is the 'installexceptions' value.
>
> 'installexceptions' => array('library/HTMLPurifier/*' => 'HTMLPurifier/')
>
> http://pear.php.net/manual/en/packa....setoptions.php
>
> is the full documentation for options.


Hi Greg, I finally got around to trying your approach out, and it
doesn't seem to have any effect. According to the documentation,
installexceptions is only supported for files, not directories or
wildcards. :-(

- --
Edward Z. Yang Personal: edwardzyang@thewritingpot.com
SN:Ambush Commander Website: http://www.thewritingpot.com/
GPGKey:0x869C48DA http://www.thewritingpot.com/gpgpubkey.asc
3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGBYw6qTO+fYacSNoRAsH3AJsFEn4zf40b
svdfhd6xpu6iRNcRAACdE9RD
oq8oAC3dPTTcxBTg/Kf/vZU=
=TbsB
-----END PGP SIGNATURE-----
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com