From 39b622db9bda38282a32bb45623da63efe685729 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 16 Jan 2008 21:10:09 +0000 Subject: Many new Active Record functions, and another whack of stuff --- system/database/DB_utility.php | 79 +++--------------------------------------- 1 file changed, 5 insertions(+), 74 deletions(-) (limited to 'system/database/DB_utility.php') diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index e9caf9f3e..372c88f1f 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author Rick Ellis - * @copyright Copyright (c) 2006, pMachine, Inc. + * @copyright Copyright (c) 2006, EllisLab, Inc. * @license http://www.codeigniter.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 @@ -22,10 +22,10 @@ * @author Rick Ellis * @link http://www.codeigniter.com/user_guide/database/ */ -class CI_DB_utility { +class CI_DB_utility extends CI_DB_forge { var $db; - var $data_cache = array(); + var $data_cache = array(); /** * Constructor @@ -44,48 +44,6 @@ class CI_DB_utility { // -------------------------------------------------------------------- - /** - * Create database - * - * @access public - * @param string the database name - * @return bool - */ - function create_database($db_name) - { - $sql = $this->_create_database($db_name); - - if (is_bool($sql)) - { - return $sql; - } - - return $this->db->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access public - * @param string the database name - * @return bool - */ - function drop_database($db_name) - { - $sql = $this->_drop_database($db_name); - - if (is_bool($sql)) - { - return $sql; - } - - return $this->db->query($sql); - } - - // -------------------------------------------------------------------- - /** * List databases * @@ -129,7 +87,7 @@ class CI_DB_utility { if (is_bool($sql)) { - return $sql; + show_error('db_must_use_set'); } $query = $this->db->query($sql); @@ -180,13 +138,12 @@ class CI_DB_utility { // -------------------------------------------------------------------- /** - * Optimize Table + * Repair Table * * @access public * @param string the table name * @return bool */ - function repair_table($table_name) { $sql = $this->_repair_table($table_name); @@ -203,28 +160,7 @@ class CI_DB_utility { $res = $query->result_array(); return current($res); } - - // -------------------------------------------------------------------- - - /** - * Drop Table - * - * @access public - * @param string the table name - * @return bool - */ - function drop_table($table_name) - { - $sql = $this->_drop_table($table_name); - - if (is_bool($sql)) - { - return $sql; - } - return $this->db->query($sql); - } - // -------------------------------------------------------------------- /** @@ -445,11 +381,6 @@ class CI_DB_utility { } - - - - - } ?> \ No newline at end of file -- cgit v1.2.3-24-g4f1b