PHP Класс DbPatch_Command_Abstract

Автор: Sandy Pleyte
Автор: Martijn De Letter
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$config Zend_Config | Zend_Config_Ini | Zend_Config_Xml
$console DbPatch_Core_Console
$db DbPatch_Core_Db
$options array
$writer DbPatch_Core_Writer

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
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

Описание методов

addToChangelog() защищенный Метод

Store patchfile entry to the changelog table
protected addToChangelog ( array $patchFile, string $description = null ) : void
$patchFile array
$description string
Результат void

changelogExists() защищенный Метод

Checks if the changelog table is present in the database
protected changelogExists ( ) : boolean
Результат boolean

createChangelog() защищенный Метод

Try to create the changelog table
protected createChangelog ( ) : boolean
Результат boolean

detectBranches() защищенный Метод

Detect the different branches that are used in the patch dir the default branch is always returned
protected detectBranches ( ) : array
Результат array

dumpDatabase() защищенный Метод

Dump database
protected dumpDatabase ( string $filename, $noData = false ) : boolean
$filename string
Результат boolean

execute() абстрактный публичный Метод

abstract public execute ( ) : void
Результат void

getBranch() публичный Метод

public getBranch ( ) : string
Результат string

getConfig() публичный Метод

public getConfig ( ) : null | Zend_Config | Zend_Config_Ini | Zend_Config_Xml
Результат null | Zend_Config | Zend_Config_Ini | Zend_Config_Xml

getConsole() публичный Метод

public getConsole ( ) : DbPatch_Core_Console | null
Результат DbPatch_Core_Console | null

getDb() публичный Метод

public getDb ( ) : null | Zend_Db_Adapter_Abstract
Результат null | Zend_Db_Adapter_Abstract

getDumpFilename() защищенный Метод

Create dump filename
protected getDumpFilename ( ) : string
Результат string

getOptions() публичный Метод

public getOptions ( ) : array
Результат array

getPatch() публичный Метод

public getPatch ( integer $patchNumber, string $branch ) : boolean | DbPatch_Command_Patch_Abstract
$patchNumber integer
$branch string
Результат boolean | DbPatch_Command_Patch_Abstract

getPatchDirectory() публичный Метод

public getPatchDirectory ( ) : string | boolean
Результат string | boolean

getPatchPrefix() публичный Метод

public getPatchPrefix ( ) : string
Результат string

getPatches() публичный Метод

public getPatches ( string $branch, null | integer $searchPatchNumber = null ) : array
$branch string
$searchPatchNumber null | integer
Результат array

getWriter() публичный Метод

public getWriter ( ) : DbPatch_Core_Writer | null
Результат DbPatch_Core_Writer | null

init() публичный Метод

public init ( ) : DbPatch_Command_Abstract
Результат DbPatch_Command_Abstract

isPatchApplied() защищенный Метод

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
Результат boolean $result true if patch already applied; false if not

setConfig() публичный Метод

public setConfig ( Zend_Config | Zend_Config_Ini | Zend_Config_Xml $config ) : DbPatch_Command_Abstract
$config Zend_Config | Zend_Config_Ini | Zend_Config_Xml
Результат DbPatch_Command_Abstract

setConsole() публичный Метод

public setConsole ( DbPatch_Core_Console $console ) : DbPatch_Command_Abstract
$console DbPatch_Core_Console
Результат DbPatch_Command_Abstract

setDb() публичный Метод

public setDb ( DbPatch_Core_Db $db ) : DbPatch_Command_Abstract
$db DbPatch_Core_Db
Результат DbPatch_Command_Abstract

setOptions() публичный Метод

public setOptions ( $options ) : void
$options
Результат void

setWriter() публичный Метод

public setWriter ( DbPatch_Core_Writer $writer ) : DbPatch_Command_Abstract
$writer DbPatch_Core_Writer
Результат DbPatch_Command_Abstract

showHelp() защищенный Метод

Show help options for a given command
protected showHelp ( string $command = null ) : void
$command string
Результат void

trimTrailingSlashes() публичный Метод

Remove trailing slash from string
public trimTrailingSlashes ( string $str ) : string
$str string String
Результат string

updateColumnType() защищенный Метод

Check column types return void
protected updateColumnType ( )

validateChangelog() защищенный Метод

Validate if the changelog is present in the database if not try to create the table
protected validateChangelog ( ) : boolean
Результат boolean

Описание свойств

$config защищенное свойство

protected Zend_Config|Zend_Config_Ini|Zend_Config_Xml $config
Результат Zend_Config | Zend_Config_Ini | Zend_Config_Xml

$console защищенное свойство

protected DbPatch_Core_Console $console
Результат DbPatch_Core_Console

$db защищенное свойство

protected DbPatch_Core_Db $db
Результат DbPatch_Core_Db

$options защищенное свойство

protected array $options
Результат array

$writer защищенное свойство

protected DbPatch_Core_Writer $writer
Результат DbPatch_Core_Writer