Properly defined globals, $_PEAR caused install to fail. (thanks DRiKE)

This commit is contained in:
Mikael Nordfeldth 2013-10-04 20:49:07 +02:00
parent fb4e9b234d
commit 636a8fcaf5
2 changed files with 13 additions and 11 deletions

View File

@ -73,10 +73,17 @@ if (!function_exists('dl')) {
// global configuration object
require_once('PEAR.php');
require_once('PEAR/Exception.php');
require_once('DB/DataObject.php');
require_once('DB/DataObject/Cast.php'); # for dates
require_once 'PEAR.php';
require_once 'PEAR/Exception.php';
global $_PEAR;
$_PEAR = new PEAR;
$_PEAR->setErrorHandling(PEAR_ERROR_CALLBACK, 'PEAR_ErrorToPEAR_Exception');
require_once 'DB.php';
require_once 'DB/DataObject.php';
require_once 'DB/DataObject/Cast.php'; # for dates
global $_DB;
$_DB = new DB;
require_once(INSTALLDIR.'/lib/language.php');
@ -173,6 +180,3 @@ function PEAR_ErrorToPEAR_Exception($err)
}
throw new PEAR_Exception($err->getMessage());
}
/* global */ $_PEAR = new PEAR;
$_PEAR->setErrorHandling(PEAR_ERROR_CALLBACK, 'PEAR_ErrorToPEAR_Exception');

View File

@ -340,10 +340,8 @@ abstract class Installer
*/
function connectDatabase($dsn)
{
// @fixme move this someplace more sensible
//set_include_path(INSTALLDIR . '/extlib' . PATH_SEPARATOR . get_include_path());
require_once 'DB.php';
return DB::connect($dsn);
global $_DB;
return $_DB->connect($dsn);
}
/**