helpers.php
Tags
Table of Contents
Constants
- STDIN = \fopen('php://stdin', 'r')
Functions
- 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.
- mf_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
Constants
STDIN
public
mixed
STDIN
= \fopen('php://stdin', 'r')
Functions
set_installation_lock()
set_installation_lock(mixed $name, mixed $value) : mixed
Parameters
- $name : mixed
- $value : mixed
Tags
get_installation_lock()
get_installation_lock(mixed $name[, mixed $default = null ]) : mixed
Parameters
- $name : mixed
- $default : mixed = null
Tags
export_to_file()
export_to_file(string $filename, mixed $data[, bool $lock = false ]) : void
Parameters
- $filename : string
- $data : mixed
- $lock : bool = false
export_to_json_file()
export_to_json_file(string $filename, mixed $data[, bool $lock = false ]) : void
Parameters
- $filename : string
- $data : mixed
- $lock : bool = false
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>
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
stringdownloadUrl()
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
stringarrayToTree()
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
Repositoryuser()
user() : User
Return values
Userupload()
UploadFile helper.
upload() : UploadFile
Return values
UploadFileconvertImagePath()
convertImagePath(string $imagePath) : string
Parameters
- $imagePath : string
Return values
stringgetFilePath()
getFilePath(string $path, string $serverId) : string
Parameters
- $path : string
- $serverId : string
Return values
stringisImageUrl()
isImageUrl(string $url) : bool
Parameters
- $url : string
Return values
boolapp_active()
app_active(string $appName) : bool
Parameters
- $appName : string
Return values
boolurl_utility()
url_utility() : UrlUtilityInterface
Return values
UrlUtilityInterfacefaker_image_path()
faker_image_path(string $resourceName) : string
Parameters
- $resourceName : string
Return values
stringgetDayOfLeapYearNumber()
getDayOfLeapYearNumber(Carbon $date) : int
Parameters
- $date : Carbon
Return values
intis_running_unit_test()
Check is in CI or unitest mode.
is_running_unit_test() : bool
Return values
boolmf_get_contents()
mf_get_contents(string $path) : string|false
Parameters
- $path : string
Return values
string|falsedatabase_driver()
database_driver() : string
Return values
stringpolicy_authorize()
policy_authorize(string $policyClass, string $policyMethod, mixed ...$params) : void
Parameters
- $policyClass : string
- $policyMethod : string
- $params : mixed
Tags
gate_authorize()
gate_authorize(User $context, string $policyMethod, mixed $model, mixed ...$params) : void
Parameters
- $context : User
- $policyMethod : string
- $model : mixed
- $params : mixed
Tags
policy_check()
policy_check(string $policyClass, string $policyMethod, mixed ...$params) : bool
Parameters
- $policyClass : string
- $policyMethod : string
- $params : mixed
Return values
boolcalculatorExpiredDay()
calculatorExpiredDay(string $date) : int
Parameters
- $date : string
Return values
intfile_type()
file_type() : MetaFoxFileTypeInterface
Return values
MetaFoxFileTypeInterfacegetFrontendAliasByEntityType()
getFrontendAliasByEntityType(string $entityType) : string|null
Parameters
- $entityType : string
Return values
string|nullgetMobileAliasByEntityType()
getMobileAliasByEntityType(string $entityType) : string|null
Parameters
- $entityType : string
Return values
string|nullgetAliasByEntityType()
getAliasByEntityType(string $entityType) : string|null
Parameters
- $entityType : string
Return values
string|nullarray_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