当前位置: 首页>>代码示例>>PHP>>正文


PHP PropelPDO::__construct方法代码示例

本文整理汇总了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'));
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:19,代码来源:KalturaPDO.php

示例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'));
 }
开发者ID:DBezemer,项目名称:server,代码行数:23,代码来源:KalturaPDO.php

示例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'));
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:5,代码来源:KalturaPDO.php

示例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);
 }
开发者ID:sundesz,项目名称:crafthouse,代码行数:18,代码来源:DebugPDO.php

示例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));
 }
开发者ID:halfer,项目名称:Meshing,代码行数:5,代码来源:Connection.php

示例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);
 }
开发者ID:nhemsley,项目名称:propel,代码行数:16,代码来源:DebugPDO.php


注:本文中的PropelPDO::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。