PHP Class DbPatch_Command_Abstract

Author: Sandy Pleyte
Author: Martijn De Letter
Afficher le fichier Open project: dbpatch/dbpatch Class Usage Examples

Protected Properties

Свойство Type Description
$config Zend_Config | Zend_Config_Ini | Zend_Config_Xml
$console DbPatch_Core_Console
$db DbPatch_Core_Db
$options array
$writer DbPatch_Core_Writer

Méthodes publiques

Méthode Description
execute ( ) : void
getBranch ( ) : string
getConfig ( ) : null | Zend_Config | Zend_Config_Ini | Zend_Config_Xml
getConsole ( ) : DbPatch_Core_Console | null
getDb ( ) : null | Zend_Db_Adapter_Abstract
getOptions ( ) : array
getPatch ( integer $patchNumber, string $branch ) : boolean | DbPatch_Command_Patch_Abstract
getPatchDirectory ( ) : string | boolean
getPatchPrefix ( ) : string
getPatches ( string $branch, null | integer $searchPatchNumber = null ) : array
getWriter ( ) : DbPatch_Core_Writer | null
init ( ) : DbPatch_Command_Abstract
setConfig ( Zend_Config | Zend_Config_Ini | Zend_Config_Xml $config ) : DbPatch_Command_Abstract
setConsole ( DbPatch_Core_Console $console ) : DbPatch_Command_Abstract
setDb ( DbPatch_Core_Db $db ) : DbPatch_Command_Abstract
setOptions ( $options ) : void
setWriter ( DbPatch_Core_Writer $writer ) : DbPatch_Command_Abstract
trimTrailingSlashes ( string $str ) : string Remove trailing slash from string

Méthodes protégées

Méthode Description
addToChangelog ( array $patchFile, string $description = null ) : void Store patchfile entry to the changelog table
changelogExists ( ) : boolean Checks if the changelog table is present in the database
createChangelog ( ) : boolean Try to create the changelog table
detectBranches ( ) : array Detect the different branches that are used in the patch dir the default branch is always returned
dumpDatabase ( string $filename, $noData = false ) : boolean Dump database
getDumpFilename ( ) : string Create dump filename
isPatchApplied ( integer $patchNumber, string $branch ) : boolean Check if the passed patch number can be found in the changelog table for the specified branch
showHelp ( string $command = null ) : void Show help options for a given command
updateColumnType ( ) Check column types return void
validateChangelog ( ) : boolean Validate if the changelog is present in the database if not try to create the table

Method Details

addToChangelog() protected méthode

Store patchfile entry to the changelog table
protected addToChangelog ( array $patchFile, string $description = null ) : void
$patchFile array
$description string
Résultat void

changelogExists() protected méthode

Checks if the changelog table is present in the database
protected changelogExists ( ) : boolean
Résultat boolean

createChangelog() protected méthode

Try to create the changelog table
protected createChangelog ( ) : boolean
Résultat boolean

detectBranches() protected méthode

Detect the different branches that are used in the patch dir the default branch is always returned
protected detectBranches ( ) : array
Résultat array

dumpDatabase() protected méthode

Dump database
protected dumpDatabase ( string $filename, $noData = false ) : boolean
$filename string
Résultat boolean

execute() abstract public méthode

abstract public execute ( ) : void
Résultat void

getBranch() public méthode

public getBranch ( ) : string
Résultat string

getConfig() public méthode

public getConfig ( ) : null | Zend_Config | Zend_Config_Ini | Zend_Config_Xml
Résultat null | Zend_Config | Zend_Config_Ini | Zend_Config_Xml

getConsole() public méthode

public getConsole ( ) : DbPatch_Core_Console | null
Résultat DbPatch_Core_Console | null

getDb() public méthode

public getDb ( ) : null | Zend_Db_Adapter_Abstract
Résultat null | Zend_Db_Adapter_Abstract

getDumpFilename() protected méthode

Create dump filename
protected getDumpFilename ( ) : string
Résultat string

getOptions() public méthode

public getOptions ( ) : array
Résultat array

getPatch() public méthode

public getPatch ( integer $patchNumber, string $branch ) : boolean | DbPatch_Command_Patch_Abstract
$patchNumber integer
$branch string
Résultat boolean | DbPatch_Command_Patch_Abstract

getPatchDirectory() public méthode

public getPatchDirectory ( ) : string | boolean
Résultat string | boolean

getPatchPrefix() public méthode

public getPatchPrefix ( ) : string
Résultat string

getPatches() public méthode

public getPatches ( string $branch, null | integer $searchPatchNumber = null ) : array
$branch string
$searchPatchNumber null | integer
Résultat array

getWriter() public méthode

public getWriter ( ) : DbPatch_Core_Writer | null
Résultat DbPatch_Core_Writer | null

init() public méthode

public init ( ) : DbPatch_Command_Abstract
Résultat DbPatch_Command_Abstract

isPatchApplied() protected méthode

Check if the passed patch number can be found in the changelog table for the specified branch
protected isPatchApplied ( integer $patchNumber, string $branch ) : boolean
$patchNumber integer
$branch string
Résultat boolean $result true if patch already applied; false if not

setConfig() public méthode

public setConfig ( Zend_Config | Zend_Config_Ini | Zend_Config_Xml $config ) : DbPatch_Command_Abstract
$config Zend_Config | Zend_Config_Ini | Zend_Config_Xml
Résultat DbPatch_Command_Abstract

setConsole() public méthode

public setConsole ( DbPatch_Core_Console $console ) : DbPatch_Command_Abstract
$console DbPatch_Core_Console
Résultat DbPatch_Command_Abstract

setDb() public méthode

public setDb ( DbPatch_Core_Db $db ) : DbPatch_Command_Abstract
$db DbPatch_Core_Db
Résultat DbPatch_Command_Abstract

setOptions() public méthode

public setOptions ( $options ) : void
$options
Résultat void

setWriter() public méthode

public setWriter ( DbPatch_Core_Writer $writer ) : DbPatch_Command_Abstract
$writer DbPatch_Core_Writer
Résultat DbPatch_Command_Abstract

showHelp() protected méthode

Show help options for a given command
protected showHelp ( string $command = null ) : void
$command string
Résultat void

trimTrailingSlashes() public méthode

Remove trailing slash from string
public trimTrailingSlashes ( string $str ) : string
$str string String
Résultat string

updateColumnType() protected méthode

Check column types return void
protected updateColumnType ( )

validateChangelog() protected méthode

Validate if the changelog is present in the database if not try to create the table
protected validateChangelog ( ) : boolean
Résultat boolean

Property Details

$config protected_oe property

protected Zend_Config|Zend_Config_Ini|Zend_Config_Xml $config
Résultat Zend_Config | Zend_Config_Ini | Zend_Config_Xml

$console protected_oe property

protected DbPatch_Core_Console $console
Résultat DbPatch_Core_Console

$db protected_oe property

protected DbPatch_Core_Db $db
Résultat DbPatch_Core_Db

$options protected_oe property

protected array $options
Résultat array

$writer protected_oe property

protected DbPatch_Core_Writer $writer
Résultat DbPatch_Core_Writer