PHP 클래스 CI_Migration, TastyIgniter

All migrations should implement this, forces up() and down() and gives access to the CI super-global.
저자: Reactor Engineers
파일 보기 프로젝트 열기: tastyigniter/tastyigniter 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_error_string string Error message
$_migration_auto_latest boolean Whether to automatically run migrations
$_migration_enabled boolean Whether the library is enabled
$_migration_path string Path to migration classes
$_migration_regex string Migration basename regex
$_migration_table string Database table with migration info
$_migration_type boolean Migration numbering type
$_migration_version mixed Current migration version

공개 메소드들

메소드 설명
__construct ( array $config = [] ) : void Initialize Migration Class
__get ( string $var ) : mixed Enable the use of CI super-global
current ( ) : mixed Sets the schema to the migration version set in config
error_string ( ) : string Error string
find_migrations ( ) : array Retrieves list of available migration scripts
latest ( ) : mixed Sets the schema to the latest migration
version ( string $target_version ) : mixed Migrate to a schema version

보호된 메소드들

메소드 설명
_get_migration_name ( string $migration ) : string Extracts the migration class name from a filename
_get_migration_number ( string $migration ) : string Extracts the migration number from a filename
_get_version ( ) : string Retrieves current schema version
_update_version ( string $migration ) : void Stores the current schema version

메소드 상세

__construct() 공개 메소드

Initialize Migration Class
public __construct ( array $config = [] ) : void
$config array
리턴 void

__get() 공개 메소드

Enable the use of CI super-global
public __get ( string $var ) : mixed
$var string
리턴 mixed

_get_migration_name() 보호된 메소드

Extracts the migration class name from a filename
protected _get_migration_name ( string $migration ) : string
$migration string
리턴 string text portion of a migration filename

_get_migration_number() 보호된 메소드

Extracts the migration number from a filename
protected _get_migration_number ( string $migration ) : string
$migration string
리턴 string Numeric portion of a migration filename

_get_version() 보호된 메소드

Retrieves current schema version
protected _get_version ( ) : string
리턴 string Current migration version

_update_version() 보호된 메소드

Stores the current schema version
protected _update_version ( string $migration ) : void
$migration string Migration reached
리턴 void

current() 공개 메소드

Sets the schema to the migration version set in config
public current ( ) : mixed
리턴 mixed TRUE if no migrations are found, current version string on success, FALSE on failure

error_string() 공개 메소드

Error string
public error_string ( ) : string
리턴 string Error message returned as a string

find_migrations() 공개 메소드

Retrieves list of available migration scripts
public find_migrations ( ) : array
리턴 array list of migration file paths sorted by version

latest() 공개 메소드

Sets the schema to the latest migration
public latest ( ) : mixed
리턴 mixed Current version string on success, FALSE on failure

version() 공개 메소드

Calls each migration step required to get to the schema version of choice
public version ( string $target_version ) : mixed
$target_version string Target schema version
리턴 mixed TRUE if no migrations are found, current version string on success, FALSE on failure

프로퍼티 상세

$_error_string 보호되어 있는 프로퍼티

Error message
protected string $_error_string
리턴 string

$_migration_auto_latest 보호되어 있는 프로퍼티

Whether to automatically run migrations
protected bool $_migration_auto_latest
리턴 boolean

$_migration_enabled 보호되어 있는 프로퍼티

Whether the library is enabled
protected bool $_migration_enabled
리턴 boolean

$_migration_path 보호되어 있는 프로퍼티

Path to migration classes
protected string $_migration_path
리턴 string

$_migration_regex 보호되어 있는 프로퍼티

Migration basename regex
protected string $_migration_regex
리턴 string

$_migration_table 보호되어 있는 프로퍼티

Database table with migration info
protected string $_migration_table
리턴 string

$_migration_type 보호되어 있는 프로퍼티

Migration numbering type
protected bool $_migration_type
리턴 boolean

$_migration_version 보호되어 있는 프로퍼티

Current migration version
protected mixed $_migration_version
리턴 mixed