Location: PHPKode > projects > Content*Builder > cb_pear/CB_PEAR.php
<?php

/**
 * PEAR workaround to enhance C*B in a non PEAR environment
 *
 * @version $Id: CB_PEAR.php,v 1.5 2004/09/29 17:29:28 cb_fog Exp $
 * @copyright 2003 C*B Dev Group / PEAR package authors
 **/
 
/*
* Statt der langen unteren version funktionierte bei einem Test auch folgende kurze.
* Das Problem bei dem Open Base Dir Fehler ist, dass der Server trotz eines weiteren Suchpfades 
* nur den ersten nach den geforderten PEAR Dateien durchsucht.
* Da wir in C*B genau wissen, dass alle nötigen PEAR DAteien hier zu finden sind,
* kann unser Pfad auch einfach als erster dastehen.
*/
if (substr(PHP_OS, 0, 3) == 'WIN') {
    define("PATH_SEPARATOR",";");
} else {
	define("PATH_SEPARATOR",":");
}
ini_set("include_path", dirname(__FILE__)."/". PATH_SEPARATOR . "." . PATH_SEPARATOR .ini_get("include_path"));

/* 
if (substr(PHP_OS, 0, 3) == 'WIN') {
    //ini_set("include_path", ini_get("include_path").";".dirname(__FILE__)."/");
    define("PATH_SEPARATOR",";");
} else {
    define("PATH_SEPARATOR",":");
}
ini_set("include_path", ini_get("include_path"). PATH_SEPARATOR .dirname(__FILE__)."/");

// open_basedir workaround for erreanous PHP include_path settings
// purpose: remove all paths not allowed
// 
// Please uncomment the following 15 lines ( from '/*' ... to '* /' )
// if you get strange "out of path" errors like
/// open_basedir restriction in effect. 
/// File(/usr/lib/php/templates/default/compiled//%%183/%%1834364914/contentbuilder.template.php) 
/// is not within the allowed path(s): (/home/www/htdocs/weddahex.de/.) 
/// in /home/www/htdocs/weddahex.de/hp/libraries/smarty/Smarty.class.php on line 1279
// 
// 
if (ini_get("open_basedir")) {
	$basedir=ini_get("open_basedir");
//}else {
//	$basedir = $_SERVER['DOCUMENT_ROOT'];
//}
	$_flag=false;
	$_arr = explode(PATH_SEPARATOR , ini_get("include_path"));
	
	for ($i = 0; $i < count($_arr); $i++ ) {
		if (PATH_SEPARATOR == ";") { $_strtmp= str_replace("\\","/", $_arr[$i]); } else { $_strtmp = $_arr[$i]; }
		if (( substr($_strtmp,0,1) != '.' ) && (strpos($_strtmp, $basedir) !== 0 )) {
			unset ( $_arr[$i] );
			$_flag = true;
		}
	}
	if ($_flag) {
		ini_set( "include_path" ,implode(PATH_SEPARATOR,$_arr) );	}
} 
*/
// end open_basedir workaround

?>
Return current item: Content*Builder