From 1f8410794c8213d87227fabae2114a3be8033ece Mon Sep 17 00:00:00 2001 From: wei <> Date: Thu, 18 May 2006 08:16:21 +0000 Subject: Moved adodb to 3rdParty directory. --- framework/DataAccess/TCreoleProvider.php | 83 -------------------------------- 1 file changed, 83 deletions(-) delete mode 100644 framework/DataAccess/TCreoleProvider.php (limited to 'framework/DataAccess/TCreoleProvider.php') diff --git a/framework/DataAccess/TCreoleProvider.php b/framework/DataAccess/TCreoleProvider.php deleted file mode 100644 index f4ccd4c2..00000000 --- a/framework/DataAccess/TCreoleProvider.php +++ /dev/null @@ -1,83 +0,0 @@ -_connection)) - $this->_connection = new TCreoleConnection($this); - return $this->_connection; - } - - public function getConnectionString() - { - if(strlen(parent::getConnectionString()) > 0) - return parent::getConnectionString(); - else - return $this->generateConnectionString(); - } - - protected function generateConnectionString() - { - $driver = $this->getDriver(); - $user = $this->getUsername(); - $pass = $this->getPassword(); - $host = $this->getHost(); - $database = $this->getDatabase(); - - $pass = strlen($pass) > 0 ? ':'.$pass : ''; - $username_password = strlen($user) > 0 ? $user.$pass.'@' : ''; - $database = strlen($database) > 0 ? '/'.$database : ''; - - return "{$driver}://{$username_password}{$host}{$database}"; - } -} - -class TCreoleConnection extends TDbConnection -{ - private $_connection = null; - - protected function beginDbTransaction() - { - } - - /** - * Closes the connection to the database. - */ - public function close() - { - $this->_connection->close(); - } - - public function prepare($statement) - { - return $this->_connection->prepareStatement($statement); - } - - //public function execute($sql, - - /** - * Opens a database connection with settings provided in the ConnectionString. - */ - public function open() - { - if(is_null($this->_connection)) - { - $connectionString = $this->getProvider()->getConnectionString(); - if(strlen($connectionString) < 1 || strcmp($connectionString,'://') === 0) - throw new TDbConnectionException('db_driver_required'); - $class = 'System.DataAccess.creole.creole.Creole'; - $creole = Prado::createComponent($class); - $this->_connection = $creole->getConnection($connectionString); - } - return $this->_connection; - } -} - -?> \ No newline at end of file -- cgit v1.2.3