MDB2_Schema
[ class tree: MDB2_Schema ] [ index: MDB2_Schema ] [ all elements ]

Class: MDB2_Schema_Tool

Source Location: /MDB2_Schema-0.8.2/MDB2/Schema/Tool.php

Class Overview


Command line tool to work with database schemas


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 66]
Command line tool to work with database schemas

Functionality:

  • dump a database schema to stdout
  • import schema into database
  • create a diff between two schemas
  • apply diff to database



[ Top ]


Method Detail

__construct (Constructor)   [line 73]

MDB2_Schema_Tool __construct( array $args)

Run the schema tool
  • Access: public

Parameters:

array   $args     Array of command line arguments

[ Top ]

doDump   [line 379]

void doDump( array $args)

Creates a database schema dump and sends it to stdout
  • Access: protected

Parameters:

array   $args     Command line arguments

[ Top ]

doHelp   [line 165]

void doHelp( )

Displays generic help to stdout
  • Access: protected

[ Top ]

doHelpDump   [line 189]

void doHelpDump( )

Displays the help screen for "dump" command
  • Access: protected

[ Top ]

doHelpLoad   [line 212]

void doHelpLoad( )

Displays the help screen for "load" command
  • Access: protected

[ Top ]

doLoad   [line 418]

void doLoad( array $args)

Loads a database schema
  • Access: protected

Parameters:

array   $args     Command line arguments

[ Top ]

getAction   [line 112]

string getAction( array &$args)

Reads the first parameter from the argument array and returns the action.
  • Return: Action to execute
  • Access: protected

Parameters:

array   &$args     Command line parameters

[ Top ]

getFileOrDsn   [line 284]

array getFileOrDsn( array &$args)

Loads a file or a dsn from the arguments
  • Return: Array of ('file'|'dsn', $value)
  • Access: protected

Parameters:

array   &$args     Array of arguments to the program

[ Top ]

getSchemaOptions   [line 239]

array getSchemaOptions( )

Returns an array of options for MDB2_Schema constructor
  • Return: Options for MDB2_Schema constructor
  • Access: protected

[ Top ]

readPasswordFromStdin   [line 353]

string readPasswordFromStdin( string $dsn)

Reads a password from stdin
  • Return: Password
  • Access: protected

Parameters:

string   $dsn     DSN name to put into the message

[ Top ]

run   [line 90]

void run( )

Runs the tool with command line arguments
  • Access: public

[ Top ]

setPasswordIntoDsn   [line 327]

string setPasswordIntoDsn( string $dsn, string $password)

Takes a DSN data source name and integrates the given password into it.
  • Return: DSN with password
  • Access: protected

Parameters:

string   $dsn     Data source name
string   $password     Password

[ Top ]

throwExceptionOnError   [line 263]

void throwExceptionOnError( mixed $object, [string $location = ''])

Checks if the passed parameter is a PEAR_Error object and throws an exception in that case.
  • Access: protected

Parameters:

mixed   $object     Some variable to check
string   $location     Where the error occured

[ Top ]

toStdErr   [line 153]

void toStdErr( string $msg)

Writes the message to stderr
  • Access: protected

Parameters:

string   $msg     Message to print

[ Top ]


Documentation generated on Sat, 23 Feb 2008 00:30:24 -0500 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.