Index: branches/5.2.x/core/kernel/application.php =================================================================== diff -u -N -r14599 -r14609 --- branches/5.2.x/core/kernel/application.php (.../application.php) (revision 14599) +++ branches/5.2.x/core/kernel/application.php (.../application.php) (revision 14609) @@ -1,6 +1,6 @@ Factory = new kFactory(); $this->registerDefaultClasses(); - $this->Conn =& $this->Factory->makeClass('kDBConnection', Array (SQL_TYPE, Array (&$this, 'handleSQLError'))); - $this->Conn->debugMode = $this->isDebugMode(); - $this->Conn->Connect(SQL_SERVER, SQL_USER, SQL_PASS, SQL_DB); + $vars = kUtil::parseConfig(true); + $db_class = isset($vars['Databases']) ? 'kDBLoadBalancer' : 'kDBConnection'; + $this->Conn =& $this->Factory->makeClass($db_class, Array (SQL_TYPE, Array (&$this, 'handleSQLError'))); + $this->Conn->setup($vars); $this->cacheManager =& $this->makeClass('kCacheManager'); $this->cacheManager->InitCache(); @@ -391,7 +392,7 @@ $language =& $this->recallObject('lang.current', null, Array ('live_table' => true)); /* @var $language LanguagesItem */ - + if ( preg_match('/utf-8/', $language->GetDBField('Charset')) ) { setlocale(LC_ALL, 'en_US.UTF-8'); mb_internal_encoding('UTF-8'); @@ -729,6 +730,7 @@ // database $this->registerClass('kDBConnection', KERNEL_PATH . '/db/db_connection.php'); + $this->registerClass('kDBLoadBalancer', KERNEL_PATH . '/db/db_load_balancer.php'); $this->registerClass('kDBItem', KERNEL_PATH . '/db/dbitem.php'); $this->registerClass('kCatDBItem', KERNEL_PATH . '/db/cat_dbitem.php', null, 'kDBItem'); $this->registerClass('kDBList', KERNEL_PATH . '/db/dblist.php'); @@ -1207,7 +1209,7 @@ { $session =& $this->recallObject('Session'); /* @var $session Session */ - + $session->Destroy(); } @@ -1682,7 +1684,7 @@ { return $this->cacheManager->SetConfigValue($name, $value); } - + /** * Allows to process any type of event *