Nextcloud Circles API

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

$EMERGENCY

public static mixed $EMERGENCY = 4

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
throws
Exception
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

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
throws
Exception
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

generateMemberFrom21()

private generateMemberFrom21(SimpleDataStore $data) : Member
Parameters
$data : SimpleDataStore
Tags
throws
CircleNotFoundException
throws
RemoteInstanceException
throws
UserTypeNotFoundException
throws
FederatedUserNotFoundException
throws
OwnerNotFoundException
throws
RequestBuilderException
throws
RemoteNotFoundException
throws
UnknownRemoteException
throws
FederatedUserException
throws
ContactAddressBookNotFoundException
throws
RemoteResourceNotFoundException
throws
MemberNotFoundException
throws
FederatedItemException
throws
SingleCircleNotFoundException
throws
InvalidIdException
Return values
Member

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

Search results