From c5536aac5752054f7f76e448d58b86407d8f574e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 1 Nov 2012 17:33:58 +0200 Subject: Manually apply PR #1594 (fixing phpdoc page-level generation/warnings) Also partially fixes issue #1295, fixes inconsistencies in some page-level docblocks and adds include checks in language files. --- system/database/drivers/oci8/oci8_driver.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'system/database/drivers/oci8/oci8_driver.php') diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 81d73d073..b1fd86a8e 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -1,4 +1,4 @@ - Date: Fri, 2 Nov 2012 03:54:12 +0200 Subject: [ci skip] DocBlocks for DB drivers' driver classes Partially fixes issue #1295. --- system/database/drivers/oci8/oci8_driver.php | 108 +++++++++++++++++++-------- 1 file changed, 75 insertions(+), 33 deletions(-) (limited to 'system/database/drivers/oci8/oci8_driver.php') diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index b1fd86a8e..38d2395b6 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -50,34 +50,76 @@ defined('BASEPATH') OR exit('No direct script access allowed'); */ class CI_DB_oci8_driver extends CI_DB { + /** + * Database driver + * + * @var string + */ public $dbdriver = 'oci8'; - // The character used for excaping - protected $_escape_char = '"'; + /** + * Statement ID + * + * @var resource + */ + public $stmt_id; /** - * The syntax to count rows is slightly different across different - * database engines, so this string appears in each driver and is - * used for the count_all() and count_all_results() functions. + * Cursor ID + * + * @var resource */ - protected $_count_string = 'SELECT COUNT(1) AS '; - protected $_random_keyword = ' ASC'; // not currently supported + public $curs_id; + + /** + * Commit mode flag + * + * @var int + */ + public $commit_mode = OCI_COMMIT_ON_SUCCESS; + + /** + * Limit used flag + * + * If we use LIMIT, we'll add a field that will + * throw off num_fields later. + * + * @var bool + */ + public $limit_used; + // -------------------------------------------------------------------- + + /** + * List of reserved identifiers + * + * Identifiers that must NOT be escaped. + * + * @var string[] + */ protected $_reserved_identifiers = array('*', 'rownum'); - // Set "auto commit" by default - public $commit_mode = OCI_COMMIT_ON_SUCCESS; + /** + * ORDER BY random keyword + * + * @var string + */ + protected $_random_keyword = ' ASC'; // not currently supported - // need to track statement id and cursor id - public $stmt_id; - public $curs_id; + /** + * COUNT string + * + * @used-by CI_DB_driver::count_all() + * @used-by CI_DB_query_builder::count_all_results() + * + * @var string + */ + protected $_count_string = 'SELECT COUNT(1) AS '; - // if we use a limit, we will add a field that will - // throw off num_fields later - public $limit_used; + // -------------------------------------------------------------------- /** - * Constructor + * Class constructor * * @param array $params * @return void @@ -208,7 +250,7 @@ class CI_DB_oci8_driver extends CI_DB { /** * Execute the query * - * @param string an SQL query + * @param string $sql an SQL query * @return resource */ protected function _execute($sql) @@ -227,7 +269,7 @@ class CI_DB_oci8_driver extends CI_DB { /** * Generate a statement ID * - * @param string an SQL query + * @param string $sql an SQL query * @return void */ protected function _set_stmt_id($sql) @@ -307,7 +349,7 @@ class CI_DB_oci8_driver extends CI_DB { /** * Bind parameters * - * @param array + * @param array $params * @return void */ protected function _bind_params($params) @@ -336,7 +378,7 @@ class CI_DB_oci8_driver extends CI_DB { /** * Begin Transaction * - * @param bool + * @param bool $test_mode * @return bool */ public function trans_begin($test_mode = FALSE) @@ -409,8 +451,8 @@ class CI_DB_oci8_driver extends CI_DB { /** * Escape String * - * @param string - * @param bool whether or not the string will be used in a LIKE condition + * @param string $str + * @param bool $like Whether or not the string will be used in a LIKE condition * @return string */ public function escape_str($str, $like = FALSE) @@ -470,7 +512,7 @@ class CI_DB_oci8_driver extends CI_DB { * * Generates a platform-specific query string so that the table names can be fetched * - * @param bool + * @param bool $prefix_limit * @return string */ protected function _list_tables($prefix_limit = FALSE) @@ -493,7 +535,7 @@ class CI_DB_oci8_driver extends CI_DB { * * Generates a platform-specific query string so that the column names can be fetched * - * @param string the table name + * @param string $table * @return string */ protected function _list_columns($table = '') @@ -508,7 +550,7 @@ class CI_DB_oci8_driver extends CI_DB { * * Generates a platform-specific query so that the column data can be retrieved * - * @param string the table name + * @param string $table * @return string */ protected function _field_data($table) @@ -554,9 +596,9 @@ class CI_DB_oci8_driver extends CI_DB { * * Generates a platform-specific insert string from the supplied data * - * @param string the table name - * @param array the insert keys - * @param array the insert values + * @param string $table Table name + * @param array $keys INSERT keys + * @param array $values INSERT values * @return string */ protected function _insert_batch($table, $keys, $values) @@ -579,10 +621,10 @@ class CI_DB_oci8_driver extends CI_DB { * * Generates a platform-specific truncate string from the supplied data * - * If the database does not support the truncate() command, + * If the database does not support the TRUNCATE statement, * then this method maps to 'DELETE FROM table' * - * @param string the table name + * @param string $table * @return string */ protected function _truncate($table) @@ -597,7 +639,7 @@ class CI_DB_oci8_driver extends CI_DB { * * Generates a platform-specific delete string from the supplied data * - * @param string the table name + * @param string $table * @return string */ protected function _delete($table) @@ -614,11 +656,11 @@ class CI_DB_oci8_driver extends CI_DB { // -------------------------------------------------------------------- /** - * Limit string + * LIMIT * * Generates a platform-specific LIMIT clause * - * @param string the sql query string + * @param string $sql SQL Query * @return string */ protected function _limit($sql) -- cgit v1.2.3-24-g4f1b From 2b73037e450859e85fb468ad7499a26882a67292 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 5 Nov 2012 17:01:11 +0200 Subject: Fix DB drivers version() implementations that don't execute a query Fails if called prior to the DB connection initialization. --- system/database/drivers/oci8/oci8_driver.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'system/database/drivers/oci8/oci8_driver.php') diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 38d2395b6..b2663e2c5 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -240,9 +240,21 @@ class CI_DB_oci8_driver extends CI_DB { */ public function version() { - return isset($this->data_cache['version']) - ? $this->data_cache['version'] - : $this->data_cache['version'] = oci_server_version($this->conn_id); + if (isset($this->data_cache['version'])) + { + return $this->data_cache['version']; + } + elseif ( ! $this->conn_id) + { + $this->initialize(); + } + + if ( ! $this->conn_id OR ($version = oci_server_version($this->conn_id)) === FALSE) + { + return FALSE; + } + + return $this->data_cache['version'] = $version; } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 083e3c8d39a4fb9f8ef37f61f0ea42ec3fe1389f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 6 Nov 2012 12:48:32 +0200 Subject: Fix #589 --- system/database/drivers/oci8/oci8_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/oci8/oci8_driver.php') diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index b2663e2c5..eb01dd17e 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -604,7 +604,7 @@ class CI_DB_oci8_driver extends CI_DB { // -------------------------------------------------------------------- /** - * Insert_batch statement + * Insert batch statement * * Generates a platform-specific insert string from the supplied data * -- cgit v1.2.3-24-g4f1b