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

Class: MDB2_Schema_Tool

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

Class Overview


Command line tool to work with database schemas


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 68]
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 75]

MDB2_Schema_Tool __construct( array $args)

Run the schema tool
  • Access: public

Parameters:

array   $args   —  Array of command line arguments

[ Top ]

doDump   [line 437]

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 179]

void doHelp( )

Displays generic help to stdout
  • Access: protected

[ Top ]

doHelpDump   [line 206]

void doHelpDump( )

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

[ Top ]

doHelpInit   [line 234]

void doHelpInit( )

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

[ Top ]

doHelpLoad   [line 264]

void doHelpLoad( )

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

[ Top ]

doInit   [line 549]

void doInit( array $args)

Initializes a database with data
  • Access: protected

Parameters:

array   $args   —  Command line arguments

[ Top ]

doLoad   [line 495]

void doLoad( array $args)

Loads a database schema
  • Access: protected

Parameters:

array   $args   —  Command line arguments

[ Top ]

getAction   [line 114]

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 340]

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 294]

array getSchemaOptions( )

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

[ Top ]

readPasswordFromStdin   [line 411]

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 92]

void run( )

Runs the tool with command line arguments
  • Access: public

[ Top ]

setPasswordIntoDsn   [line 385]

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 319]

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 167]

void toStdErr( string $msg)

Writes the message to stderr
  • Access: protected

Parameters:

string   $msg   —  Message to print

[ Top ]


Documentation generated on Mon, 11 Mar 2019 16:04:24 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.