|
Posted by Tom Rogers on 03/05/05 06:25
Hi,
TR> This will set the include path just before the document root:
TR> if(isset($_SERVER["SCRIPT_FILENAME"])){
TR> $root = $_SERVER['SCRIPT_FILENAME'];
TR> //echo "Root: $root<br>";
TR> $script = $_SERVER['SCRIPT_NAME'];
TR> $document_root = str_replace($script,'',$root);
TR> //echo "Document root: $document_root<br>";
TR> $base = basename($document_root);
TR> //echo "Base: $base<br>";
TR> $include = str_replace($base,'include',$document_root);
TR> //echo "Include: $include<br>";
TR> $os = strtolower(PHP_OS);
TR> //echo "OS: $os<br>";
TR> $lk = ':';
TR> $org_include = ini_get("include_path");
TR> if(preg_match('/^win/i',$os)) $lk = ';';
TR> ini_set("include_path",$include.$lk.$org_include);
TR> //echo "Include: ".ini_get("include_path")."<br>";
TR> }
TR> --
TR> regards,
TR> Tom
Forgot to tell you to put it in the auto_prepend file and it will work
for all files :)
--
regards,
Tom
Navigation:
[Reply to this message]
|