ShareTokenService
in package
Uses
TStringTools
Class ShareTokenService
Table of Contents
- $configService : ConfigService
- $interfaceService : InterfaceService
- $shareTokenRequest : ShareTokenRequest
- $urlGenerator : IURLGenerator
- __construct() : mixed
- ShareTokenService constructor.
- generateRandomSentence() : string
- generateRandomWord() : string
- generateShareToken() : ShareToken
- getDateDiff() : string
- humanReadable() : string
- removeSharePassword() : void
- remove password on files previously shared to circleId
- removeTokens() : mixed
- setShareTokenLink() : void
- updateSharePassword() : void
- update password on files previously shared to circleId
- commonPart() : string
- cut() : string
- feedStringWithParams() : string
- isUuid() : bool
- token() : string
- uuid() : string
- Generate uuid: 2b5a7a87-8db1-445f-a17b-405790f91c80
Properties
$configService
private
ConfigService
$configService
$interfaceService
private
InterfaceService
$interfaceService
$shareTokenRequest
private
ShareTokenRequest
$shareTokenRequest
$urlGenerator
private
IURLGenerator
$urlGenerator
Methods
__construct()
ShareTokenService constructor.
public
__construct(IURLGenerator $urlGenerator, ShareTokenRequest $shareTokenRequest, InterfaceService $interfaceService, ConfigService $configService) : mixed
Parameters
- $urlGenerator : IURLGenerator
- $shareTokenRequest : ShareTokenRequest
- $interfaceService : InterfaceService
- $configService : ConfigService
Return values
mixed —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 —generateShareToken()
public
generateShareToken(ShareWrapper $share, Member $member[, string $hashedPassword = '' ]) : ShareToken
Parameters
- $share : ShareWrapper
- $member : Member
- $hashedPassword : string = ''
Tags
Return values
ShareToken —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 —removeSharePassword()
remove password on files previously shared to circleId
public
removeSharePassword(string $circleId) : void
Parameters
- $circleId : string
Return values
void —removeTokens()
public
removeTokens(string $singleId, string $circleId) : mixed
Parameters
- $singleId : string
- $circleId : string
Return values
mixed —setShareTokenLink()
public
setShareTokenLink(ShareToken $shareToken) : void
Parameters
- $shareToken : ShareToken
Return values
void —updateSharePassword()
update password on files previously shared to circleId
public
updateSharePassword(string $circleId, string $hashedPassword) : void
Parameters
- $circleId : string
- $hashedPassword : string
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