From d4b19712c271c3bf9d16909768c4bd84d617afd5 Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Mon, 20 Jun 2011 14:26:39 +0000 Subject: killed the experimental activecontrols implementation backported from yii --- .../MasterSlave/TMasterSlaveDataSourceConfig.php | 154 --------------------- 1 file changed, 154 deletions(-) delete mode 100644 framework/Testing/Data/Distributed/MasterSlave/TMasterSlaveDataSourceConfig.php (limited to 'framework/Testing/Data/Distributed/MasterSlave/TMasterSlaveDataSourceConfig.php') diff --git a/framework/Testing/Data/Distributed/MasterSlave/TMasterSlaveDataSourceConfig.php b/framework/Testing/Data/Distributed/MasterSlave/TMasterSlaveDataSourceConfig.php deleted file mode 100644 index ee486fe8..00000000 --- a/framework/Testing/Data/Distributed/MasterSlave/TMasterSlaveDataSourceConfig.php +++ /dev/null @@ -1,154 +0,0 @@ - - * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2010 PradoSoft - * @license http://www.pradosoft.com/license/ - * @version $Id$ - * @package System.Testing.Data.Distributed.MasterSlave - */ - - Prado::using('System.Testing.Data.Distributed.TDistributedDataSourceConfig'); - Prado::using('System.Testing.Data.Distributed.MasterSlave.TMasterSlaveDbConnection'); - - /** - * TMasterSlaveDataSourceConfig module class provides configuration for database connections in master/slave senario. - * - * IMPORTANT!!! - * BETA Version - Use with care and NOT in production environment (only tested with MySql) - * - * Example usage: mysql connection - * - * - * - * - * - * - * - * - * - * - * - * @author Yves Berkholz - * @version $Id$ - * @package System.Testing.Data.Distributed.MasterSlave - * @since 4.0 - */ - class TMasterSlaveDataSourceConfig extends TDistributedDataSourceConfig - { - /** - * @var boolean - */ - private $_bMasterInitialized = false; - - /** - * @var boolean - */ - private $_bSlaveInitialized = false; - - /** - * Constructor - */ - public function __construct() - { - $this->setConnectionClass('System.Testing.Data.Distributed.MasterSlave.TMasterSlaveDbConnection'); - $this->setDistributedConnectionClass('System.Testing.Data.Distributed.MasterSlave.TSlaveDbConnection'); - } - - /** - * Initalize the database connection properties from attributes in slave tag. - * @param TXmlDocument xml configuration. - */ - protected function initChildConnectionData($xml) - { - parent::initChildConnectionData($xml, 'slave'); - } - - /** - * @return IMasterSlaveDbConnection - */ - public function getDbConnection() { - $id = $this->getID(); - static $result = array(); - - if(!isset($result[$id])) - $result[$id] = parent::getDbConnection(); - - if(!$this->bInitialized) - return $result[$id]; - - if($this->_bMasterInitialized) - return $result[$id]; - - $this->_bMasterInitialized = true; - - if(!$result[$id] instanceof IMasterSlaveDbConnection) - return $result[$id]; - - $slave = parent::getDistributedDbConnection(); - - if($slave instanceof ISlaveDbConnection && $slave->getMasterConnection()===null) - $slave->setMasterConnection($result[$id]); - - if($result[$id]->getSlaveConnection()===null) - $result[$id]->setSlaveConnection($slave); - - return $result[$id]; - } - - /** - * @return ISlaveDbConnection - */ - public function getDistributedDbConnection() { - $id = $this->getID(); - static $result = array(); - - if(!isset($result[$id])) - $result[$id] = parent::getDistributedDbConnection(); - - if(!$this->bInitialized) - return $result[$id]; - - if($this->_bSlaveInitialized) - return $result[$id]; - - $this->_bSlaveInitialized = true; - - if(!$result[$id] instanceof ISlaveDbConnection) - return $result[$id]; - - $master = parent::getDbConnection(); - - if($master instanceof IMasterSlaveDbConnection && ($master->getSlaveConnection()===null)) - $master->setSlaveConnection($result[$id]); - - if($result[$id]->getMasterConnection()===null) - $result[$id]->setMasterConnection($master); - - return $result[$id]; - } - - /** - * Alias for getDbConnection(). - * @return IMasterSlaveDbConnection database connection. - */ - public function getMasterDbConnection() - { - return $this->getDbConnection(); - } - - /** - * Alias for getDistributedDbConnection(). - * @return ISlaveDbConnection database connection. - */ - public function getSlaveDbConnection() - { - return $this->getDistributedDbConnection(); - } - } -?> \ No newline at end of file -- cgit v1.2.3