本文整理汇总了PHP中Zend_Db_Adapter_Pdo_Abstract::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Db_Adapter_Pdo_Abstract::__construct方法的具体用法?PHP Zend_Db_Adapter_Pdo_Abstract::__construct怎么用?PHP Zend_Db_Adapter_Pdo_Abstract::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Db_Adapter_Pdo_Abstract
的用法示例。
在下文中一共展示了Zend_Db_Adapter_Pdo_Abstract::__construct方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
*
* $config is an array of key/value pairs containing configuration
* options. Note that the SQLite options are different than most of
* the other PDO adapters in that no username or password are needed.
* Also, an extra config key "sqlite2" specifies compatibility mode.
*
* dbname => (string) The name of the database to user (required,
* use :memory: for memory-based database)
*
* sqlite2 => (boolean) PDO_SQLITE defaults to SQLite 3. For compatibility
* with an older SQLite 2 database, set this to TRUE.
*
* @param array $config An array of configuration keys.
*/
public function __construct(array $config = array())
{
if (isset($config['sqlite2']) && $config['sqlite2']) {
$this->_pdoType = 'sqlite2';
}
// SQLite uses no username/password. Stub to satisfy parent::_connect()
$this->_config['username'] = null;
$this->_config['password'] = null;
return parent::__construct($config);
}