helpers.php
Tags
Table of Contents
- set_installation_lock() : mixed
- get_installation_lock() : mixed
- export_to_file() : void
- export_to_json_file() : void
- export_to_csv() : void
- apiUrl() : string
- Get api url return to client.
- downloadUrl() : string
- Get api url return to client.
- arrayToTree() : array<string, mixed>
- Transform flat array to tree.
- localCacheStore() : Repository
- In order to categorize cache high load data to local do not push all cache to network base cache system because it's phrase issue of 1Gb/s network traffic.
- user() : User
- upload() : UploadFile
- UploadFile helper.
- convertImagePath() : string
- getFilePath() : string
- isImageUrl() : bool
- app_active() : bool
- url_utility() : UrlUtilityInterface
- faker_image_path() : string
- getDayOfLeapYearNumber() : int
- is_running_unit_test() : bool
- Check is in CI or unitest mode.
- fox_get_contents() : string|false
- database_driver() : string
- policy_authorize() : void
- gate_authorize() : void
- policy_check() : bool
- calculatorExpiredDay() : int
- file_type() : MetaFoxFileTypeInterface
- getFrontendAliasByEntityType() : string|null
- getMobileAliasByEntityType() : string|null
- getAliasByEntityType() : string|null
- array_trim_null() : array<string|int, mixed>
- strip_tag_content() : string
Functions
set_installation_lock()
set_installation_lock(mixed $name, mixed $value) : mixed
Parameters
- $name : mixed
- $value : mixed
Tags
Return values
mixed —get_installation_lock()
get_installation_lock(mixed $name[, mixed $default = null ]) : mixed
Parameters
- $name : mixed
- $default : mixed = null
Tags
Return values
mixed —export_to_file()
export_to_file(string $filename, mixed $data[, bool $lock = false ]) : void
Parameters
- $filename : string
- $data : mixed
- $lock : bool = false
Return values
void —export_to_json_file()
export_to_json_file(string $filename, mixed $data[, bool $lock = false ]) : void
Parameters
- $filename : string
- $data : mixed
- $lock : bool = false
Return values
void —export_to_csv()
export_to_csv(string $filename, array<string|int, mixed> $data, array<string|int, mixed> $fields) : void
Parameters
- $filename : string
- $data : array<string|int, mixed>
- $fields : array<string|int, mixed>
Return values
void —apiUrl()
Get api url return to client.
apiUrl(string $name[, array<string|int, mixed> $params = [] ][, bool $absolute = false ]) : string
Parameters
- $name : string
- $params : array<string|int, mixed> = []
- $absolute : bool = false
Return values
string —downloadUrl()
Get api url return to client.
downloadUrl(string $name[, array<string|int, mixed> $params = [] ]) : string
Parameters
- $name : string
- $params : array<string|int, mixed> = []
Return values
string —arrayToTree()
Transform flat array to tree.
arrayToTree(array<string, mixed> $array[, string $keyName = 'name' ][, string $parentName = 'parent_name' ][, string $childrenName = 'items' ]) : array<string, mixed>
Parameters
- $array : array<string, mixed>
- $keyName : string = 'name'
- $parentName : string = 'parent_name'
- $childrenName : string = 'items'
Return values
array<string, mixed> —localCacheStore()
In order to categorize cache high load data to local do not push all cache to network base cache system because it's phrase issue of 1Gb/s network traffic.
localCacheStore() : Repository
keep in internal
by default using apcu
via apc wrapper as local cache data.
Return values
Repository —user()
user() : User
Return values
User —upload()
UploadFile helper.
upload() : UploadFile
Return values
UploadFile —convertImagePath()
convertImagePath(string $imagePath) : string
Parameters
- $imagePath : string
Return values
string —getFilePath()
getFilePath(string $path, string $serverId) : string
Parameters
- $path : string
- $serverId : string
Return values
string —isImageUrl()
isImageUrl(string $url) : bool
Parameters
- $url : string
Return values
bool —app_active()
app_active(string $appName) : bool
Parameters
- $appName : string
Return values
bool —url_utility()
url_utility() : UrlUtilityInterface
Return values
UrlUtilityInterface —faker_image_path()
faker_image_path(string $resourceName) : string
Parameters
- $resourceName : string
Return values
string —getDayOfLeapYearNumber()
getDayOfLeapYearNumber(Carbon $date) : int
Parameters
- $date : Carbon
Return values
int —is_running_unit_test()
Check is in CI or unitest mode.
is_running_unit_test() : bool
Return values
bool —fox_get_contents()
fox_get_contents(string $path) : string|false
Parameters
- $path : string
Return values
string|false —database_driver()
database_driver() : string
Return values
string —policy_authorize()
policy_authorize(string $policyClass, string $policyMethod, mixed ...$params) : void
Parameters
- $policyClass : string
- $policyMethod : string
- $params : mixed
Tags
Return values
void —gate_authorize()
gate_authorize(User $context, string $policyMethod, mixed $model, mixed ...$params) : void
Parameters
- $context : User
- $policyMethod : string
- $model : mixed
- $params : mixed
Tags
Return values
void —policy_check()
policy_check(string $policyClass, string $policyMethod, mixed ...$params) : bool
Parameters
- $policyClass : string
- $policyMethod : string
- $params : mixed
Return values
bool —calculatorExpiredDay()
calculatorExpiredDay(string $date) : int
Parameters
- $date : string
Return values
int —file_type()
file_type() : MetaFoxFileTypeInterface
Return values
MetaFoxFileTypeInterface —getFrontendAliasByEntityType()
getFrontendAliasByEntityType(string $entityType) : string|null
Parameters
- $entityType : string
Return values
string|null —getMobileAliasByEntityType()
getMobileAliasByEntityType(string $entityType) : string|null
Parameters
- $entityType : string
Return values
string|null —getAliasByEntityType()
getAliasByEntityType(string $entityType) : string|null
Parameters
- $entityType : string
Return values
string|null —array_trim_null()
array_trim_null(array<string|int, mixed> $array[, array<string|int, mixed> $strips = [] ]) : array<string|int, mixed>
Parameters
- $array : array<string|int, mixed>
- $strips : array<string|int, mixed> = []
Return values
array<string|int, mixed> —strip_tag_content()
strip_tag_content(string $content) : string
Parameters
- $content : string