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


PHP CI_DB_pdo_driver::__construct方法代码示例

本文整理汇总了PHP中CI_DB_pdo_driver::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP CI_DB_pdo_driver::__construct方法的具体用法?PHP CI_DB_pdo_driver::__construct怎么用?PHP CI_DB_pdo_driver::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CI_DB_pdo_driver的用法示例。


在下文中一共展示了CI_DB_pdo_driver::__construct方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Constructor
  *
  * Builds the DSN if not already set.
  *
  * @param	array
  * @return	void
  */
 public function __construct($params)
 {
     parent::__construct($params);
     if (empty($this->dsn)) {
         $this->dsn = 'sqlsrv:Server=' . (empty($this->hostname) ? '127.0.0.1' : $this->hostname);
         empty($this->port) or $this->dsn .= ',' . $this->port;
         empty($this->database) or $this->dsn .= ';Database=' . $this->database;
         // Some custom options
         if (isset($this->QuotedId)) {
             $this->dsn .= ';QuotedId=' . $this->QuotedId;
             $this->_quoted_identifier = (bool) $this->QuotedId;
         }
         if (isset($this->ConnectionPooling)) {
             $this->dsn .= ';ConnectionPooling=' . $this->ConnectionPooling;
         }
         if (isset($this->Encrypt)) {
             $this->dsn .= ';Encrypt=' . $this->Encrypt;
         }
         if (isset($this->TraceOn)) {
             $this->dsn .= ';TraceOn=' . $this->TraceOn;
         }
         if (isset($this->TrustServerCertificate)) {
             $this->dsn .= ';TrustServerCertificate=' . $this->TrustServerCertificate;
         }
         empty($this->APP) or $this->dsn .= ';APP=' . $this->APP;
         empty($this->Failover_Partner) or $this->dsn .= ';Failover_Partner=' . $this->Failover_Partner;
         empty($this->LoginTimeout) or $this->dsn .= ';LoginTimeout=' . $this->LoginTimeout;
         empty($this->MultipleActiveResultSets) or $this->dsn .= ';MultipleActiveResultSets=' . $this->MultipleActiveResultSets;
         empty($this->TraceFile) or $this->dsn .= ';TraceFile=' . $this->TraceFile;
         empty($this->WSID) or $this->dsn .= ';WSID=' . $this->WSID;
     } elseif (preg_match('/QuotedId=(0|1)/', $this->dsn, $match)) {
         $this->_quoted_identifier = (bool) $match[1];
     }
 }
开发者ID:rishikeshwalawalkar,项目名称:GetARide,代码行数:42,代码来源:pdo_sqlsrv_driver.php

示例2: __construct

 /**
  * Class constructor
  *
  * Builds the DSN if not already set.
  *
  * @param	array	$params
  * @return	void
  */
 public function __construct($params)
 {
     parent::__construct($params);
     if (empty($this->dsn)) {
         $this->dsn = 'informix:';
         // Pre-defined DSN
         if (empty($this->hostname) && empty($this->host) && empty($this->port) && empty($this->service)) {
             if (isset($this->DSN)) {
                 $this->dsn .= 'DSN=' . $this->DSN;
             } elseif (!empty($this->database)) {
                 $this->dsn .= 'DSN=' . $this->database;
             }
             return;
         }
         if (isset($this->host)) {
             $this->dsn .= 'host=' . $this->host;
         } else {
             $this->dsn .= 'host=' . (empty($this->hostname) ? '127.0.0.1' : $this->hostname);
         }
         if (isset($this->service)) {
             $this->dsn .= '; service=' . $this->service;
         } elseif (!empty($this->port)) {
             $this->dsn .= '; service=' . $this->port;
         }
         empty($this->database) or $this->dsn .= '; database=' . $this->database;
         empty($this->server) or $this->dsn .= '; server=' . $this->server;
         $this->dsn .= '; protocol=' . (isset($this->protocol) ? $this->protocol : 'onsoctcp') . '; EnableScrollableCursors=1';
     }
 }
开发者ID:DeDoOozZz,项目名称:brighterycms,代码行数:37,代码来源:pdo_informix_driver.php

示例3: __construct

 /**
  * Class constructor
  *
  * Builds the DSN if not already set.
  *
  * @param	array	$params
  * @return	void
  */
 public function __construct($params)
 {
     parent::__construct($params);
     if (empty($this->dsn)) {
         $this->dsn = 'ibm:';
         // Pre-defined DSN
         if (empty($this->hostname) && empty($this->HOSTNAME) && empty($this->port) && empty($this->PORT)) {
             if (isset($this->DSN)) {
                 $this->dsn .= 'DSN=' . $this->DSN;
             } elseif (!empty($this->database)) {
                 $this->dsn .= 'DSN=' . $this->database;
             }
             return;
         }
         $this->dsn .= 'DRIVER=' . (isset($this->DRIVER) ? '{' . $this->DRIVER . '}' : '{IBM DB2 ODBC DRIVER}') . ';';
         if (isset($this->DATABASE)) {
             $this->dsn .= 'DATABASE=' . $this->DATABASE . ';';
         } elseif (!empty($this->database)) {
             $this->dsn .= 'DATABASE=' . $this->database . ';';
         }
         if (isset($this->HOSTNAME)) {
             $this->dsn .= 'HOSTNAME=' . $this->HOSTNAME . ';';
         } else {
             $this->dsn .= 'HOSTNAME=' . (empty($this->hostname) ? '127.0.0.1;' : $this->hostname . ';');
         }
         if (isset($this->PORT)) {
             $this->dsn .= 'PORT=' . $this->port . ';';
         } elseif (!empty($this->port)) {
             $this->dsn .= ';PORT=' . $this->port . ';';
         }
         $this->dsn .= 'PROTOCOL=' . (isset($this->PROTOCOL) ? $this->PROTOCOL . ';' : 'TCPIP;');
     }
 }
开发者ID:darkwebside,项目名称:Sprint,代码行数:41,代码来源:pdo_ibm_driver.php

示例4: __construct

 /**
  * Class constructor
  *
  * Builds the DSN if not already set.
  *
  * @param	array	$params
  * @return	void
  */
 public function __construct($params)
 {
     parent::__construct($params);
     if (empty($this->dsn)) {
         $this->dsn = 'pgsql:host=' . (empty($this->hostname) ? '127.0.0.1' : $this->hostname);
         empty($this->port) or $this->dsn .= ';port=' . $this->port;
         empty($this->database) or $this->dsn .= ';dbname=' . $this->database;
     }
 }
开发者ID:sitesbyjoe,项目名称:starboard,代码行数:17,代码来源:pdo_pgsql_driver.php

示例5: __construct

 /**
  * Class constructor
  *
  * Builds the DSN if not already set.
  *
  * @param	array	$params
  * @return	void
  */
 public function __construct($params)
 {
     parent::__construct($params);
     if (empty($this->dsn)) {
         $this->dsn = 'sqlite:';
         if (empty($this->database) && empty($this->hostname)) {
             $this->database = ':memory:';
         }
         $this->database = empty($this->database) ? $this->hostname : $this->database;
     }
 }
开发者ID:assad2012,项目名称:My_CodeIgniter,代码行数:19,代码来源:pdo_sqlite_driver.php

示例6: __construct

 /**
  * Class constructor
  *
  * Builds the DSN if not already set.
  *
  * @param	array	$params
  * @return	void
  */
 public function __construct($params)
 {
     parent::__construct($params);
     if (empty($this->dsn)) {
         $this->dsn = '4D:host=' . (empty($this->hostname) ? '127.0.0.1' : $this->hostname);
         empty($this->port) or $this->dsn .= ';port=' . $this->port;
         empty($this->database) or $this->dsn .= ';dbname=' . $this->database;
         empty($this->char_set) or $this->dsn .= ';charset=' . $this->char_set;
     } elseif (!empty($this->char_set) && strpos($this->dsn, 'charset=', 3) === FALSE) {
         $this->dsn .= ';charset=' . $this->char_set;
     }
 }
开发者ID:alyayazilim,项目名称:E-Ticaret-2015,代码行数:20,代码来源:pdo_4d_driver.php

示例7: __construct

 /**
  * Class constructor
  *
  * Builds the DSN if not already set.
  *
  * @param	array	$params
  * @return	void
  */
 public function __construct($params)
 {
     parent::__construct($params);
     if (empty($this->dsn)) {
         $this->dsn = 'firebird:';
         if (!empty($this->database)) {
             $this->dsn .= 'dbname=' . $this->database;
         } elseif (!empty($this->hostname)) {
             $this->dsn .= 'dbname=' . $this->hostname;
         }
         empty($this->char_set) or $this->dsn .= ';charset=' . $this->char_set;
         empty($this->role) or $this->dsn .= ';role=' . $this->role;
     } elseif (!empty($this->char_set) && strpos($this->dsn, 'charset=', 9) === FALSE) {
         $this->dsn .= ';charset=' . $this->char_set;
     }
 }
开发者ID:oalkhanishvili,项目名称:track2,代码行数:24,代码来源:pdo_firebird_driver.php

示例8: __construct

 /**
  * Class constructor
  *
  * Builds the DSN if not already set.
  *
  * @param    array $params
  * @return    void
  */
 public function __construct($params)
 {
     parent::__construct($params);
     if (empty($this->dsn)) {
         $this->dsn = $params['subdriver'] . ':host=' . (empty($this->hostname) ? '127.0.0.1' : $this->hostname);
         if (!empty($this->port)) {
             $this->dsn .= (DIRECTORY_SEPARATOR === '\\' ? ',' : ':') . $this->port;
         }
         empty($this->database) or $this->dsn .= ';dbname=' . $this->database;
         empty($this->char_set) or $this->dsn .= ';charset=' . $this->char_set;
         empty($this->appname) or $this->dsn .= ';appname=' . $this->appname;
     } else {
         if (!empty($this->char_set) && strpos($this->dsn, 'charset=', 6) === FALSE) {
             $this->dsn .= ';charset=' . $this->char_set;
         }
         $this->subdriver = 'dblib';
     }
 }
开发者ID:at15,项目名称:codeignitordb,代码行数:26,代码来源:pdo_dblib_driver.php

示例9: __construct

 /**
  * Class constructor
  *
  * Builds the DSN if not already set.
  *
  * @param    array $params
  * @return    void
  */
 public function __construct($params)
 {
     parent::__construct($params);
     if (empty($this->dsn)) {
         $this->dsn = 'oci:dbname=';
         // Oracle has a slightly different PDO DSN format (Easy Connect),
         // which also supports pre-defined DSNs.
         if (empty($this->hostname) && empty($this->port)) {
             $this->dsn .= $this->database;
         } else {
             $this->dsn .= '//' . (empty($this->hostname) ? '127.0.0.1' : $this->hostname) . (empty($this->port) ? '' : ':' . $this->port) . '/';
             empty($this->database) or $this->dsn .= $this->database;
         }
         empty($this->char_set) or $this->dsn .= ';charset=' . $this->char_set;
     } elseif (!empty($this->char_set) && strpos($this->dsn, 'charset=', 4) === FALSE) {
         $this->dsn .= ';charset=' . $this->char_set;
     }
 }
开发者ID:at15,项目名称:codeignitordb,代码行数:26,代码来源:pdo_oci_driver.php

示例10: __construct

 /**
  * Class constructor
  *
  * Builds the DSN if not already set.
  *
  * @param	array	$params
  * @return	void
  */
 public function __construct($params)
 {
     parent::__construct($params);
     $this->_build_dsn();
 }
开发者ID:madwings,项目名称:insanedb,代码行数:13,代码来源:pdo_sqlsrv_driver.php

示例11: __construct

 /**
  * Class constructor.
  *
  * Builds the DSN if not already set.
  *
  * @param array $params
  *
  * @return void
  */
 public function __construct($params)
 {
     parent::__construct($params);
     if (empty($this->dsn)) {
         $this->dsn = 'mysql:host=' . (empty($this->hostname) ? '127.0.0.1' : $this->hostname);
         empty($this->port) or $this->dsn .= ';port=' . $this->port;
         empty($this->database) or $this->dsn .= ';dbname=' . $this->database;
         empty($this->char_set) or $this->dsn .= ';charset=' . $this->char_set;
     } elseif (!empty($this->char_set) && strpos($this->dsn, 'charset=', 6) === false && is_php('5.3.6')) {
         $this->dsn .= ';charset=' . $this->char_set;
     }
 }
开发者ID:recca0120,项目名称:laraigniter,代码行数:21,代码来源:pdo_mysql_driver.php


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