[limb-svn] r6390 - in 3.x/trunk/limb/dbal/src: criteria drivers/sqlite toolkit
svn at limb-project.com
svn at limb-project.com
Sun Oct 7 10:24:26 MSD 2007
Author: pachanga
Date: 2007-10-07 10:24:26 +0400 (Sun, 07 Oct 2007)
New Revision: 6390
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6390
Modified:
3.x/trunk/limb/dbal/src/criteria/lmbSQLBaseCriteria.class.php
3.x/trunk/limb/dbal/src/criteria/lmbSQLCriteria.class.php
3.x/trunk/limb/dbal/src/drivers/sqlite/lmbSqliteConnection.class.php
3.x/trunk/limb/dbal/src/toolkit/lmbDbTools.class.php
Log:
-- eol fixes
Modified: 3.x/trunk/limb/dbal/src/criteria/lmbSQLBaseCriteria.class.php
===================================================================
--- 3.x/trunk/limb/dbal/src/criteria/lmbSQLBaseCriteria.class.php 2007-10-07 05:09:42 UTC (rev 6389)
+++ 3.x/trunk/limb/dbal/src/criteria/lmbSQLBaseCriteria.class.php 2007-10-07 06:24:26 UTC (rev 6390)
@@ -1,118 +1,118 @@
-<?php
-/*
- * Limb PHP Framework
- *
- * @link http://limb-project.com
- * @copyright Copyright © 2004-2007 BIT(http://bit-creative.com)
- * @license LGPL http://www.gnu.org/copyleft/lesser.html
- */
-//inspired by Propel Criteria(http://propel.phpdb.org)
-lmb_require('limb/dbal/src/criteria/lmbSQLCriteria.class.php');
-
-/**
- * abstract class lmbSQLBaseCriteria.
- *
- * @package dbal
- * @version $Id$
- */
-abstract class lmbSQLBaseCriteria
-{
- const _AND_ = " AND ";
- const _OR_ = " OR ";
-
- protected $criteria = array();
- protected $conjunctions = array();
- protected $not = false;
- protected $not_all = false;
-
- //'and' & 'or' are keywords in php :(
- function addAnd($criteria)
- {
- $this->criteria[] = lmbSQLCriteria :: objectify($criteria);
- $this->conjunctions[] = self::_AND_;
- return $this;
- }
-
- function add($criteria)
- {
- return $this->addAnd($criteria);
- }
-
- function addOr($criteria)
- {
- $this->criteria[] = lmbSQLCriteria :: objectify($criteria);
- $this->conjunctions[] = self::_OR_;
- return $this;
- }
-
- function not()
- {
- $this->not = !$this->not;
- return $this;
- }
-
- function notAll()
- {
- $this->not_all = !$this->not_all;
- return $this;
- }
-
- function isComplex()
- {
- return sizeof($this->criteria) > 0;
- }
-
- protected function _getClauses()
- {
- return $this->criteria;
- }
-
- protected function _getConjunctions()
- {
- return $this->conjunctions;
- }
-
- function toStatementString(&$values = array(), $conn = null)
- {
- $str = '';
- $this->appendStatementTo($str, $values, $conn);
- return $str;
- }
-
- function appendStatementTo(&$str, &$values = array(), $conn = null)
- {
- if(!is_object($conn))
- $conn = lmbToolkit :: instance()->getDefaultDbConnection();
-
- if($this->not_all)
- $str .= 'NOT(';
-
- if($this->not)
- $str .= 'NOT(';
-
- $this->_appendExpressionToStatement($str, $values, $conn);
-
- if($this->not)
- $str .= ')';
-
- for($i=0; $i < count($this->criteria); $i++)
- {
- $criteria = $this->criteria[$i];
- $str .= $this->conjunctions[$i];
-
- if($criteria->isComplex())
- $str .= '(';
-
- $criteria->appendStatementTo($str, $values, $conn);
-
- if($criteria->isComplex())
- $str .= ')';
- }
-
- if($this->not_all)
- $str .= ')';
- }
-
- protected function _appendExpressionToStatement(&$str, &$values, $conn){}
-}
-
+<?php
+/*
+ * Limb PHP Framework
+ *
+ * @link http://limb-project.com
+ * @copyright Copyright © 2004-2007 BIT(http://bit-creative.com)
+ * @license LGPL http://www.gnu.org/copyleft/lesser.html
+ */
+//inspired by Propel Criteria(http://propel.phpdb.org)
+lmb_require('limb/dbal/src/criteria/lmbSQLCriteria.class.php');
+
+/**
+ * abstract class lmbSQLBaseCriteria.
+ *
+ * @package dbal
+ * @version $Id$
+ */
+abstract class lmbSQLBaseCriteria
+{
+ const _AND_ = " AND ";
+ const _OR_ = " OR ";
+
+ protected $criteria = array();
+ protected $conjunctions = array();
+ protected $not = false;
+ protected $not_all = false;
+
+ //'and' & 'or' are keywords in php :(
+ function addAnd($criteria)
+ {
+ $this->criteria[] = lmbSQLCriteria :: objectify($criteria);
+ $this->conjunctions[] = self::_AND_;
+ return $this;
+ }
+
+ function add($criteria)
+ {
+ return $this->addAnd($criteria);
+ }
+
+ function addOr($criteria)
+ {
+ $this->criteria[] = lmbSQLCriteria :: objectify($criteria);
+ $this->conjunctions[] = self::_OR_;
+ return $this;
+ }
+
+ function not()
+ {
+ $this->not = !$this->not;
+ return $this;
+ }
+
+ function notAll()
+ {
+ $this->not_all = !$this->not_all;
+ return $this;
+ }
+
+ function isComplex()
+ {
+ return sizeof($this->criteria) > 0;
+ }
+
+ protected function _getClauses()
+ {
+ return $this->criteria;
+ }
+
+ protected function _getConjunctions()
+ {
+ return $this->conjunctions;
+ }
+
+ function toStatementString(&$values = array(), $conn = null)
+ {
+ $str = '';
+ $this->appendStatementTo($str, $values, $conn);
+ return $str;
+ }
+
+ function appendStatementTo(&$str, &$values = array(), $conn = null)
+ {
+ if(!is_object($conn))
+ $conn = lmbToolkit :: instance()->getDefaultDbConnection();
+
+ if($this->not_all)
+ $str .= 'NOT(';
+
+ if($this->not)
+ $str .= 'NOT(';
+
+ $this->_appendExpressionToStatement($str, $values, $conn);
+
+ if($this->not)
+ $str .= ')';
+
+ for($i=0; $i < count($this->criteria); $i++)
+ {
+ $criteria = $this->criteria[$i];
+ $str .= $this->conjunctions[$i];
+
+ if($criteria->isComplex())
+ $str .= '(';
+
+ $criteria->appendStatementTo($str, $values, $conn);
+
+ if($criteria->isComplex())
+ $str .= ')';
+ }
+
+ if($this->not_all)
+ $str .= ')';
+ }
+
+ protected function _appendExpressionToStatement(&$str, &$values, $conn){}
+}
+
Modified: 3.x/trunk/limb/dbal/src/criteria/lmbSQLCriteria.class.php
===================================================================
--- 3.x/trunk/limb/dbal/src/criteria/lmbSQLCriteria.class.php 2007-10-07 05:09:42 UTC (rev 6389)
+++ 3.x/trunk/limb/dbal/src/criteria/lmbSQLCriteria.class.php 2007-10-07 06:24:26 UTC (rev 6390)
@@ -1,119 +1,119 @@
-<?php
-/*
- * Limb PHP Framework
- *
- * @link http://limb-project.com
- * @copyright Copyright © 2004-2007 BIT(http://bit-creative.com)
- * @license LGPL http://www.gnu.org/copyleft/lesser.html
- */
-lmb_require(dirname(__FILE__) . '/lmbSQLBaseCriteria.class.php');
-lmb_require(dirname(__FILE__) . '/lmbSQLFieldBetweenCriteria.class.php');
-lmb_require(dirname(__FILE__) . '/lmbSQLFieldCriteria.class.php');
-
-/**
- * class lmbSQLCriteria.
- *
- * @package dbal
- * @version $Id$
- */
-class lmbSQLCriteria extends lmbSQLBaseCriteria
-{
- protected $raw_sql;
- protected $values;
-
- function __construct($raw_sql = '1 = 1', $values = array())
- {
- $this->raw_sql = $raw_sql;
- $this->values = $values;
- }
- /**
- * Used for chaining
- */
- static function create($raw_sql = '1 = 1', $values = array())
- {
- return new lmbSQLCriteria($raw_sql, $values);
- }
-
- protected function _appendExpressionToStatement(&$str, &$values, $conn)
- {
- $sql = $this->raw_sql;
-
- foreach($this->values as $key => $value)
- {
- if(is_numeric($key))
- {
- $random_key = 'p' . mt_rand();
- $values[$random_key] = $value;
- $sql = preg_replace('~\?~', ':' . $random_key . ':', $sql, $limit = 1);
- }
- else
- $values[$key] = $value;
- }
-
- $str .= $sql;
- }
-
- static function between($column, $value_from, $value_to)
- {
- return new lmbSQLFieldBetweenCriteria($column, $value_from, $value_to);
- }
-
- static function in($column, $values, $handler = null)
- {
- if($handler)
- $values = array_map($handler, $values);
- return new lmbSQLFieldCriteria($column, $values, lmbSQLFieldCriteria :: IN);
- }
-
- static function equal($column, $value)
- {
- return new lmbSQLFieldCriteria($column, $value, lmbSQLFieldCriteria :: EQUAL);
- }
-
- static function like($column, $value)
- {
- return new lmbSQLFieldCriteria($column, $value, lmbSQLFieldCriteria :: LIKE);
- }
-
- static function isNull($column)
- {
- return new lmbSQLFieldCriteria($column, null, lmbSQLFieldCriteria :: IS_NULL);
- }
-
- static function objectify($args)
- {
- if(is_null($args))
- return new lmbSQLCriteria();
-
- if(is_array($args))
- {
- //array(new lmbSQLCriteria(..))
- if(is_object($args[0]))
- return $args[0];
-
- //array('id=1')
- if(!isset($args[1]) && isset($args[0]))
- return new lmbSQLCriteria($args[0]);
- //array('id=?', array(1))
- elseif(isset($args[0]) && is_array($args[1]))
- return new lmbSQLCriteria($args[0], $args[1]);
- //array('id=?', 1)
- elseif(isset($args[0]))
- {
- $sql = array_shift($args);
- return new lmbSQLCriteria($sql, $args);
- }
- }
- //id=1
- elseif(is_string($args))
- {
- return new lmbSQLCriteria($args);
- }
- //new lmbSQLCriteria(..)
- elseif(is_object($args))
- {
- return $args;
- }
- }
-}
-
+<?php
+/*
+ * Limb PHP Framework
+ *
+ * @link http://limb-project.com
+ * @copyright Copyright © 2004-2007 BIT(http://bit-creative.com)
+ * @license LGPL http://www.gnu.org/copyleft/lesser.html
+ */
+lmb_require(dirname(__FILE__) . '/lmbSQLBaseCriteria.class.php');
+lmb_require(dirname(__FILE__) . '/lmbSQLFieldBetweenCriteria.class.php');
+lmb_require(dirname(__FILE__) . '/lmbSQLFieldCriteria.class.php');
+
+/**
+ * class lmbSQLCriteria.
+ *
+ * @package dbal
+ * @version $Id$
+ */
+class lmbSQLCriteria extends lmbSQLBaseCriteria
+{
+ protected $raw_sql;
+ protected $values;
+
+ function __construct($raw_sql = '1 = 1', $values = array())
+ {
+ $this->raw_sql = $raw_sql;
+ $this->values = $values;
+ }
+ /**
+ * Used for chaining
+ */
+ static function create($raw_sql = '1 = 1', $values = array())
+ {
+ return new lmbSQLCriteria($raw_sql, $values);
+ }
+
+ protected function _appendExpressionToStatement(&$str, &$values, $conn)
+ {
+ $sql = $this->raw_sql;
+
+ foreach($this->values as $key => $value)
+ {
+ if(is_numeric($key))
+ {
+ $random_key = 'p' . mt_rand();
+ $values[$random_key] = $value;
+ $sql = preg_replace('~\?~', ':' . $random_key . ':', $sql, $limit = 1);
+ }
+ else
+ $values[$key] = $value;
+ }
+
+ $str .= $sql;
+ }
+
+ static function between($column, $value_from, $value_to)
+ {
+ return new lmbSQLFieldBetweenCriteria($column, $value_from, $value_to);
+ }
+
+ static function in($column, $values, $handler = null)
+ {
+ if($handler)
+ $values = array_map($handler, $values);
+ return new lmbSQLFieldCriteria($column, $values, lmbSQLFieldCriteria :: IN);
+ }
+
+ static function equal($column, $value)
+ {
+ return new lmbSQLFieldCriteria($column, $value, lmbSQLFieldCriteria :: EQUAL);
+ }
+
+ static function like($column, $value)
+ {
+ return new lmbSQLFieldCriteria($column, $value, lmbSQLFieldCriteria :: LIKE);
+ }
+
+ static function isNull($column)
+ {
+ return new lmbSQLFieldCriteria($column, null, lmbSQLFieldCriteria :: IS_NULL);
+ }
+
+ static function objectify($args)
+ {
+ if(is_null($args))
+ return new lmbSQLCriteria();
+
+ if(is_array($args))
+ {
+ //array(new lmbSQLCriteria(..))
+ if(is_object($args[0]))
+ return $args[0];
+
+ //array('id=1')
+ if(!isset($args[1]) && isset($args[0]))
+ return new lmbSQLCriteria($args[0]);
+ //array('id=?', array(1))
+ elseif(isset($args[0]) && is_array($args[1]))
+ return new lmbSQLCriteria($args[0], $args[1]);
+ //array('id=?', 1)
+ elseif(isset($args[0]))
+ {
+ $sql = array_shift($args);
+ return new lmbSQLCriteria($sql, $args);
+ }
+ }
+ //id=1
+ elseif(is_string($args))
+ {
+ return new lmbSQLCriteria($args);
+ }
+ //new lmbSQLCriteria(..)
+ elseif(is_object($args))
+ {
+ return $args;
+ }
+ }
+}
+
Modified: 3.x/trunk/limb/dbal/src/drivers/sqlite/lmbSqliteConnection.class.php
===================================================================
--- 3.x/trunk/limb/dbal/src/drivers/sqlite/lmbSqliteConnection.class.php 2007-10-07 05:09:42 UTC (rev 6389)
+++ 3.x/trunk/limb/dbal/src/drivers/sqlite/lmbSqliteConnection.class.php 2007-10-07 06:24:26 UTC (rev 6390)
@@ -1,185 +1,184 @@
-<?php
-/*
- * Limb PHP Framework
- *
- * @link http://limb-project.com
- * @copyright Copyright © 2004-2007 BIT(http://bit-creative.com)
- * @license LGPL http://www.gnu.org/copyleft/lesser.html
- */
-
-lmb_require('limb/dbal/src/drivers/lmbDbConnection.interface.php');
-lmb_require(dirname(__FILE__) . '/lmbSqliteDbInfo.class.php');
-lmb_require(dirname(__FILE__) . '/lmbSqliteQueryStatement.class.php');
-lmb_require(dirname(__FILE__) . '/lmbSqliteInsertStatement.class.php');
-lmb_require(dirname(__FILE__) . '/lmbSqliteDropStatement.class.php');
-lmb_require(dirname(__FILE__) . '/lmbSqliteManipulationStatement.class.php');
-lmb_require(dirname(__FILE__) . '/lmbSqliteStatement.class.php');
-lmb_require(dirname(__FILE__) . '/lmbSqliteTypeInfo.class.php');
-lmb_require(dirname(__FILE__) . '/lmbSqliteRecord.class.php');
-
-/**
- * class lmbSqliteConnection.
- *
- * @package dbal
- * @version $Id$
- */
-class lmbSqliteConnection implements lmbDbConnection
-{
- protected $connectionId;
- protected $config;
- protected $in_transaction = false;
-
- function __construct($config)
- {
- $this->config = $config;
- }
-
- function getType()
- {
- return 'sqlite';
- }
-
- function getConnectionId()
- {
- if(!is_resource($this->connectionId))
- $this->connect();
-
- return $this->connectionId;
- }
-
- function getHash()
- {
- return crc32(serialize($this->config));
- }
-
- function connect()
- {
- $this->connectionId = sqlite_open($this->config['database'], 0666, $error);
-
- if($this->connectionId === false)
- $this->_raiseError();
- }
-
- function __wakeup()
- {
- $this->connectionId = null;
- }
-
- function disconnect()
- {
- if(is_resource($this->connectionId))
- {
- sqlite_close($this->connectionId);
- $this->connectionId = null;
- }
- }
-
- function _raiseError($sql = null)
- {
- if(!$this->connectionId)
- throw new lmbDbException('Could not connect to database "' . $this->config['database'] . '"');
-
- $errno = sqlite_last_error($this->connectionId);
-
- $info = array('driver' => 'sqlite');
- $info['errorno'] = $errno;
-
- if(!is_null($sql))
- $info['sql'] = $sql;
-
- throw new lmbDbException(sqlite_error_string($errno) . ' SQL: '. $sql, $info);
- }
-
- function execute($sql)
- {
- $result = sqlite_query($this->getConnectionId(), $sql);
- if($result === false)
- $this->_raiseError($sql);
-
- return $result;
- }
-
- function beginTransaction()
- {
- $this->execute('BEGIN');
- $this->in_transaction = true;
- }
-
- function commitTransaction()
- {
- if($this->in_transaction)
- {
- $this->execute('COMMIT');
- $this->in_transaction = false;
- }
- }
-
- function rollbackTransaction()
- {
- if($this->in_transaction)
- {
- $this->execute('ROLLBACK');
- $this->in_transaction = false;
- }
- }
-
- function newStatement($sql)
- {
- if(preg_match('/^\s*\(*\s*(\w+).*$/m', $sql, $match))
- $statement = $match[1];
- else
- $statement = $sql;
-
- switch(strtoupper($statement))
- {
- case 'SELECT':
- case 'SHOW':
- case 'DESCRIBE':
- case 'EXPLAIN':
- return new lmbSqliteQueryStatement($this, $sql);
- case 'INSERT':
- return new lmbSqliteInsertStatement($this, $sql);
- case 'DROP':
- return new lmbSqliteDropStatement($this, $sql);
- case 'UPDATE':
- case 'DELETE':
- return new lmbSqliteManipulationStatement($this, $sql);
- default:
- return new lmbSqliteStatement($this, $sql);
- }
- }
-
- function getTypeInfo()
- {
- return new lmbSqliteTypeInfo();
- }
-
- function getDatabaseInfo()
- {
- return new lmbSqliteDbInfo($this, $this->config['database'], true);
- }
-
- function quoteIdentifier($id)
- {
- if(!$id) return '';
-
- $pieces = explode('.', $id);
- $quoted = '"' . $pieces[0] . '"';
- if(isset($pieces[1]))
- $quoted .= '."' . $pieces[1] . '"';
- return $quoted;
- }
-
- function escape($string)
- {
- return sqlite_escape_string($string);
- }
-
- function getSequenceValue($table, $colname)
- {
- return sqlite_last_insert_rowid($this->connectionId);//???
-
- }
-}
-
-
+<?php
+/*
+ * Limb PHP Framework
+ *
+ * @link http://limb-project.com
+ * @copyright Copyright © 2004-2007 BIT(http://bit-creative.com)
+ * @license LGPL http://www.gnu.org/copyleft/lesser.html
+ */
+
+lmb_require('limb/dbal/src/drivers/lmbDbConnection.interface.php');
+lmb_require(dirname(__FILE__) . '/lmbSqliteDbInfo.class.php');
+lmb_require(dirname(__FILE__) . '/lmbSqliteQueryStatement.class.php');
+lmb_require(dirname(__FILE__) . '/lmbSqliteInsertStatement.class.php');
+lmb_require(dirname(__FILE__) . '/lmbSqliteDropStatement.class.php');
+lmb_require(dirname(__FILE__) . '/lmbSqliteManipulationStatement.class.php');
+lmb_require(dirname(__FILE__) . '/lmbSqliteStatement.class.php');
+lmb_require(dirname(__FILE__) . '/lmbSqliteTypeInfo.class.php');
+lmb_require(dirname(__FILE__) . '/lmbSqliteRecord.class.php');
+
+/**
+ * class lmbSqliteConnection.
+ *
+ * @package dbal
+ * @version $Id$
+ */
+class lmbSqliteConnection implements lmbDbConnection
+{
+ protected $connectionId;
+ protected $config;
+ protected $in_transaction = false;
+
+ function __construct($config)
+ {
+ $this->config = $config;
+ }
+
+ function getType()
+ {
+ return 'sqlite';
+ }
+
+ function getConnectionId()
+ {
+ if(!is_resource($this->connectionId))
+ $this->connect();
+
+ return $this->connectionId;
+ }
+
+ function getHash()
+ {
+ return crc32(serialize($this->config));
+ }
+
+ function connect()
+ {
+ $this->connectionId = sqlite_open($this->config['database'], 0666, $error);
+
+ if($this->connectionId === false)
+ $this->_raiseError();
+ }
+
+ function __wakeup()
+ {
+ $this->connectionId = null;
+ }
+
+ function disconnect()
+ {
+ if(is_resource($this->connectionId))
+ {
+ sqlite_close($this->connectionId);
+ $this->connectionId = null;
+ }
+ }
+
+ function _raiseError($sql = null)
+ {
+ if(!$this->connectionId)
+ throw new lmbDbException('Could not connect to database "' . $this->config['database'] . '"');
+
+ $errno = sqlite_last_error($this->connectionId);
+
+ $info = array('driver' => 'sqlite');
+ $info['errorno'] = $errno;
+
+ if(!is_null($sql))
+ $info['sql'] = $sql;
+
+ throw new lmbDbException(sqlite_error_string($errno) . ' SQL: '. $sql, $info);
+ }
+
+ function execute($sql)
+ {
+ $result = sqlite_query($this->getConnectionId(), $sql);
+ if($result === false)
+ $this->_raiseError($sql);
+
+ return $result;
+ }
+
+ function beginTransaction()
+ {
+ $this->execute('BEGIN');
+ $this->in_transaction = true;
+ }
+
+ function commitTransaction()
+ {
+ if($this->in_transaction)
+ {
+ $this->execute('COMMIT');
+ $this->in_transaction = false;
+ }
+ }
+
+ function rollbackTransaction()
+ {
+ if($this->in_transaction)
+ {
+ $this->execute('ROLLBACK');
+ $this->in_transaction = false;
+ }
+ }
+
+ function newStatement($sql)
+ {
+ if(preg_match('/^\s*\(*\s*(\w+).*$/m', $sql, $match))
+ $statement = $match[1];
+ else
+ $statement = $sql;
+
+ switch(strtoupper($statement))
+ {
+ case 'SELECT':
+ case 'SHOW':
+ case 'DESCRIBE':
+ case 'EXPLAIN':
+ return new lmbSqliteQueryStatement($this, $sql);
+ case 'INSERT':
+ return new lmbSqliteInsertStatement($this, $sql);
+ case 'DROP':
+ return new lmbSqliteDropStatement($this, $sql);
+ case 'UPDATE':
+ case 'DELETE':
+ return new lmbSqliteManipulationStatement($this, $sql);
+ default:
+ return new lmbSqliteStatement($this, $sql);
+ }
+ }
+
+ function getTypeInfo()
+ {
+ return new lmbSqliteTypeInfo();
+ }
+
+ function getDatabaseInfo()
+ {
+ return new lmbSqliteDbInfo($this, $this->config['database'], true);
+ }
+
+ function quoteIdentifier($id)
+ {
+ if(!$id) return '';
+
+ $pieces = explode('.', $id);
+ $quoted = '"' . $pieces[0] . '"';
+ if(isset($pieces[1]))
+ $quoted .= '."' . $pieces[1] . '"';
+ return $quoted;
+ }
+
+ function escape($string)
+ {
+ return sqlite_escape_string($string);
+ }
+
+ function getSequenceValue($table, $colname)
+ {
+ return sqlite_last_insert_rowid($this->connectionId);//???
+ }
+}
+
+
Modified: 3.x/trunk/limb/dbal/src/toolkit/lmbDbTools.class.php
===================================================================
--- 3.x/trunk/limb/dbal/src/toolkit/lmbDbTools.class.php 2007-10-07 05:09:42 UTC (rev 6389)
+++ 3.x/trunk/limb/dbal/src/toolkit/lmbDbTools.class.php 2007-10-07 06:24:26 UTC (rev 6390)
@@ -39,12 +39,12 @@
return $this->db_env;
}
- function setDefaultDbDSN($conf)
+ function setDefaultDbDSN($dsn)
{
- if(is_object($conf))
- $this->default_db_config = $conf;
+ if(is_object($dsn))
+ $this->default_db_config = $dsn;
else
- $this->default_db_config = new lmbDbDSN($conf);
+ $this->default_db_config = new lmbDbDSN($dsn);
}
function getDefaultDbDSN()
@@ -96,6 +96,9 @@
function createDbConnection($dsn)
{
+ if(!is_object($dsn))
+ $dsn = new lmbDbDSN($dsn);
+
$driver = $dsn->getDriver();
$class = 'lmb' . ucfirst($driver) . 'Connection';
More information about the limb-svn
mailing list