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/pdo/pdo_driver.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'system/database/drivers/pdo/pdo_driver.php') diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php index 32a9e7509..5fc3f67c5 100644 --- a/system/database/drivers/pdo/pdo_driver.php +++ b/system/database/drivers/pdo/pdo_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/pdo/pdo_driver.php | 55 ++++++++++++++++++------------ 1 file changed, 33 insertions(+), 22 deletions(-) (limited to 'system/database/drivers/pdo/pdo_driver.php') diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php index 5fc3f67c5..57a3c5c98 100644 --- a/system/database/drivers/pdo/pdo_driver.php +++ b/system/database/drivers/pdo/pdo_driver.php @@ -41,22 +41,33 @@ defined('BASEPATH') OR exit('No direct script access allowed'); */ class CI_DB_pdo_driver extends CI_DB { + /** + * Database driver + * + * @var string + */ public $dbdriver = 'pdo'; - // The character used to escaping - protected $_escape_char = '"'; - - protected $_random_keyword; - + /** + * Transaction enabled flag + * + * @var bool + */ public $trans_enabled = FALSE; - // need to track the PDO options + /** + * PDO Options + * + * @var array + */ public $options = array(); + // -------------------------------------------------------------------- + /** - * Constructor + * Class constructor * - * Validates the DSN string and/or detects the subdriver + * Validates the DSN string and/or detects the subdriver. * * @param array $params * @return void @@ -104,9 +115,9 @@ class CI_DB_pdo_driver extends CI_DB { // -------------------------------------------------------------------- /** - * Non-persistent database connection + * Database connection * - * @param bool + * @param bool $persistent * @return object */ public function db_connect($persistent = FALSE) @@ -171,7 +182,7 @@ class CI_DB_pdo_driver extends CI_DB { /** * Execute the query * - * @param string an SQL query + * @param string $sql SQL query * @return mixed */ protected function _execute($sql) @@ -184,7 +195,7 @@ class CI_DB_pdo_driver extends CI_DB { /** * Begin Transaction * - * @param bool $test_mode = FALSE + * @param bool $test_mode * @return bool */ public function trans_begin($test_mode = FALSE) @@ -244,8 +255,8 @@ class CI_DB_pdo_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) @@ -297,7 +308,7 @@ class CI_DB_pdo_driver extends CI_DB { /** * Insert ID * - * @param string + * @param string $name * @return int */ public function insert_id($name = NULL) @@ -312,7 +323,7 @@ class CI_DB_pdo_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) @@ -356,9 +367,9 @@ class CI_DB_pdo_driver extends CI_DB { * * Generates a platform-specific batch update string from the supplied data * - * @param string the table name - * @param array the update data - * @param string the where key + * @param string $table Table name + * @param array $values Update data + * @param string $index WHERE key * @return string */ protected function _update_batch($table, $values, $index) @@ -402,10 +413,10 @@ class CI_DB_pdo_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) @@ -416,4 +427,4 @@ class CI_DB_pdo_driver extends CI_DB { } /* End of file pdo_driver.php */ -/* Location: ./system/database/drivers/pdo/pdo_driver.php */ +/* Location: ./system/database/drivers/pdo/pdo_driver.php */ \ No newline at end of file -- 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/pdo/pdo_driver.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'system/database/drivers/pdo/pdo_driver.php') diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php index 57a3c5c98..923f0e125 100644 --- a/system/database/drivers/pdo/pdo_driver.php +++ b/system/database/drivers/pdo/pdo_driver.php @@ -165,6 +165,10 @@ class CI_DB_pdo_driver extends CI_DB { { return $this->data_cache['version']; } + elseif ( ! $this->conn_id) + { + $this->initialize(); + } // Not all subdrivers support the getAttribute() method try -- cgit v1.2.3-24-g4f1b