/halogy/database/drivers/mssql/mssql_utility.php

https://bitbucket.org/haloweb/halogy-1.0/ · PHP · 123 lines · 27 code · 16 blank · 80 comment · 1 complexity · 6e8c5faef57f093d7439ebc7681f2cfc 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. * MS SQL Utility Class
  18. *
  19. * @category Database
  20. * @author ExpressionEngine Dev Team
  21. * @link http://codeigniter.com/user_guide/database/
  22. */
  23. class CI_DB_mssql_utility extends CI_DB_utility {
  24. /**
  25. * List databases
  26. *
  27. * @access private
  28. * @return bool
  29. */
  30. function _list_databases()
  31. {
  32. return "EXEC sp_helpdb"; // Can also be: EXEC sp_databases
  33. }
  34. // --------------------------------------------------------------------
  35. /**
  36. * Optimize table query
  37. *
  38. * Generates a platform-specific query so that a table can be optimized
  39. *
  40. * @access private
  41. * @param string the table name
  42. * @return object
  43. */
  44. function _optimize_table($table)
  45. {
  46. return FALSE; // Is this supported in MS SQL?
  47. }
  48. // --------------------------------------------------------------------
  49. /**
  50. * Repair table query
  51. *
  52. * Generates a platform-specific query so that a table can be repaired
  53. *
  54. * @access private
  55. * @param string the table name
  56. * @return object
  57. */
  58. function _repair_table($table)
  59. {
  60. return FALSE; // Is this supported in MS SQL?
  61. }
  62. // --------------------------------------------------------------------
  63. /**
  64. * MSSQL Export
  65. *
  66. * @access private
  67. * @param array Preferences
  68. * @return mixed
  69. */
  70. function _backup($params = array())
  71. {
  72. // Currently unsupported
  73. return $this->db->display_error('db_unsuported_feature');
  74. }
  75. /**
  76. *
  77. * The functions below have been deprecated as of 1.6, and are only here for backwards
  78. * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation
  79. * is STRONGLY discouraged in favour if using dbforge.
  80. *
  81. */
  82. /**
  83. * Create database
  84. *
  85. * @access private
  86. * @param string the database name
  87. * @return bool
  88. */
  89. function _create_database($name)
  90. {
  91. return "CREATE DATABASE ".$name;
  92. }
  93. // --------------------------------------------------------------------
  94. /**
  95. * Drop database
  96. *
  97. * @access private
  98. * @param string the database name
  99. * @return bool
  100. */
  101. function _drop_database($name)
  102. {
  103. return "DROP DATABASE ".$name;
  104. }
  105. }
  106. /* End of file mssql_utility.php */
  107. /* Location: ./system/database/drivers/mssql/mssql_utility.php */