Class DatabaseSchemaGenerator

Description

Takes database config info and generates a schema (a collection of databases each containing a collection of tables each containing a collection of columns)

  • author: Anthony Bush

Located in /schema_generator/database/DatabaseSchemaGenerator.class.php (line 10)

SchemaGenerator
   |
   --DatabaseSchemaGenerator
Variable Summary
Method Summary
void __construct ([mixed $config = array()])
void disableVerbose ()
void enableVerbose ()
void generateSchema ()
void initConfig ( $config)
void loadDrivers (string $path, string $classPrefix)
void loadSchema ()
void setSchema ( $schema)
Variables
DatabaseSchemaGeneratorConfig $config = null (line 17)

Configuration object for this class

  • access: protected
string $hasLoadedBaseDrivers = false (line 32)

Keep track of whether or not the base database drivers have been loaded.

(we'll load them on-the-fly only if needed)

  • access: protected
Schema $schema = null (line 24)

Schema object (mostly likely an instanceof Schema)

  • access: protected
boolean $verbose = false (line 39)

Whether or not to echo what's happening to the screen.

  • access: protected
Methods
Constructor __construct (line 47)

Construct with optional configuration parameters.

  • access: public
void __construct ([mixed $config = array()])
  • mixed $config: - either an array of configuration variables or a pre-constructed DatabaseSchemaGeneratorConfig object.
disableVerbose (line 194)

Disable verbose mode

void disableVerbose ()
enableVerbose (line 184)

Enable verbose mode

void enableVerbose ()
generateSchema (line 168)

Traverse all the databases, tables, and columns to build a schema, which basically contains the same information with the addition of relationships between tables.

  • author: Anthony Bush
  • access: public
void generateSchema ()

Redefinition of:
SchemaGenerator::generateSchema()
getSchema (line 203)

Get the Schema / DriverServer object.

  • access: public
Schema getSchema ()
initConfig (line 58)

Initialize the configuration object given an array or pre-constructed configuration object.

  • throws: Exception
  • access: public
void initConfig ( $config)
  • $config
loadDrivers (line 148)

Load database schema drivers for the specified path and driver prefix.

  • access: public
void loadDrivers (string $path, string $classPrefix)
  • string $path: - full path with trailing slash
  • string $classPrefix
loadSchema (line 78)

Loads the schema into memory according to the config (e.g. only includes databases and tables the config allows).

This function is mostly the first pass in schema generator. A good second pass would be to attempt to link any relationships not possible through FK detection. See linkRelationships().

  • access: public
void loadSchema ()
setSchema (line 212)

Set the Schema / DriverServer object.

  • access: public
void setSchema ( $schema)

Inherited Methods

Inherited From SchemaGenerator

SchemaGenerator::generateSchema()

Documentation generated on Wed, 12 Nov 2008 21:56:18 -0600 by phpDocumentor 1.4.0