Legend of the Green Dragon

Upgrade extends UpgradeAbstract

Script to upgrade a version.

Table of Contents

DATA_DIR_UPDATE  = __DIR__ . '/data/update'
TRANSLATOR_DOMAIN  = 'app_installer'
TRANSLATOR_KEY_TABLE_CREATE  = 'upgrade.version.table.create'
TRANSLATOR_KEY_TABLE_DELETE  = 'upgrade.version.table.delete'
TRANSLATOR_KEY_TABLE_IMPORT  = 'upgrade.version.table.import'
TRANSLATOR_KEY_TABLE_RENAME  = 'upgrade.version.table.rename'
VERSION_NUMBER  = 40000
$connection  : mixed
$doctrine  : mixed
$messages  : mixed
$versions  : array<string|int, mixed>
Versions of game.
getAllVersions()  : array<string|int, mixed>
Get array of versions.
getIntVersion()  : int
Get int value for a string version.
getMessages()  : array<string|int, mixed>
Get all generated messages.
getNameVersion()  : string
Get name for a numeric version.
getNextVersion()  : int
Get the next version of the given version.
getPreviusVersion()  : int
Get the previous version of the given version.
insertData()  : bool
Insert data of an update install.
setConnection()  : self
Set connection.
setDoctrine()  : self
Set Doctrine Entity Manager.
step0()  : bool
First step of upgraded.
step1()  : bool
Step 1: Rename tables old tables and create new tables.
step2()  : bool
Import data of old "commentary" table.
step3()  : bool
Import data of old "accounts" table.
step4()  : bool
Import data of old "news" table.
step5()  : bool
Insert new data for this upgrade.
step6()  : bool
Delete old table when all rows are imported.
syncEntity()  : bool
Sync a single entity.

Constants

DATA_DIR_UPDATE

public mixed DATA_DIR_UPDATE = __DIR__ . '/data/update'

TRANSLATOR_KEY_TABLE_CREATE

public mixed TRANSLATOR_KEY_TABLE_CREATE = 'upgrade.version.table.create'

TRANSLATOR_KEY_TABLE_DELETE

public mixed TRANSLATOR_KEY_TABLE_DELETE = 'upgrade.version.table.delete'

TRANSLATOR_KEY_TABLE_IMPORT

public mixed TRANSLATOR_KEY_TABLE_IMPORT = 'upgrade.version.table.import'

TRANSLATOR_KEY_TABLE_RENAME

public mixed TRANSLATOR_KEY_TABLE_RENAME = 'upgrade.version.table.rename'

VERSION_NUMBER

public mixed VERSION_NUMBER = 40000

Properties

$versions

Versions of game.

protected array<string|int, mixed> $versions = [ '-1' => -1, //needed just as a placeholder for new installs. '0.9' => 900, '0.9.1' => 901, '0.9.2' => 902, '0.9.3' => 903, '0.9.4' => 904, '0.9.5' => 905, '0.9.6' => 906, '0.9.7' => 907, '0.9.8-prerelease.1' => 908, '0.9.8-prerelease.2' => 909, '0.9.8-prerelease.3' => 910, '0.9.8-prerelease.4' => 911, '0.9.8-prerelease.5' => 912, '0.9.8-prerelease.6' => 913, '0.9.8-prerelease.7' => 914, '0.9.8-prerelease.8' => 915, '0.9.8-prerelease.9' => 916, '0.9.8-prerelease.10' => 917, '0.9.8-prerelease.11' => 918, '0.9.8-prerelease.12' => 919, '0.9.8-prerelease.13' => 920, '0.9.8-prerelease.14' => 921, '0.9.8-prerelease.14a' => 922, '1.0.0' => 10000, '1.0.1' => 10001, '1.0.2' => 10002, '1.0.3' => 10003, '1.0.4' => 10004, '1.0.5' => 10005, '1.0.6' => 10006, '1.1.0 Dragonprime Edition' => 10100, '1.1.1 Dragonprime Edition' => 10101, '1.1.2 Dragonprime Edition' => 10102, '1.1.1.0 Dragonprime Edition +nb' => 10103, '1.1.1.1 Dragonprime Edition +nb' => 10104, '2.0.0 IDMarinas Edition' => 20000, '2.0.1 IDMarinas Edition' => 20001, '2.1.0 IDMarinas Edition' => 20100, '2.2.0 IDMarinas Edition' => 20200, '2.3.0 IDMarinas Edition' => 20300, '2.4.0 IDMarinas Edition' => 20400, '2.5.0 IDMarinas Edition' => 20500, '2.6.0 IDMarinas Edition' => 20600, '2.7.0 IDMarinas Edition' => 20700, '3.0.0 IDMarinas Edition' => 30000, '4.0.0 IDMarinas Edition' => 40000, '4.1.0 IDMarinas Edition' => 40100, '4.2.0 IDMarinas Edition' => 40200, '4.3.0 IDMarinas Edition' => 40300, '4.4.0 IDMarinas Edition' => 40400, '4.5.0 IDMarinas Edition' => 40500, '4.6.0 IDMarinas Edition' => 40600, '4.7.0 IDMarinas Edition' => 40700, '4.8.0 IDMarinas Edition' => 40800, '4.9.0 IDMarinas Edition' => 40900, '4.10.0 IDMarinas Edition' => 41000, '4.11.0 IDMarinas Edition' => 41100, ]

Methods

getAllVersions()

Get array of versions.

public getAllVersions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getIntVersion()

Get int value for a string version.

public getIntVersion(string $version) : int
Parameters
$version : string
Return values
int

getMessages()

Get all generated messages.

public getMessages() : array<string|int, mixed>
Return values
array<string|int, mixed>

getNameVersion()

Get name for a numeric version.

public getNameVersion(int $version) : string
Parameters
$version : int
Return values
string

getNextVersion()

Get the next version of the given version.

public getNextVersion(int $version) : int
Parameters
$version : int
Return values
int

getPreviusVersion()

Get the previous version of the given version.

public getPreviusVersion(int $version) : int
Parameters
$version : int
Return values
int

insertData()

Insert data of an update install.

public insertData(int $version) : bool
Parameters
$version : int

Version to upgrade

Return values
bool

setConnection()

Set connection.

public setConnection(Connection $connection) : self
Parameters
$connection : Connection
Return values
self

setDoctrine()

Set Doctrine Entity Manager.

public setDoctrine(EntityManager $doctrine) : self
Parameters
$doctrine : EntityManager
Return values
self

step0()

First step of upgraded.

public final step0() : bool
Return values
bool

step1()

Step 1: Rename tables old tables and create new tables.

public step1() : bool
Return values
bool

step2()

Import data of old "commentary" table.

public step2() : bool
Return values
bool

step3()

Import data of old "accounts" table.

public step3() : bool

This table are splited in two tables: "accounts" and "characters".

Return values
bool

step4()

Import data of old "news" table.

public step4() : bool
Return values
bool

step5()

Insert new data for this upgrade.

public step5() : bool
Return values
bool

step6()

Delete old table when all rows are imported.

public step6() : bool
Return values
bool

syncEntity()

Sync a single entity.

public syncEntity(string $entity) : bool
Parameters
$entity : string
Return values
bool

Search results