/** * Class constructor * * @param array $params * @return void */ public function __construct($params) { parent::__construct($params); if (preg_match('/^CUBRID:[^:]+(:[0-9][1-9]{0,4})?:[^:]+:[^:]*:[^:]*:(\\?.+)?$/', $this->dsn, $matches)) { if (stripos($matches[2], 'autocommit=off') !== FALSE) { $this->auto_commit = FALSE; } } else { // If no port is defined by the user, use the default value empty($this->port) or $this->port = 33000; } }
/** * Database version number * * @return string */ public function version() { if (isset($this->data_cache['version'])) { return $this->data_cache['version']; } // Not all subdrivers support the getAttribute() method try { return $this->data_cache['version'] = $this->conn_id->getAttribute(PDO::ATTR_SERVER_VERSION); } catch (PDOException $e) { return parent::version(); } }
/** * 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); }
/** * 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; }
/** * Replace statement * * Generates a platform-specific replace string from the supplied data * * @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); }
/** * 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); }
/** * Class constructor * * @param array $params * @return void */ public function __construct($params) { parent::__construct($params); if (!empty($this->port)) { $this->hostname .= ':' . $this->port; } }