MigrationService
in package
Uses
TStringTools, TNCLogger
Class MigrationService
Table of Contents
- $ALERT : mixed
- $CRITICAL : mixed
- $DEBUG : mixed
- $EMERGENCY : mixed
- $ERROR : mixed
- $INFO : mixed
- $NOTICE : mixed
- $WARNING : mixed
- $appCircle : FederatedUser
- $circleRequest : CircleRequest
- $circleService : CircleService
- $configService : ConfigService
- $contactService : ContactService
- $dbConnection : IDBConnection
- $federatedUserService : FederatedUserService
- $memberRequest : MemberRequest
- $membershipService : MembershipService
- $outputService : OutputService
- $shareTokenRequest : ShareTokenRequest
- $timezoneService : TimezoneService
- $urlGenerator : IURLGenerator
- __construct() : mixed
- MigrationService constructor.
- alert() : void
- debug() : void
- e() : void
- emergency() : void
- exception() : void
- generateRandomSentence() : string
- generateRandomWord() : string
- getDateDiff() : string
- humanReadable() : string
- log() : void
- logger() : LoggerInterface
- migration() : void
- migrationTo22_Members_Memberships() : void
- migrationTo22_Tokens() : void
- migrationTo22Feasibility() : bool
- run migration if: - old tables exist.
- notice() : void
- t() : void
- throwable() : void
- warning() : void
- commonPart() : string
- cut() : string
- feedStringWithParams() : string
- isUuid() : bool
- token() : string
- uuid() : string
- Generate uuid: 2b5a7a87-8db1-445f-a17b-405790f91c80
- convertCircleTypeFrom21() : void
- convertMemberUserTypeFrom21() : void
- fixContactId() : mixed
- generateCircleFrom21() : Circle
- generateMemberFrom21() : Member
- generateShareTokenFrom21() : ShareToken
- migrationTo22() : void
- migrationTo22_1_SubShares() : void
- migrationTo22_Circles() : void
- migrationTo22_Members() : void
- saveGeneratedCircle() : void
- saveGeneratedMember() : void
- saveGeneratedShareToken() : void
- updateSubShare() : void
Properties
$ALERT
public
static mixed
$ALERT
= 3
$CRITICAL
public
static mixed
$CRITICAL
= 3
$DEBUG
public
static mixed
$DEBUG
= 0
$EMERGENCY
public
static mixed
$EMERGENCY
= 4
$ERROR
public
static mixed
$ERROR
= 3
$INFO
public
static mixed
$INFO
= 1
$NOTICE
public
static mixed
$NOTICE
= 1
$WARNING
public
static mixed
$WARNING
= 2
$appCircle
private
FederatedUser
$appCircle
= null
$circleRequest
private
CircleRequest
$circleRequest
$circleService
private
CircleService
$circleService
$configService
private
ConfigService
$configService
$contactService
private
ContactService
$contactService
$dbConnection
private
IDBConnection
$dbConnection
$federatedUserService
private
FederatedUserService
$federatedUserService
$memberRequest
private
MemberRequest
$memberRequest
$membershipService
private
MembershipService
$membershipService
$outputService
private
OutputService
$outputService
$shareTokenRequest
private
ShareTokenRequest
$shareTokenRequest
$timezoneService
private
TimezoneService
$timezoneService
$urlGenerator
private
IURLGenerator
$urlGenerator
Methods
__construct()
MigrationService constructor.
public
__construct(IDBConnection $dbConnection, IURLGenerator $urlGenerator, CircleRequest $circleRequest, MemberRequest $memberRequest, ShareTokenRequest $shareTokenRequest, MembershipService $membershipService, FederatedUserService $federatedUserService, CircleService $circleService, ContactService $contactService, TimezoneService $timezoneService, OutputService $outputService, ConfigService $configService) : mixed
Parameters
- $dbConnection : IDBConnection
- $urlGenerator : IURLGenerator
- $circleRequest : CircleRequest
- $memberRequest : MemberRequest
- $shareTokenRequest : ShareTokenRequest
- $membershipService : MembershipService
- $federatedUserService : FederatedUserService
- $circleService : CircleService
- $contactService : ContactService
- $timezoneService : TimezoneService
- $outputService : OutputService
- $configService : ConfigService
Return values
mixed —alert()
public
alert(string $message[, bool $trace = false ][, array<string|int, mixed> $serializable = [] ]) : void
Parameters
- $message : string
- $trace : bool = false
- $serializable : array<string|int, mixed> = []
Return values
void —debug()
public
debug(string $message[, array<string|int, mixed> $serializable = [] ]) : void
Parameters
- $message : string
- $serializable : array<string|int, mixed> = []
Return values
void —e()
public
e(Exception $e[, array<string|int, mixed> $serializable = [] ]) : void
Parameters
- $e : Exception
- $serializable : array<string|int, mixed> = []
Return values
void —emergency()
public
emergency(string $message[, bool $trace = false ][, array<string|int, mixed> $serializable = [] ]) : void
Parameters
- $message : string
- $trace : bool = false
- $serializable : array<string|int, mixed> = []
Return values
void —exception()
public
exception(Exception $e[, int|array<string|int, mixed> $level = 3 ][, array<string|int, mixed> $serializable = [] ]) : void
Parameters
- $e : Exception
- $level : int|array<string|int, mixed> = 3
- $serializable : array<string|int, mixed> = []
Return values
void —generateRandomSentence()
public
generateRandomSentence([int $words = 5 ]) : string
Parameters
- $words : int = 5
Return values
string —generateRandomWord()
public
generateRandomWord([int $length = 8 ]) : string
Parameters
- $length : int = 8
Return values
string —getDateDiff()
public
getDateDiff(int $first, int $second[, bool $short = false ][, array<string|int, mixed> $words = [] ]) : string
Parameters
- $first : int
- $second : int
- $short : bool = false
- $words : array<string|int, mixed> = []
Tags
Return values
string —humanReadable()
public
humanReadable(int $bytes) : string
Parameters
- $bytes : int
Return values
string —log()
public
log(int $level, string $message[, bool $trace = false ][, array<string|int, mixed> $serializable = [] ]) : void
Parameters
- $level : int
- $message : string
- $trace : bool = false
- $serializable : array<string|int, mixed> = []
Return values
void —logger()
public
logger() : LoggerInterface
Return values
LoggerInterface —migration()
public
migration([bool $force = false ]) : void
Parameters
- $force : bool = false
Tags
Return values
void —migrationTo22_Members_Memberships()
public
migrationTo22_Members_Memberships() : void
Tags
Return values
void —migrationTo22_Tokens()
public
migrationTo22_Tokens() : void
Return values
void —migrationTo22Feasibility()
run migration if: - old tables exist.
public
migrationTo22Feasibility() : bool
- new tables are (almost) empty.
Tags
Return values
bool —notice()
public
notice(string $message[, bool $trace = false ][, array<string|int, mixed> $serializable = [] ]) : void
Parameters
- $message : string
- $trace : bool = false
- $serializable : array<string|int, mixed> = []
Return values
void —t()
public
t(Throwable $t[, array<string|int, mixed> $serializable = [] ]) : void
Parameters
- $t : Throwable
- $serializable : array<string|int, mixed> = []
Return values
void —throwable()
public
throwable(Throwable $t[, int $level = 3 ][, array<string|int, mixed> $serializable = [] ]) : void
Parameters
- $t : Throwable
- $level : int = 3
- $serializable : array<string|int, mixed> = []
Return values
void —warning()
public
warning(string $message[, bool $trace = false ][, array<string|int, mixed> $serializable = [] ]) : void
Parameters
- $message : string
- $trace : bool = false
- $serializable : array<string|int, mixed> = []
Return values
void —commonPart()
protected
commonPart(string $str1, string $str2[, bool $cs = true ]) : string
Parameters
- $str1 : string
- $str2 : string
- $cs : bool = true
-
case sensitive ?
Return values
string —cut()
protected
cut(string $line, int $length) : string
Parameters
- $line : string
- $length : int
Return values
string —feedStringWithParams()
protected
feedStringWithParams(string $line, array<string|int, mixed> $params) : string
Parameters
- $line : string
- $params : array<string|int, mixed>
Return values
string —isUuid()
protected
isUuid(string $uuid) : bool
Parameters
- $uuid : string
Return values
bool —token()
protected
token([int $length = 15 ]) : string
Parameters
- $length : int = 15
Return values
string —uuid()
Generate uuid: 2b5a7a87-8db1-445f-a17b-405790f91c80
protected
uuid(int $length) : string
Parameters
- $length : int
Return values
string —convertCircleTypeFrom21()
private
convertCircleTypeFrom21(Circle $circle, int $type) : void
Parameters
- $circle : Circle
- $type : int
Return values
void —convertMemberUserTypeFrom21()
private
convertMemberUserTypeFrom21(Member $member, int $userType) : void
Parameters
- $member : Member
- $userType : int
Tags
Return values
void —fixContactId()
private
fixContactId(Member $member) : mixed
Parameters
- $member : Member
Tags
Return values
mixed —generateCircleFrom21()
private
generateCircleFrom21(SimpleDataStore $data) : Circle
Parameters
- $data : SimpleDataStore
Tags
Return values
Circle —generateMemberFrom21()
private
generateMemberFrom21(SimpleDataStore $data) : Member
Parameters
- $data : SimpleDataStore
Tags
Return values
Member —generateShareTokenFrom21()
private
generateShareTokenFrom21(SimpleDataStore $data) : ShareToken
Parameters
- $data : SimpleDataStore
Tags
Return values
ShareToken —migrationTo22()
private
migrationTo22() : void
Tags
Return values
void —migrationTo22_1_SubShares()
private
migrationTo22_1_SubShares() : void
Return values
void —migrationTo22_Circles()
private
migrationTo22_Circles() : void
Return values
void —migrationTo22_Members()
private
migrationTo22_Members() : void
Return values
void —saveGeneratedCircle()
private
saveGeneratedCircle(Circle $circle) : void
Parameters
- $circle : Circle
Return values
void —saveGeneratedMember()
private
saveGeneratedMember(Member $member) : void
Parameters
- $member : Member
Return values
void —saveGeneratedShareToken()
private
saveGeneratedShareToken(ShareToken $shareToken) : void
Parameters
- $shareToken : ShareToken
Return values
void —updateSubShare()
private
updateSubShare(SimpleDataStore $data, FederatedUser $federatedUser) : void
Parameters
- $data : SimpleDataStore
- $federatedUser : FederatedUser