Derek Jones | 0b59f27 | 2008-05-13 04:22:33 +0000 | [diff] [blame^] | 1 | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
Derek Allard | d2df9bc | 2007-04-15 17:41:17 +0000 | [diff] [blame] | 2 | /**
|
| 3 | * CodeIgniter
|
| 4 | *
|
| 5 | * An open source application development framework for PHP 4.3.2 or newer
|
| 6 | *
|
| 7 | * @package CodeIgniter
|
Derek Allard | 3d879d5 | 2008-01-18 19:41:32 +0000 | [diff] [blame] | 8 | * @author ExpressionEngine Dev Team
|
Derek Allard | d2df9bc | 2007-04-15 17:41:17 +0000 | [diff] [blame] | 9 | * @copyright Copyright (c) 2006, EllisLab, Inc.
|
Derek Jones | 7a9193a | 2008-01-21 18:39:20 +0000 | [diff] [blame] | 10 | * @license http://codeigniter.com/user_guide/license.html
|
| 11 | * @link http://codeigniter.com
|
Derek Allard | d2df9bc | 2007-04-15 17:41:17 +0000 | [diff] [blame] | 12 | * @since Version 1.0
|
| 13 | * @filesource
|
| 14 | */
|
| 15 |
|
| 16 | // ------------------------------------------------------------------------
|
| 17 |
|
| 18 | /**
|
| 19 | * ODBC Utility Class
|
| 20 | *
|
| 21 | * @category Database
|
Derek Allard | 3d879d5 | 2008-01-18 19:41:32 +0000 | [diff] [blame] | 22 | * @author ExpressionEngine Dev Team
|
Derek Jones | 7a9193a | 2008-01-21 18:39:20 +0000 | [diff] [blame] | 23 | * @link http://codeigniter.com/database/
|
Derek Allard | d2df9bc | 2007-04-15 17:41:17 +0000 | [diff] [blame] | 24 | */
|
| 25 | class CI_DB_odbc_utility extends CI_DB_utility {
|
| 26 |
|
Derek Allard | d2df9bc | 2007-04-15 17:41:17 +0000 | [diff] [blame] | 27 | /**
|
| 28 | * List databases
|
| 29 | *
|
| 30 | * @access private
|
| 31 | * @return bool
|
| 32 | */
|
| 33 | function _list_databases()
|
| 34 | {
|
| 35 | // Not sure if ODBC lets you list all databases...
|
| 36 | if ($this->db->db_debug)
|
| 37 | {
|
| 38 | return $this->db->display_error('db_unsuported_feature');
|
| 39 | }
|
| 40 | return FALSE;
|
| 41 | }
|
| 42 |
|
| 43 | // --------------------------------------------------------------------
|
| 44 |
|
| 45 | /**
|
Derek Allard | d2df9bc | 2007-04-15 17:41:17 +0000 | [diff] [blame] | 46 | * Optimize table query
|
| 47 | *
|
| 48 | * Generates a platform-specific query so that a table can be optimized
|
| 49 | *
|
| 50 | * @access private
|
| 51 | * @param string the table name
|
| 52 | * @return object
|
| 53 | */
|
| 54 | function _optimize_table($table)
|
| 55 | {
|
| 56 | // Not a supported ODBC feature
|
| 57 | if ($this->db->db_debug)
|
| 58 | {
|
| 59 | return $this->db->display_error('db_unsuported_feature');
|
| 60 | }
|
| 61 | return FALSE;
|
| 62 | }
|
| 63 |
|
| 64 | // --------------------------------------------------------------------
|
| 65 |
|
| 66 | /**
|
| 67 | * Repair table query
|
| 68 | *
|
| 69 | * Generates a platform-specific query so that a table can be repaired
|
| 70 | *
|
| 71 | * @access private
|
| 72 | * @param string the table name
|
| 73 | * @return object
|
| 74 | */
|
| 75 | function _repair_table($table)
|
| 76 | {
|
| 77 | // Not a supported ODBC feature
|
| 78 | if ($this->db->db_debug)
|
| 79 | {
|
| 80 | return $this->db->display_error('db_unsuported_feature');
|
| 81 | }
|
| 82 | return FALSE;
|
| 83 | }
|
| 84 |
|
| 85 | // --------------------------------------------------------------------
|
| 86 |
|
| 87 | /**
|
| 88 | * ODBC Export
|
| 89 | *
|
| 90 | * @access private
|
| 91 | * @param array Preferences
|
| 92 | * @return mixed
|
| 93 | */
|
| 94 | function _backup($params = array())
|
| 95 | {
|
| 96 | // Currently unsupported
|
| 97 | return $this->db->display_error('db_unsuported_feature');
|
| 98 | }
|
Derek Allard | 39b622d | 2008-01-16 21:10:09 +0000 | [diff] [blame] | 99 |
|
| 100 | /**
|
| 101 | *
|
| 102 | * The functions below have been deprecated as of 1.6, and are only here for backwards
|
| 103 | * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation
|
| 104 | * is STRONGLY discouraged in favour if using dbforge.
|
| 105 | *
|
| 106 | */
|
Derek Allard | d2df9bc | 2007-04-15 17:41:17 +0000 | [diff] [blame] | 107 |
|
Derek Allard | 39b622d | 2008-01-16 21:10:09 +0000 | [diff] [blame] | 108 | /**
|
| 109 | * Create database
|
| 110 | *
|
| 111 | * @access private
|
| 112 | * @param string the database name
|
| 113 | * @return bool
|
| 114 | */
|
| 115 | function _create_database()
|
| 116 | {
|
| 117 | // ODBC has no "create database" command since it's
|
| 118 | // designed to connect to an existing database
|
| 119 | if ($this->db->db_debug)
|
| 120 | {
|
| 121 | return $this->db->display_error('db_unsuported_feature');
|
| 122 | }
|
| 123 | return FALSE;
|
| 124 | }
|
| 125 |
|
| 126 | // --------------------------------------------------------------------
|
| 127 |
|
| 128 | /**
|
| 129 | * Drop database
|
| 130 | *
|
| 131 | * @access private
|
| 132 | * @param string the database name
|
| 133 | * @return bool
|
| 134 | */
|
| 135 | function _drop_database($name)
|
| 136 | {
|
| 137 | // ODBC has no "drop database" command since it's
|
| 138 | // designed to connect to an existing database
|
| 139 | if ($this->db->db_debug)
|
| 140 | {
|
| 141 | return $this->db->display_error('db_unsuported_feature');
|
| 142 | }
|
| 143 | return FALSE;
|
| 144 | }
|
Derek Allard | d2df9bc | 2007-04-15 17:41:17 +0000 | [diff] [blame] | 145 | }
|
Derek Jones | 0b59f27 | 2008-05-13 04:22:33 +0000 | [diff] [blame^] | 146 |
|
| 147 | /* End of file odbc_utility.php */
|
Derek Jones | a3ffbbb | 2008-05-11 18:18:29 +0000 | [diff] [blame] | 148 | /* Location: ./system/database/drivers/odbc/odbc_utility.php */ |