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/DB_utility.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'system/database/DB_utility.php') diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index 8078e2bf6..12680be5f 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -1,4 +1,4 @@ - Date: Fri, 2 Nov 2012 01:42:31 +0200 Subject: DocBlocks for base DB classes Partially fixes issue #1295. --- system/database/DB_utility.php | 44 ++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) (limited to 'system/database/DB_utility.php') diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index 12680be5f..3bd77c84b 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -35,13 +35,31 @@ defined('BASEPATH') OR exit('No direct script access allowed'); */ abstract class CI_DB_utility extends CI_DB_forge { + /** + * Database object + * + * @var object + */ public $db; - // Platform specific SQL strings - // Just setting those defaults to FALSE as they are mostly MySQL-specific + // -------------------------------------------------------------------- + + /** + * OPTIMIZE TABLE statement + * + * @var string|bool + */ protected $_optimize_table = FALSE; + + /** + * REPAIR TABLE statement + * + * @var string|bool + */ protected $_repair_table = FALSE; + // -------------------------------------------------------------------- + /** * Constructor * @@ -95,7 +113,7 @@ abstract class CI_DB_utility extends CI_DB_forge { /** * Determine if a particular database exists * - * @param string + * @param string $database_name * @return bool */ public function database_exists($database_name) @@ -108,7 +126,7 @@ abstract class CI_DB_utility extends CI_DB_forge { /** * Optimize Table * - * @param string the table name + * @param string $table_name * @return mixed */ public function optimize_table($table_name) @@ -169,7 +187,7 @@ abstract class CI_DB_utility extends CI_DB_forge { /** * Repair Table * - * @param string the table name + * @param string $table_name * @return mixed */ public function repair_table($table_name) @@ -194,10 +212,10 @@ abstract class CI_DB_utility extends CI_DB_forge { /** * Generate CSV from a query result object * - * @param object The query result object - * @param string The delimiter - comma by default - * @param string The newline character - \n by default - * @param string The enclosure - double quote by default + * @param object $query Query result object + * @param string $delim Delimiter (default: ,) + * @param string $newline Newline character (default: \n) + * @param string $enclosure Enclosure (default: ") * @return string */ public function csv_from_result($query, $delim = ',', $newline = "\n", $enclosure = '"') @@ -234,8 +252,8 @@ abstract class CI_DB_utility extends CI_DB_forge { /** * Generate XML data from a query result object * - * @param object The query result object - * @param array Any preferences + * @param object $query Query result object + * @param array $params Any preferences * @return string */ public function xml_from_result($query, $params = array()) @@ -281,7 +299,7 @@ abstract class CI_DB_utility extends CI_DB_forge { /** * Database Backup * - * @param array $params = array() + * @param array $params * @return void */ public function backup($params = array()) @@ -294,8 +312,6 @@ abstract class CI_DB_utility extends CI_DB_forge { $params = array('tables' => $params); } - // ------------------------------------------------------ - // Set up our default preferences $prefs = array( 'tables' => array(), -- cgit v1.2.3-24-g4f1b From c98e93aab3997bfea4fbb9d07f7b2550a84f8f7a Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 2 Nov 2012 02:04:59 +0200 Subject: [ci skip] DocBlocks for DB drivers' utility classes Partially fixes issue #1295. --- system/database/DB_utility.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'system/database/DB_utility.php') diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index 3bd77c84b..31102c0c6 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -44,24 +44,31 @@ abstract class CI_DB_utility extends CI_DB_forge { // -------------------------------------------------------------------- + /** + * List databases statement + * + * @var string + */ + $_list_databases = FALSE; + /** * OPTIMIZE TABLE statement * - * @var string|bool + * @var string */ protected $_optimize_table = FALSE; /** * REPAIR TABLE statement * - * @var string|bool + * @var string */ protected $_repair_table = FALSE; // -------------------------------------------------------------------- /** - * Constructor + * Class constructor * * @return void */ -- cgit v1.2.3-24-g4f1b From a24e52e1c0136db0c1949e73255b4e9bf114b437 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 2 Nov 2012 03:54:12 +0200 Subject: [ci skip] DocBlocks for DB drivers' driver classes Partially fixes issue #1295. --- system/database/DB_utility.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/DB_utility.php') diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index 31102c0c6..f7bef6a2c 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -49,7 +49,7 @@ abstract class CI_DB_utility extends CI_DB_forge { * * @var string */ - $_list_databases = FALSE; + protected $_list_databases = FALSE; /** * OPTIMIZE TABLE statement -- cgit v1.2.3-24-g4f1b From eaa60c71082c1e49f8a48d633347c98b68a387c0 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 6 Nov 2012 01:11:22 +0200 Subject: Added possibility to pass custom database objects to DB Forge and DB Utilities Also, their property is no longer public and the utility class no longer extends CI_DB_forge. --- system/database/DB_utility.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'system/database/DB_utility.php') diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index f7bef6a2c..a8e34c92d 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -33,14 +33,14 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ -abstract class CI_DB_utility extends CI_DB_forge { +abstract class CI_DB_utility { /** * Database object * * @var object */ - public $db; + protected $db; // -------------------------------------------------------------------- @@ -70,13 +70,12 @@ abstract class CI_DB_utility extends CI_DB_forge { /** * Class constructor * + * @param object &$db Database object * @return void */ - public function __construct() + public function __construct(&$db) { - // Assign the main database object to $this->db - $CI =& get_instance(); - $this->db =& $CI->db; + $this->db =& $db; log_message('debug', 'Database Utility Class Initialized'); } -- cgit v1.2.3-24-g4f1b From 8d3afde93f9ff7f461095d5b9147b662610c045b Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 6 Nov 2012 12:53:47 +0200 Subject: Fix a lang key typo --- system/database/DB_utility.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'system/database/DB_utility.php') diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index a8e34c92d..488ebf3ac 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -95,7 +95,7 @@ abstract class CI_DB_utility { } elseif ($this->_list_databases === FALSE) { - return ($this->db->db_debug) ? $this->db->display_error('db_unsuported_feature') : FALSE; + return ($this->db->db_debug) ? $this->db->display_error('db_unsupported_feature') : FALSE; } $this->db->data_cache['db_names'] = array(); @@ -139,7 +139,7 @@ abstract class CI_DB_utility { { if ($this->_optimize_table === FALSE) { - return ($this->db->db_debug) ? $this->db->display_error('db_unsuported_feature') : FALSE; + return ($this->db->db_debug) ? $this->db->display_error('db_unsupported_feature') : FALSE; } $query = $this->db->query(sprintf($this->_optimize_table, $this->db->escape_identifiers($table_name))); @@ -163,7 +163,7 @@ abstract class CI_DB_utility { { if ($this->_optimize_table === FALSE) { - return ($this->db->db_debug) ? $this->db->display_error('db_unsuported_feature') : FALSE; + return ($this->db->db_debug) ? $this->db->display_error('db_unsupported_feature') : FALSE; } $result = array(); @@ -200,7 +200,7 @@ abstract class CI_DB_utility { { if ($this->_repair_table === FALSE) { - return ($this->db->db_debug) ? $this->db->display_error('db_unsuported_feature') : FALSE; + return ($this->db->db_debug) ? $this->db->display_error('db_unsupported_feature') : FALSE; } $query = $this->db->query(sprintf($this->_repair_table, $this->db->escape_identifiers($table_name))); @@ -361,7 +361,7 @@ abstract class CI_DB_utility { { if ($this->db->db_debug) { - return $this->db->display_error('db_unsuported_compression'); + return $this->db->display_error('db_unsupported_compression'); } $prefs['format'] = 'txt'; -- cgit v1.2.3-24-g4f1b