本文整理汇总了PHP中PropelPDO::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP PropelPDO::__construct方法的具体用法?PHP PropelPDO::__construct怎么用?PHP PropelPDO::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropelPDO
的用法示例。
在下文中一共展示了PropelPDO::__construct方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($dsn, $username = null, $password = null, $driver_options = array())
{
if (isset($driver_options[self::KALTURA_ATTR_NAME])) {
$this->connectionName = $driver_options[self::KALTURA_ATTR_NAME];
}
list($mysql, $connection) = explode(':', $dsn);
$arguments = explode(';', $connection);
foreach ($arguments as $argument) {
list($argumentName, $argumentValue) = explode('=', $argument);
if (strtolower($argumentName) == 'host') {
$this->hostName = $argumentValue;
break;
}
}
$connStart = microtime(true);
parent::__construct($dsn, $username, $password, $driver_options);
KalturaLog::debug("conn took - " . (microtime(true) - $connStart) . " seconds to {$dsn}");
$this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('KalturaStatement'));
}
示例2: __construct
public function __construct($dsn, $username = null, $password = null, $driver_options = array(), $config_key = null)
{
if (isset($driver_options[KalturaPDO::KALTURA_ATTR_NAME])) {
$this->connectionName = $driver_options[KalturaPDO::KALTURA_ATTR_NAME];
$this->kalturaOptions = DbManager::getKalturaConfig($this->connectionName);
}
list($mysql, $connection) = explode(':', $dsn);
$arguments = explode(';', $connection);
foreach ($arguments as $argument) {
list($argumentName, $argumentValue) = explode('=', $argument);
if (strtolower($argumentName) == 'host') {
$this->hostName = $argumentValue;
break;
}
}
$this->configKey = $config_key;
$connStart = microtime(true);
parent::__construct($dsn, $username, $password, $driver_options);
$connTook = microtime(true) - $connStart;
KalturaLog::debug("conn took - {$connTook} seconds to {$dsn}");
KalturaMonitorClient::monitorConnTook($dsn, $connTook);
$this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('KalturaStatement'));
}
示例3: __construct
public function __construct($dsn, $username = null, $password = null, $driver_options = array())
{
parent::__construct($dsn, $username, $password, $driver_options);
$this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('KalturaStatement'));
}
示例4: __construct
/**
* Creates a DebugPDO instance representing a connection to a database.
*
* This method is overridden in order to specify a custom PDOStatement class and to implement logging.
*
* @param string $dsn Connection DSN.
* @param string $username (optional) The user name for the DSN string.
* @param string $password (optional) The password for the DSN string.
* @param array $driver_options (optional) A key=>value array of driver-specific connection options.
* @throws PDOException if there is an error during connection initialization.
*/
public function __construct($dsn, $username = null, $password = null, $driver_options = array())
{
$debug = $this->getDebugSnapshot();
parent::__construct($dsn, $username, $password, $driver_options);
$this->configureStatementClass($suppress = true);
$this->log('', null, __METHOD__, $debug);
}
示例5: __construct
public function __construct($dsn, $username = null, $password = null, $driver_options = array())
{
parent::__construct($dsn, $username, $password, $driver_options);
$this->classId = md5($dsn . ',' . $username . ',' . $password . ',' . implode(',', $driver_options));
}
示例6: __construct
/**
* Construct a new DebugPDO connection.
*
* This method is overridden in order to specify a custom PDOStatement class.
*
* @param string $dsn Connection DSN
* @param string $username (optional
* @param string $password
* @param array $driver_options
* @throws PDOException - if there is an error during connection initialization
*/
public function __construct($dsn, $username = null, $password = null, $driver_options = array())
{
parent::__construct($dsn, $username, $password, $driver_options);
$this->configureStatementClass($suppress = true);
}