當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。