本文整理匯總了PHP中Zend\Db\Adapter\Adapter::createDriver方法的典型用法代碼示例。如果您正苦於以下問題:PHP Adapter::createDriver方法的具體用法?PHP Adapter::createDriver怎麽用?PHP Adapter::createDriver使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend\Db\Adapter\Adapter
的用法示例。
在下文中一共展示了Adapter::createDriver方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: createDriver
/**
* {@inheritDoc}
*/
protected function createDriver($parameters)
{
if (is_array($parameters) && isset($parameters['driver']) && isset($parameters['pdodriver']) && is_string($parameters['driver']) && is_string($parameters['pdodriver']) && strtolower($parameters['driver']) == 'pdo' && strtolower($parameters['pdodriver']) == 'pgsql') {
return new Pdo(new Driver\Pdo\PgsqlConnection($parameters), new Driver\Pdo\Statement());
}
return parent::createDriver($parameters);
}
示例2: createDriver
/**
* {@inheritdoc}
*/
protected function createDriver($parameters)
{
$driver = parent::createDriver($parameters);
if ($driver instanceof \Zend\Db\Adapter\Driver\Mysqli\Mysqli) {
$connection = $driver->getConnection();
$nestedTransactionConnection = new MysqliNestedTransactionConnection($connection->getConnectionParameters());
$driver->registerConnection($nestedTransactionConnection);
}
return $driver;
}
示例3: createDriver
protected function createDriver($parameters)
{
$driver = parent::createDriver($parameters);
$driverName = strtolower($parameters['driver']);
if (StringUtils::startsWith($driverName, 'pdo_')) {
$driverName = substr($driverName, 4);
}
$this->driverName = $driverName;
return $driver;
}