I got to thinking about the code that figures out APPLICATION_ROOT, et al.
I think I
have a slightly better four lines:
define("SERVER_NAME", $SERVER_NAME);
define("SCRIPT_NAME", basename(__FILE__));
define("APPLICATION_ROOT", ereg_replace("([^/\\]*)$", "",
dirname(__FILE__)));
define("EXTERNAL_PATH", dirname($SCRIPT_NAME) . "/");
I wish I could get rid of the ereg_replace, but I can't think of one that
will
fit on one line. So, given either "C:\inetpub\wwwroot" or "/www/htdocs" we
need to chop off the last path. Can't use strrpos() because you don't know
if you're
looking for / or \.
I did think of using a function like this:
/*
** Function: parent
** Input: STRING path
** Output: STRING
** Description: given a path, returns the parent path
*/
function parent($path)
{
$i = strlen($path) - 1;
while(($i >= 0) AND ($path[$i] != "/") AND ($path[$i] != "/"))
{
$i--;
}
if($i > 0)
{
return(substr($path, 0, $i));
}
else
{
return("/");
}
}
But all the clutter isn't worth it.
Anyway, I'll be committing this to CVS in a few seconds...
Leon
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Site: http://www.working-dogs.com/freetrade/
Problems?: [EMAIL PROTECTED]
- Re: [FreeTrade] NT installation Shannon -jj Behrens
- RE: [FreeTrade] NT installat... Chris Mason
- Re: [FreeTrade] NT installat... Shannon -jj Behrens
- [FreeTrade] NT installation ... Max Khaikin
- RE: [FreeTrade] NT installat... Leon Atkinson
- RE: [FreeTrade] NT installat... Max Khaikin
- RE: [FreeTrade] NT installat... Leon Atkinson
- Re: [FreeTrade] NT installat... Shannon -jj Behrens
- RE: [FreeTrade] NT installation Chris Mason
- RE: [FreeTrade] NT installation Leon Atkinson
- RE: [FreeTrade] NT installat... Leon Atkinson
- RE: [FreeTrade] NT installat... Chris Mason
- RE: [FreeTrade] NT installat... Chris Mason
- Re: [FreeTrade] NT installat... Shannon -jj Behrens
- RE: [FreeTrade] Newbie onlist Leon Atkinson
- RE: [FreeTrade] Newbie onlist Jon Griffin
- RE: [FreeTrade] Newbie onlist Stefan Werny
- RE: [FreeTrade] Newbie onlist Leon Atkinson
- Re: [FreeTrade] Newbie onlist Dan McCullough
- Re: [FreeTrade] Newbie onlist Jon Griffin
- Re: [FreeTrade] Newbie onlist Dan McCullough

