本文整理汇总了PHP中Creole::getDriver方法的典型用法代码示例。如果您正苦于以下问题:PHP Creole::getDriver方法的具体用法?PHP Creole::getDriver怎么用?PHP Creole::getDriver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Creole
的用法示例。
在下文中一共展示了Creole::getDriver方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: connect
/**
* connect()
*/
public function connect($dsninfo, $flags = 0)
{
if (!($driver = Creole::getDriver($dsninfo['phptype']))) {
throw new SQLException("No driver has been registered to handle connection type: {$type}");
}
$connectionClass = Creole::import($driver);
$this->childConnection = new $connectionClass();
$this->log("connect(): DSN: " . var_export($dsninfo, true) . ", FLAGS: " . var_export($flags, true));
return $this->childConnection->connect($dsninfo, $flags);
}
示例2: connect
/**
* @see Connection::connect()
*/
function connect($dsninfo, $flags = 0)
{
$class = Creole::getDriver($dsninfo['phptype']);
$class = Creole::import($class);
$this->driver = new $class();
}
示例3: connect
/**
* connect()
*/
public function connect($dsninfo, $flags = 0)
{
if (!($driver = Creole::getDriver($dsninfo['phptype']))) {
throw new SQLException("No driver has been registered to handle connection type: {$type}");
}
global $_DBArray;
if (!isset($_DBArray) && isset($_SESSION['_DBArray'])) {
//throw new SQLException("No Database Array defined for this connection but exists in session");
//Added by JHL to avoid errors trying to execute query of a dbarray on June 25, 2011
$_DBArray = $_SESSION['_DBArray'];
}
if (!isset($_DBArray)) {
throw new SQLException("No Database Array defined for this connection");
}
$this->_DBArray = $_DBArray;
return true;
}