Re: question about @PHP-BIN@, file placement in packages, more

From: Date: Tue, 05 Jul 2005 14:55:54 +0000
Subject: Re: question about @PHP-BIN@, file placement in packages, more
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-38449@lists.php.net to get a copy of this message
On 7/5/05, bertrand Gugger <bertrand@toggg.com> wrote: > Hello Matthew > Matthew Weier O'Phinney wrote: > > > I'm preparing to do a call for votes on File_Fortune, > > > > http://pear.php.net/pepr/pepr-proposal-show.php?id=263 > > > > but I want to get a few items straightened out before doing so. > > > > (1) I have an example in my package, and it's supposed to be an executable. > > I have the shebang line as: > > > > #!@PHP-BIN@ > > > > However, when I install the package with the PEAR installer (I'm on the > > latest alpha of the 1.4 series), I find that this line is not re-written > > with the path to my PHP executable. Should it be? Do I have the syntax > > wrong? > > > > > you need to associate a task with the <file> , something like: > <tasks:replace from="@bin_dir@" to="bin_dir" > type="pear-config" /> > or > <replace from="@bin_dir@" to="bin_dir" type="pear-config" > /> > see > > http://pear.php.net/manual/en/guide.developers.package2.tasks.php#guide.developers.package2.tasks.windowseol Okay, thanks! As noted by Andrey, I actually needed to use to="php_bin" in order to get the path to the PHP executable, but the link you provided helped me understand why. Is there a way to do this with PEAR_PackageFileManager? Or will I need to hand-hack the package.xml file to do so? > > (2) Speaking of examples... I have a number of subdirectories that are used > > for non-PHP files -- things like docs, examples, and tests. Currently, > > my directory hierarchy looks like: <snip> > > My question is: what is the proper hierarchy for these subdirectories? > > Should they be under File/ or under File/Fortune/ ? > > > if role is doc or data that will go under pear_dir/doc/File_Fortune/ or > pear_dir/data/File_Fortune/ with your subdirectories Yes, I set the file/directory roles in my pacakge.xml -- so it sounds like the actual physical layout in the package isn't as important as the package definition file. That makes it easier! > > (3) In my phpt test files, when I require() or include() one of the class > > files, should I use dirname(__FILE__) to grab them, or simply > > 'File/Fortune.php', etc.? > > > Simply File/Fortune.php as any script: that must be executable from anywhere Okay, I'll make that change before doing the call for votes. > Bon courage ! Merci! -- Matthew Weier O'Phinney mweierophinney@gmail.com http://weierophinney.net/matthew/

« previous php.pear.dev (#38449) next »