Re: CLI command naming conventions?
| From: | Ken Guest | Date: | Wed, 23 Jul 2008 13:26:55 +0000 |
| Subject: | Re: CLI command naming conventions? | ||
| References: | 1 2 3 4 5 6 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-50447@lists.php.net to get a copy of this message | ||
On Wed, Jul 23, 2008 at 1:20 PM, Igor Feghali <igor.feghali@gmail.com>
wrote:
> MDB2_Schema - mdb2_schematool
>
> by the way... where is the right path to install those "binaries" ?
> currently MDB2_Schema is installing it at MDB2_Schema/bin/ under php
> lib dir. but this is something that always annoyed me because
> obviously its not a default PATH so I ask whether its ok to install
> such executable under /usr/bin or /usr/local ?
>
> how are the other packages handling that ?
If you have a look at the package.xml file for PEAR_Size you'll see I use
the following:
<file baseinstalldir="/" install-as="pearsize"
md5sum="3b211cf3c3a1ca9b2686b62322bf65db" name="scripts/pearsize.php"
role="script">
<tasks:replace from="@PHP-BIN@" to="php_bin" type="pear-config"
/>
<tasks:replace from="@PACKAGE_VERSION@" to="version"
type="package-info"
/>
<tasks:unixeol />
</file>
and in the pearsize.php script:
#!@PHP-BIN@
<?php
$lorem = new ipsum();
....
?>
after that I let the pear installer work its "magic" - from the package.xml
it knows, for pearsize.php, to convert any occurances of "@PHP-BIN@" to
whatever value it determines it should be; this is normally /usr/bin or some
such. I also have the version number in that script being updated and have
the script installed to be plain "pearsize" (note there is no ".php" in the
name of that file).
There are details about these tags here
http://pear.php.net/manual/en/guide.developers.package2.tags.php
and more
specifically
http://pear.php.net/manual/en/guide.developers.package2.tasks.php
for
details on what you can do with the "task" tags.
regards
k.