By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,723 Members | 1,876 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,723 IT Pros & Developers. It's quick & easy.

How heck pear package?

P: n/a
Hi, how check install or not pear package? (in *.php, not in cli)
Aug 24 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Aug 23, 8:28 pm, %antazy%-gmÁil-%com% <ant...@gmail.comwrote:
Hi, how check install or not pear package? (in *.php, not in cli)
From the PHP online manual for "include":

if ((include 'vars.php') == 'OK') {
echo 'OK';
}

So, obviously, something like:

if ((include 'PEAR/Config.php') == 'OK') {
echo 'OK';
}
Aug 25 '08 #2

P: n/a
Hi,

fred wrote:
On Aug 23, 8:28 pm, %antazy%-gmĐ°il-%com% <ant...@gmail.comwrote:
Hi, how check install or not pear package? (in *.php, not in cli)

From the PHP online manual for "include":

if ((include 'vars.php') == 'OK') {
echo 'OK';
}
Will only execute the conditional part if »vars.php« has and executes a
»return "OK";«. This is made quite clear in the text above the example
you've cited here. And the example following the one you've cited
points it out better. Nevertheless, the OP should read that manual
section.
So, obviously, something like:

if ((include 'PEAR/Config.php') == 'OK') {
echo 'OK';
}
Wrong (as long as there's no such »return 'OK';« in PEAR/Config.php).
But of course you could just catch the error when the include fails.

-hwh
Aug 26 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.