RE: [PHP] location of the PHP executable



IF db not exists THEN
locate -u
END-IF

I'd hate to see the time it'd take to create a first-time database...
this could take awhile to run.

-----Original Message-----
From: Davi [mailto:davividal@xxxxxxxxxxxxxxxx]
Sent: Wednesday, April 11, 2007 6:10 PM
To: php-general@xxxxxxxxxxxxx
Subject: Re: [PHP] location of the PHP executable

Em Quarta 11 Abril 2007 18:50, Jarrel Cobb escreveu:
Don't you have to run locate -u first to generate the database before
using
locate? You can't just assume a database exists already can you?


If you can use locate, you can use which... =P

BTW, do something to check OS then:

IF OS == *nix THEN
IF exists /usr/bin/which THEN
which php
ELSE
IF exists /usr/bin/locate THEN
locate php | grep -iE "php$"
ELSE
IF exists /usr/bin/find THEN
find / -name php | grep -iE "php$"
ELSE
cd / && ls php -Rv
END-IF
END-IF
END-IF
ELSE
cd \
dir php*.exe /s
END-IF


Check if I don't miss any END-IF... =P

[]s

--
Davi Vidal
davividal@xxxxxxxxxxxxxxxx
davividal@xxxxxxxxx
--

Agora com fortune:
"rugged, adj.:
Too heavy to lift."

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
.



Relevant Pages

  • Re: Why php and not C?
    ... But I dont get why Taht robert guys hate so ... you all hate so mush ASP.NET, I myself use almost only PHP for websites and intranet but only because It's faster to develop. ... > for server side scripting, and runs on lots of platforms. ...
    (comp.lang.php)
  • Re: [PHP] PHP URL issues
    ... You might have a whitespace in any of those variables and the URL stops at ... Subject: [PHP] PHP URL issues ... in 45,000 destinations on Yahoo! ... Get more on shows you hate to love ...
    (php.general)
  • Re: BUG IN PHP? (class member undefined)
    ... I hate this crap called php language... ... language if you don't get the syntax right. ... I find it quite logical - more so than at least half of the 15-20 languages I've used over the years. ... As Tony said - if you hate it so much, ...
    (comp.lang.php)
  • Re: multiple emails via PHP
    ... > email them all at once to let them know my website has been updated. ... > hate using things like Yahoo-Groups and want to start doing this on my ... written in PHP for PHP;) which does all the ugly stuff for you like ...
    (alt.php)
  • Re: avoid post resubmit on refresh
    ... > header() to go back to the form. ... I HATE this manner. ... about 80 php pages on my site). ...
    (comp.lang.php)