Ecco il codice di initlib.php (da 43 a 84) cosi da vedere le tre funzioni per intero.
Codice PHP:
/** Return ';' if windows otherwise ':'
* \static
*/
function pathSeparator() {
static $separator;
if (!isset($separator)) {
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
$separator = ';';
} else {
$separator = ':';
}
}
return $separator;
}
/** Prepend $path to the include path
* \static
*/
function prependIncludePath($path) {
$include_path = ini_get('include_path');
if ($include_path) {
$include_path = $path . TikiInit::pathSeparator(). $include_path;
} else {
$include_path = $path;
}
return ini_set('include_path', $include_path);
}
/** Append $path to the include path
* \static
*/
function appendIncludePath($path) {
$include_path = ini_get('include_path');
if ($include_path) {
$include_path .= TikiInit::pathSeparator(). $path;
} else {
$include_path = $path;
}
return ini_set('include_path', $include_path);
}
Questo invece è il codice di tiki-install.php dalla 534
Codice PHP:
// Second check try to connect to the database
// if no local.php => no con
// if local then build dsn and try to connect
// then get con or nocon
//adodb settings
TikiInit::prependIncludePath('lib/adodb');
TikiInit::prependIncludePath('lib/pear');
define('ADODB_FORCE_NULLS', 1);
define('ADODB_ASSOC_CASE', 2);
define('ADODB_CASE_ASSOC', 2); // typo in adodb's driver for sybase?
include_once ('adodb.inc.php');
//include_once ('adodb-pear.inc.php'); //really needed?
// next block checks if there is a local.php and if we can connect through this.
// sets $dbcon to false if there is no valid local.php
if (!file_exists($local)) {
$dbcon = false;
$smarty->assign('dbcon', 'n');
} else {
// include the file to get the variables
include ($local);
if (!isset($db_tiki)) {
//upgrade from 1.7.X
$db_tiki="mysql";
write_local_php($db_tiki,$host_tiki,$user_tiki,$pass_tiki,$dbs_tiki);
}
if ($db_tiki == 'sybase') {
// avoid database change messages
ini_set('sybct.min_server_severity', '11');
}
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
// avoid errors in ADONewConnection() (wrong darabase driver etc...)
if(array_search($db_tiki,$dbtodsn)==FALSE) {
$dbcon = false;
$smarty->assign('dbcon', 'n');
} else {
$dbTiki = &ADONewConnection($db_tiki);
if (!$dbTiki->Connect($host_tiki, $user_tiki, $pass_tiki, $dbs_tiki)) {
$dbcon = false;
$smarty->assign('dbcon', 'n');
$tikifeedback[] = array('num'=>1,'mes'=>$dbTiki->ErrorMsg());
} else {
$dbcon = true;
if (!isset($_REQUEST['reset'])) {
$smarty->assign('dbcon', 'y');
$smarty->assign('resetdb', 'n');
} else {
$smarty->assign('dbcon', 'y');
$smarty->assign('resetdb', 'y');
}
}
}
}
Spero di essere stato di aiuto.
Sorry per i post consecutivi, ma sono disperato...