blob: 4ab2bb1d1f7efa28362962969f5dd1c3f88c0ee0 [file] [log] [blame]
Derek Allardd2df9bc2007-04-15 17:41:17 +00001<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
2/**
3 * CodeIgniter
4 *
5 * An open source application development framework for PHP 4.3.2 or newer
6 *
7 * @package CodeIgniter
Derek Allard3d879d52008-01-18 19:41:32 +00008 * @author ExpressionEngine Dev Team
Derek Allardd2df9bc2007-04-15 17:41:17 +00009 * @copyright Copyright (c) 2006, EllisLab, Inc.
Derek Jones7a9193a2008-01-21 18:39:20 +000010 * @license http://codeigniter.com/user_guide/license.html
11 * @link http://codeigniter.com
Derek Allardd2df9bc2007-04-15 17:41:17 +000012 * @since Version 1.0
13 * @filesource
14 */
15
16// ------------------------------------------------------------------------
17
18/**
19 * MySQLi Utility Class
20 *
21 * @category Database
Derek Allard3d879d52008-01-18 19:41:32 +000022 * @author ExpressionEngine Dev Team
Derek Jones7a9193a2008-01-21 18:39:20 +000023 * @link http://codeigniter.com/user_guide/database/
Derek Allardd2df9bc2007-04-15 17:41:17 +000024 */
25class CI_DB_mysqli_utility extends CI_DB_utility {
26
27 /**
Derek Allardd2df9bc2007-04-15 17:41:17 +000028 * List databases
29 *
30 * @access private
31 * @return bool
32 */
33 function _list_databases()
34 {
35 return "SHOW DATABASES";
36 }
37
38 // --------------------------------------------------------------------
39
40 /**
41 * Optimize table query
42 *
43 * Generates a platform-specific query so that a table can be optimized
44 *
45 * @access private
46 * @param string the table name
47 * @return object
48 */
49 function _optimize_table($table)
50 {
51 return "OPTIMIZE TABLE ".$this->db->_escape_table($table);
52 }
53
54 // --------------------------------------------------------------------
55
56 /**
57 * Repair table query
58 *
59 * Generates a platform-specific query so that a table can be repaired
60 *
61 * @access private
62 * @param string the table name
63 * @return object
64 */
65 function _repair_table($table)
66 {
67 return "REPAIR TABLE ".$this->db->_escape_table($table);
68 }
69
70 // --------------------------------------------------------------------
71
72 /**
73 * MySQLi Export
74 *
75 * @access private
76 * @param array Preferences
77 * @return mixed
78 */
79 function _backup($params = array())
80 {
Derek Allard11c75ea2008-01-29 19:35:31 +000081 // Currently unsupported
82 return $this->db->display_error('db_unsuported_feature');
Derek Allardd2df9bc2007-04-15 17:41:17 +000083 }
84
Derek Allard11c75ea2008-01-29 19:35:31 +000085
Derek Allard39b622d2008-01-16 21:10:09 +000086 /**
87 *
88 * The functions below have been deprecated as of 1.6, and are only here for backwards
89 * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation
90 * is STRONGLY discouraged in favour if using dbforge.
91 *
92 */
Derek Allardd2df9bc2007-04-15 17:41:17 +000093
Derek Allard39b622d2008-01-16 21:10:09 +000094 /**
95 * Create database
96 *
97 * @access private
98 * @param string the database name
99 * @return bool
100 */
101 function _create_database($name)
102 {
103 return "CREATE DATABASE ".$name;
104 }
105
106 // --------------------------------------------------------------------
107
108 /**
109 * Drop database
110 *
111 * @access private
112 * @param string the database name
113 * @return bool
114 */
115 function _drop_database($name)
116 {
117 return "DROP DATABASE ".$name;
118 }
Derek Allardd2df9bc2007-04-15 17:41:17 +0000119
120}
admin7b613c72006-09-24 18:05:17 +0000121?>