コード例 #1
0
ファイル: pdo_cubrid_driver.php プロジェクト: yang7hua/mall
 /**
  * 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 = 'cubrid: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;
     }
 }
コード例 #2
0
ファイル: pdo_sqlsrv_driver.php プロジェクト: yang7hua/mall
 /**
  * Insert batch statement
  *
  * Generates a platform-specific insert string from the supplied data.
  *
  * @param	string	$table	Table name
  * @param	array	$keys	INSERT keys
  * @param	array	$values	INSERT values
  * @return	string|bool
  */
 protected function _insert_batch($table, $keys, $values)
 {
     // Multiple-value inserts are only supported as of SQL Server 2008
     if (version_compare($this->version(), '10', '>=')) {
         return parent::_insert_batch($table, $keys, $values);
     }
     return $this->db->db_debug ? $this->db->display_error('db_unsupported_feature') : FALSE;
 }
コード例 #3
0
ファイル: pdo_4d_driver.php プロジェクト: yang7hua/mall
 /**
  * Delete statement
  *
  * Generates a platform-specific delete string from the supplied data
  *
  * @param	string	$table
  * @return	string
  */
 protected function _delete($table)
 {
     $this->qb_limit = FALSE;
     return parent::_delete($table);
 }
コード例 #4
0
ファイル: pdo_oci_driver.php プロジェクト: yang7hua/mall
 /**
  * Delete statement
  *
  * Generates a platform-specific delete string from the supplied data
  *
  * @param	string	$table
  * @return	string
  */
 protected function _delete($table)
 {
     if ($this->qb_limit) {
         $this->where('rownum <= ', $this->qb_limit, FALSE);
         $this->qb_limit = FALSE;
     }
     return parent::_delete($table);
 }
コード例 #5
0
ファイル: pdo_mysql_driver.php プロジェクト: yang7hua/mall
 /**
  * Database connection
  *
  * @param	bool	$persistent
  * @return	object
  * @todo	SSL support
  */
 public function db_connect($persistent = FALSE)
 {
     /* Prior to PHP 5.3.6, even if the charset was supplied in the DSN
      * on connect - it was ignored. This is a work-around for the issue.
      *
      * Reference: http://www.php.net/manual/en/ref.pdo-mysql.connection.php
      */
     if (!is_php('5.3.6') && !empty($this->char_set)) {
         $this->options[PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET NAMES ' . $this->char_set . (empty($this->dbcollat) ? '' : ' COLLATE ' . $this->dbcollat);
     }
     if ($this->stricton) {
         if (empty($this->options[PDO::MYSQL_ATTR_INIT_COMMAND])) {
             $this->options[PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET SESSION sql_mode="STRICT_ALL_TABLES"';
         } else {
             $this->options[PDO::MYSQL_ATTR_INIT_COMMAND] .= ', @@session.sql_mode = "STRICT_ALL_TABLES"';
         }
     }
     if ($this->compress === TRUE) {
         $this->options[PDO::MYSQL_ATTR_COMPRESS] = TRUE;
     }
     return parent::db_connect($persistent);
 }
コード例 #6
0
ファイル: pdo_sqlite_driver.php プロジェクト: yang7hua/mall
 /**
  * Replace statement
  *
  * @param	string	$table	Table name
  * @param	array	$keys	INSERT keys
  * @param	array	$values	INSERT values
  * @return 	string
  */
 protected function _replace($table, $keys, $values)
 {
     return 'INSERT OR ' . parent::_replace($table, $keys, $values);
 }