/halogy/database/drivers/odbc/odbc_utility.php

https://bitbucket.org/haloweb/halogy-1.0/ · PHP · 148 lines · 47 code · 14 blank · 87 comment · 6 complexity · bf97b0965166b80e58919140f34f6578 MD5 · raw file

  1. <?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
  8. * @author ExpressionEngine Dev Team
  9. * @copyright Copyright (c) 2008 - 2009, EllisLab, Inc.
  10. * @license http://codeigniter.com/user_guide/license.html
  11. * @link http://codeigniter.com
  12. * @since Version 1.0
  13. * @filesource
  14. */
  15. // ------------------------------------------------------------------------
  16. /**
  17. * ODBC Utility Class
  18. *
  19. * @category Database
  20. * @author ExpressionEngine Dev Team
  21. * @link http://codeigniter.com/database/
  22. */
  23. class CI_DB_odbc_utility extends CI_DB_utility {
  24. /**
  25. * List databases
  26. *
  27. * @access private
  28. * @return bool
  29. */
  30. function _list_databases()
  31. {
  32. // Not sure if ODBC lets you list all databases...
  33. if ($this->db->db_debug)
  34. {
  35. return $this->db->display_error('db_unsuported_feature');
  36. }
  37. return FALSE;
  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. // Not a supported ODBC feature
  52. if ($this->db->db_debug)
  53. {
  54. return $this->db->display_error('db_unsuported_feature');
  55. }
  56. return FALSE;
  57. }
  58. // --------------------------------------------------------------------
  59. /**
  60. * Repair table query
  61. *
  62. * Generates a platform-specific query so that a table can be repaired
  63. *
  64. * @access private
  65. * @param string the table name
  66. * @return object
  67. */
  68. function _repair_table($table)
  69. {
  70. // Not a supported ODBC feature
  71. if ($this->db->db_debug)
  72. {
  73. return $this->db->display_error('db_unsuported_feature');
  74. }
  75. return FALSE;
  76. }
  77. // --------------------------------------------------------------------
  78. /**
  79. * ODBC Export
  80. *
  81. * @access private
  82. * @param array Preferences
  83. * @return mixed
  84. */
  85. function _backup($params = array())
  86. {
  87. // Currently unsupported
  88. return $this->db->display_error('db_unsuported_feature');
  89. }
  90. /**
  91. *
  92. * The functions below have been deprecated as of 1.6, and are only here for backwards
  93. * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation
  94. * is STRONGLY discouraged in favour if using dbforge.
  95. *
  96. */
  97. /**
  98. * Create database
  99. *
  100. * @access private
  101. * @param string the database name
  102. * @return bool
  103. */
  104. function _create_database()
  105. {
  106. // ODBC has no "create database" command since it's
  107. // designed to connect to an existing database
  108. if ($this->db->db_debug)
  109. {
  110. return $this->db->display_error('db_unsuported_feature');
  111. }
  112. return FALSE;
  113. }
  114. // --------------------------------------------------------------------
  115. /**
  116. * Drop database
  117. *
  118. * @access private
  119. * @param string the database name
  120. * @return bool
  121. */
  122. function _drop_database($name)
  123. {
  124. // ODBC has no "drop database" command since it's
  125. // designed to connect to an existing database
  126. if ($this->db->db_debug)
  127. {
  128. return $this->db->display_error('db_unsuported_feature');
  129. }
  130. return FALSE;
  131. }
  132. }
  133. /* End of file odbc_utility.php */
  134. /* Location: ./system/database/drivers/odbc/odbc_utility.php */