Re: check for installed package
| From: | Ian Eure | Date: | Wed, 14 Jul 2004 09:24:47 +0000 |
| Subject: | Re: check for installed package | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-32015@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wednesday 14 July 2004 01:43 am, Stephan Wentz wrote:
> Tobias Schlitt wrote:
> > Hi Stephan Wentz! You wrote:
> >>hi all!
> >>
> >>
> >>what's the fastest/best way of determining wether a pear package is
> >>installed or not? i want to check wether a given package is installed
> >>for optional stuff in my app.
> >
> > "pear list|grep <package_name>" ;)
>
> ehehe
> This doesn't cover manual installs, maybe a "locate <package_name>.php"
> will do? :-P
>
> No, I really need a valid answer for this one ;-)
>
@include_once 'Package/File.php';
if (! class_exists('Package_File')) {
die("We need PEAR::Package_File!");
}
Only way to do it if you want to handle manual installs, afaik. I don't think
that's necessarily correct, though. I'd suggest using the PEAR registry, and
ignoring stuff which hasn't been installed with it.
It is quicker, though.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFA9PvfxuUdPD6j2IMRAqPOAJ4gGo/ScAqHeASpXBRM/CPpxGy7ZwCePWGX
QEUPxW3HroVw0eT+NBtyqlw=
=NmFM
-----END PGP SIGNATURE-----