eZ Publish  [trunk]
ezsqldiff.php File Reference

Go to the source code of this file.

Functions

 loadDatabaseSchema ($type, $host, $user, $password, $socket, $db, $cli)
 loadLintSchema ($dbSchema, $cli)

Variables

 $cli = eZCLI::instance()
if(strlen(trim($sourceType))==0)
if(strlen(trim($matchType))==0) 
$ini = eZINI::instance()
 $matchDB = count( $options['arguments'] ) >= 2 ? $options['arguments'][1] : ''
 $matchDBHost = $options['match-host'] ? $options['match-host'] : $options['host']
 $matchDBPassword = $options['match-password'] ? $options['match-password'] : $options['password']
 $matchDBSocket = $options['match-socket'] ? $options['match-socket'] : $options['socket']
 $matchDBUser = $options['match-user'] ? $options['match-user'] : $options['user']
 $matchType = $options['match-type'] ? $options['match-type'] : $options['type']
 $options
 $script
 $sourceDB = $options['arguments'][0]
 $sourceDBHost = $options['source-host'] ? $options['source-host'] : $options['host']
 $sourceDBPassword = $options['source-password'] ? $options['source-password'] : $options['password']
 $sourceDBSocket = $options['source-socket'] ? $options['source-socket'] : $options['socket']
 $sourceDBUser = $options['source-user'] ? $options['source-user'] : $options['user']
 $sourceSchema = loadDatabaseSchema( $sourceType, $sourceDBHost, $sourceDBUser, $sourceDBPassword, $sourceDBSocket, $sourceDB, $cli )
if(count($options['arguments'])
< 1) if(count($options['arguments'])
< 2 and!$options['lint-check']) 
$sourceType = $options['source-type'] ? $options['source-type'] : $options['type']

Function Documentation

loadDatabaseSchema ( type,
host,
user,
password,
socket,
db,
cli 
)

Definition at line 105 of file ezsqldiff.php.

loadLintSchema ( dbSchema,
cli 
)

Definition at line 170 of file ezsqldiff.php.


Variable Documentation

$cli = eZCLI::instance()

Definition at line 14 of file ezsqldiff.php.

if (strlen(trim($sourceType))==0) if (strlen(trim($matchType))==0) $ini = eZINI::instance()

Definition at line 103 of file ezsqldiff.php.

$matchDB = count( $options['arguments'] ) >= 2 ? $options['arguments'][1] : ''

Definition at line 84 of file ezsqldiff.php.

$matchDBHost = $options['match-host'] ? $options['match-host'] : $options['host']

Definition at line 80 of file ezsqldiff.php.

$matchDBPassword = $options['match-password'] ? $options['match-password'] : $options['password']

Definition at line 82 of file ezsqldiff.php.

$matchDBSocket = $options['match-socket'] ? $options['match-socket'] : $options['socket']

Definition at line 83 of file ezsqldiff.php.

$matchDBUser = $options['match-user'] ? $options['match-user'] : $options['user']

Definition at line 81 of file ezsqldiff.php.

$matchType = $options['match-type'] ? $options['match-type'] : $options['type']
$options
Initial value:
 $script->getOptions( "[source-type:][source-host:][source-user:][source-password;][source-socket:]" .
                                "[match-type:][match-host:][match-user:][match-password;][match-socket:]" .
                                "[t:|type:][host:][u:|user:][p:|password;][socket:]" .
                                "[lint-check]" .
                                "[reverse][check-only]",
                                "[source][match]",
                                array( 'source-type' => ( "Which database type to use for source, can be one of:\n" .
                                                          "mysql, postgresql" ),
                                       'source-host' => "Connect to host source database",
                                       'source-user' => "User for login to source database",
                                       'source-password' => "Password to use when connecting to source database",
                                       'source-socket' => 'Socket to connect to source database (only for MySQL)',
                                       'match-type' => ( "Which database type to use for match, can be one of:\n" .
                                                         "mysql, postgresql" ),
                                       'match-host' => "Connect to host match database",
                                       'match-user' => "User for login to match database",
                                       'match-password' => "Password to use when connecting to match database",
                                       'match-socket' => 'Socket to connect to match database (only for MySQL)',
                                       'type' => ( "Which database type to use for match and source, can be one of:\n" .
                                                   "mysql, postgresql" ),
                                       'host' => "Connect to host match and source database",
                                       'user' => "User for login to match and source database",
                                       'password' => "Password to use when connecting to match and source database",
                                       'socket' => 'Socket to connect to match and source database (only for MySQL)',
                                       'lint-check' => 'Instead of comparing 2 datase schemas, verify source database schema for standards compliance',
                                       'reverse' => "Reverse the differences",
                                       'check-only' => "Don't show SQLs for the differences, just set exit code and return"
                                       ) )

Definition at line 26 of file ezsqldiff.php.

Initial value:
 eZScript::instance( array( 'description' => ( "eZ Publish SQL diff\n\n" .
                                                        "Displays differences between two database schemas,\n" .
                                                        "and sets exit code based whether there is a difference or not\n" .
                                                        "\n" .
                                                        "ezsqldiff.php --type mysql --user=root stable32 stable33" ),
                                     'use-session' => false,
                                     'use-modules' => true,
                                     'use-extensions' => true ) )

Definition at line 15 of file ezsqldiff.php.

$sourceDB = $options['arguments'][0]

Definition at line 74 of file ezsqldiff.php.

$sourceDBHost = $options['source-host'] ? $options['source-host'] : $options['host']

Definition at line 70 of file ezsqldiff.php.

$sourceDBPassword = $options['source-password'] ? $options['source-password'] : $options['password']

Definition at line 72 of file ezsqldiff.php.

$sourceDBSocket = $options['source-socket'] ? $options['source-socket'] : $options['socket']

Definition at line 73 of file ezsqldiff.php.

$sourceDBUser = $options['source-user'] ? $options['source-user'] : $options['user']

Definition at line 71 of file ezsqldiff.php.

$sourceSchema = loadDatabaseSchema( $sourceType, $sourceDBHost, $sourceDBUser, $sourceDBPassword, $sourceDBSocket, $sourceDB, $cli )

Definition at line 175 of file ezsqldiff.php.

if (count($options['arguments'])< 1) if (count($options['arguments'])< 2 and!$options['lint-check']) $sourceType = $options['source-type'] ? $options['source-type'] : $options['type']

Definition at line 69 of file ezsqldiff.php.