Source for file od-schema-defs.php

Documentation is available at od-schema-defs.php

  1. <?php
  2. /* ******************************************************************** */
  3. /* CATALYST PHP Source Code */
  4. /* -------------------------------------------------------------------- */
  5. /* This program is free software; you can redistribute it and/or modify */
  6. /* it under the terms of the GNU General Public License as published by */
  7. /* the Free Software Foundation; either version 2 of the License, or */
  8. /* (at your option) any later version. */
  9. /* */
  10. /* This program is distributed in the hope that it will be useful, */
  11. /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
  12. /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
  13. /* GNU General Public License for more details. */
  14. /* */
  15. /* You should have received a copy of the GNU General Public License */
  16. /* along with this program; if not, write to: */
  17. /* The Free Software Foundation, Inc., 59 Temple Place, Suite 330, */
  18. /* Boston, MA 02111-1307 USA */
  19. /* -------------------------------------------------------------------- */
  20. /* */
  21. /* Filename: od-schema-defs.php */
  22. /* Author: Paul Waite */
  23. /* Description: Definitions for managing ODBC DATABASE SCHEMAS. */
  24. /* */
  25. /* The main use of this class is to read in database info */
  26. /* for other utilities, such as table maintenance scripts. */
  27. /* */
  28. /* ******************************************************************** */
  29. /** @package database */
  30. include_once("schema-defs.php");
  31.  
  32. // ----------------------------------------------------------------------
  33. /** Defines a database sequence.
  34. * @package database
  35. */
  36. class DB_dbsequence extends dbsequence {
  37. // ....................................................................
  38. function DB_dbsequence(&$schema, $name) {
  39. $this->dbsequence($schema, $name);
  40. }
  41. // ....................................................................
  42. /** Get schema info for sequence */
  43.  
  44. function getschema() {
  45. }
  46. } // class DB_dbsequence
  47. // ----------------------------------------------------------------------
  48.  
  49. /** Defines a database function (procedure).
  50. * @package database
  51. */
  52. class DB_dbfunction extends dbfunction {
  53. // ....................................................................
  54. function DB_dbfunction(&$schema, $name, $returns="", $src="", $args="", $lang="") {
  55. $this->dbfunction($schema, $name, $returns, $src, $args, $lang);
  56. }
  57. // ....................................................................
  58. /** Obtain function schema information. */
  59.  
  60. function getschema() {
  61. }
  62. } // class DB_dbfunction
  63. // ----------------------------------------------------------------------
  64.  
  65. /** Defines a database index.
  66. * @package database
  67. */
  68. class DB_dbindex extends dbindex {
  69. // ....................................................................
  70. function DB_dbindex(&$schema, $name, $tablename, $flds="", $primary=false, $unique=false) {
  71. $this->dbindex($schema, $name, $tablename, $flds, $primary, $unique);
  72. }
  73. // ....................................................................
  74. /** Obtain index schema information.
  75. */
  76. function getschema() {
  77. }
  78. } // class DB_dbindex
  79. // ----------------------------------------------------------------------
  80.  
  81. /** Defines a database constraint.
  82. * @package database
  83. */
  84. class DB_dbconstraint extends dbconstraint {
  85. // ....................................................................
  86. function DB_dbconstraint(&$schema, $name, $type="p", $table="", $fktable="", $flds="",
  87. $fkflds="", $updact="", $delact="", $match="", $cksrc="") {
  88. $this->dbconstraint($schema, $name, $type, $table, $fktable, $flds, $fkflds, $updact, $delact, $match, $cksrc);
  89. }
  90. // ....................................................................
  91. /** Obtain constraint schema information. */
  92.  
  93. function getschema() {
  94. }
  95. } // class DB_dbconstraint
  96. // ----------------------------------------------------------------------
  97.  
  98. /** Defines a database trigger.
  99. * @package database
  100. */
  101. class DB_dbtrigger extends dbtrigger {
  102. // ....................................................................
  103. function DB_dbtrigger(&$schema, $name, $bitmask=0, $table="", $funcname="", $args="") {
  104. $this->dbtrigger($schema, $name, $bitmask, $table, $funcname, $args);
  105. }
  106. // ....................................................................
  107. /** Obtain trigger schema information. */
  108.  
  109. function getschema() {
  110. }
  111. } // class DB_dbtrigger
  112. // ----------------------------------------------------------------------
  113.  
  114. /** Class describing a database field of a table.
  115. * @package database
  116. */
  117. class DB_dbfield extends dbfield {
  118. // ....................................................................
  119. function DB_dbfield(&$schema, $name, $num, $type, $defaultval="", $notnull=false, $ispkey=false) {
  120. $this->dbfield($schema, $name, $num, $type, $defaultval, $notnull, $ispkey);
  121. }
  122. } // class DB_dbfield
  123. // ----------------------------------------------------------------------
  124.  
  125. /** Class describing a database table. Inherits the standard
  126. * dbtable class properties and methods, but adds in the getschema
  127. * specifics for acquiring table info from the metadata for this DB, and
  128. * provides a specific create() method.
  129. * @package database
  130. */
  131. class DB_dbtable extends dbtable {
  132. // ....................................................................
  133. /** Construct a table of given name and array of primary key fields.
  134. * @param string $name The name of the table
  135. * @param integer $dbversion Optional database version information
  136. */
  137. function DB_dbtable(&$schema, $name) {
  138. $this->dbtable($schema, $name);
  139. }
  140. // ....................................................................
  141. /**
  142. * Acquires the table fields and constraints which apply to it.
  143. * NB: This function is apt for this DB. Over-ride for other db types
  144. * @param mixed $schema Schema this table is in, or false if n/a
  145. */
  146. function getschema($mode=ALL) {
  147. }
  148. } // class DB_dbtable
  149. // ----------------------------------------------------------------------
  150.  
  151. /**
  152. * Class describing a database schema.
  153. * @package database
  154. */
  155. class DB_schema extends schema {
  156. // ....................................................................
  157. /**
  158. * Create a schema (database) of given name. The name should be a
  159. * valid existing database name that is currently connected.
  160. * @param string $name Name of this particular database
  161. */
  162. function DB_schema($name) {
  163. $this->schema($name, "ODBC");
  164. }
  165. // ....................................................................
  166. /**
  167. * Populates our array of tables with all tables in this schema.
  168. */
  169. function gettables() {
  170. }
  171. // ....................................................................
  172. /**
  173. * Populates our array of triggers with all user triggers in this schema.
  174. */
  175. function gettriggers() {
  176. }
  177. // ....................................................................
  178. /**
  179. * Populates our array of functions with all user functions in this schema.
  180. */
  181. function getfunctions() {
  182. }
  183. // ....................................................................
  184. /**
  185. * Populates our array of sequences with all user sequences in this schema.
  186. */
  187. function getsequences() {
  188. }
  189. // ....................................................................
  190. /** Acquire the database server version. */
  191.  
  192. function getversion() {
  193. $vstr = 1.0;
  194. $this->set_dbversion( (float) $vstr );
  195. debugbr("$this->database_server version detection", DBG_DEBUG);
  196. debugbr("database version set to $this->database_version", DBG_DEBUG);
  197. return $this->database_version;
  198. }
  199. } // class DB_schema
  200. // ----------------------------------------------------------------------
  201.  
  202. ?>

Documentation generated by phpDocumentor 1.3.0RC3