Tools
in package
Una clase con funciones útiles para el desarrollo de FacturaScripts.
Table of Contents
- ASCII = ['Š' => 'S', 'š' => 's', 'Đ' => 'Dj', 'đ' => 'dj', 'Ž' => 'Z', 'ž' => 'z', 'Č' => 'C', 'č' => 'c', 'Ć' => 'C', 'ć' => 'c', 'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'A', 'Å' => 'A', 'Æ' => 'A', 'Ç' => 'C', 'È' => 'E', 'É' => 'E', 'Ê' => 'E', 'Ë' => 'E', 'Ì' => 'I', 'Í' => 'I', 'Î' => 'I', 'Ï' => 'I', 'Ñ' => 'N', 'Ò' => 'O', 'Ó' => 'O', 'Ô' => 'O', 'Õ' => 'O', 'Ö' => 'O', 'Ø' => 'O', 'Ù' => 'U', 'Ú' => 'U', 'Û' => 'U', 'Ü' => 'U', 'Ý' => 'Y', 'Þ' => 'B', 'ß' => 'Ss', 'à' => 'a', 'á' => 'a', 'â' => 'a', 'ã' => 'a', 'ä' => 'a', 'å' => 'a', 'æ' => 'a', 'ç' => 'c', 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e', 'ì' => 'i', 'í' => 'i', 'î' => 'i', 'ï' => 'i', 'ð' => 'o', 'ñ' => 'n', 'ò' => 'o', 'ó' => 'o', 'ô' => 'o', 'õ' => 'o', 'ö' => 'o', 'ø' => 'o', 'ù' => 'u', 'ú' => 'u', 'û' => 'u', 'ý' => 'y', 'þ' => 'b', 'ÿ' => 'y', 'Ŕ' => 'R', 'ŕ' => 'r']
- DATE_STYLE = 'd-m-Y'
- DATETIME_STYLE = 'd-m-Y H:i:s'
- HOUR_STYLE = 'H:i:s'
- HTML_CHARS = ['<', '>', '"', "'"]
- HTML_REPLACEMENTS = ['<', '>', '"', ''']
- $settings : array<string|int, mixed>
- ascii() : string
- bytes() : string
- config() : mixed
- date() : string
- dateOperation() : string
- dateTime() : string
- dateTimeOperation() : string
- fixHtml() : string|null
- folder() : string
- folderCheckOrCreate() : bool
- folderCopy() : bool
- folderDelete() : bool
- folderScan() : array<string|int, mixed>
- folderSize() : int
- hour() : string
- lang() : Translator
- log() : MiniLog
- money() : string
- noHtml() : string|null
- number() : string
- password() : string
- randomString() : string
- settings() : mixed
- settingsClear() : void
- settingsSave() : bool
- settingsSet() : void
- siteUrl() : string
- slug() : string
- textBreak() : string
- timeToDate() : string
- timeToDateTime() : string
- settingsLoad() : void
Constants
ASCII
public
mixed
ASCII
= ['Š' => 'S', 'š' => 's', 'Đ' => 'Dj', 'đ' => 'dj', 'Ž' => 'Z', 'ž' => 'z', 'Č' => 'C', 'č' => 'c', 'Ć' => 'C', 'ć' => 'c', 'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'A', 'Å' => 'A', 'Æ' => 'A', 'Ç' => 'C', 'È' => 'E', 'É' => 'E', 'Ê' => 'E', 'Ë' => 'E', 'Ì' => 'I', 'Í' => 'I', 'Î' => 'I', 'Ï' => 'I', 'Ñ' => 'N', 'Ò' => 'O', 'Ó' => 'O', 'Ô' => 'O', 'Õ' => 'O', 'Ö' => 'O', 'Ø' => 'O', 'Ù' => 'U', 'Ú' => 'U', 'Û' => 'U', 'Ü' => 'U', 'Ý' => 'Y', 'Þ' => 'B', 'ß' => 'Ss', 'à' => 'a', 'á' => 'a', 'â' => 'a', 'ã' => 'a', 'ä' => 'a', 'å' => 'a', 'æ' => 'a', 'ç' => 'c', 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e', 'ì' => 'i', 'í' => 'i', 'î' => 'i', 'ï' => 'i', 'ð' => 'o', 'ñ' => 'n', 'ò' => 'o', 'ó' => 'o', 'ô' => 'o', 'õ' => 'o', 'ö' => 'o', 'ø' => 'o', 'ù' => 'u', 'ú' => 'u', 'û' => 'u', 'ý' => 'y', 'þ' => 'b', 'ÿ' => 'y', 'Ŕ' => 'R', 'ŕ' => 'r']
DATE_STYLE
public
mixed
DATE_STYLE
= 'd-m-Y'
DATETIME_STYLE
public
mixed
DATETIME_STYLE
= 'd-m-Y H:i:s'
HOUR_STYLE
public
mixed
HOUR_STYLE
= 'H:i:s'
HTML_CHARS
public
mixed
HTML_CHARS
= ['<', '>', '"', "'"]
HTML_REPLACEMENTS
public
mixed
HTML_REPLACEMENTS
= ['<', '>', '"', ''']
Properties
$settings
private
static array<string|int, mixed>
$settings
Methods
ascii()
public
static ascii(string $text) : string
Parameters
- $text : string
Return values
string —bytes()
public
static bytes(mixed $size[, int $decimals = 2 ]) : string
Parameters
- $size : mixed
- $decimals : int = 2
Return values
string —config()
public
static config(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
- $default : mixed = null
Return values
mixed —date()
public
static date([string|null $date = null ]) : string
Parameters
- $date : string|null = null
Return values
string —dateOperation()
public
static dateOperation(string $date, string $operation) : string
Parameters
- $date : string
- $operation : string
Return values
string —dateTime()
public
static dateTime([string|null $date = null ]) : string
Parameters
- $date : string|null = null
Return values
string —dateTimeOperation()
public
static dateTimeOperation(string $date, string $operation) : string
Parameters
- $date : string
- $operation : string
Return values
string —fixHtml()
public
static fixHtml([string|null $text = null ]) : string|null
Parameters
- $text : string|null = null
Return values
string|null —folder()
public
static folder(mixed ...$folders) : string
Parameters
- $folders : mixed
Return values
string —folderCheckOrCreate()
public
static folderCheckOrCreate(string $folder) : bool
Parameters
- $folder : string
Return values
bool —folderCopy()
public
static folderCopy(string $src, string $dst) : bool
Parameters
- $src : string
- $dst : string
Return values
bool —folderDelete()
public
static folderDelete(string $folder) : bool
Parameters
- $folder : string
Return values
bool —folderScan()
public
static folderScan(string $folder[, bool $recursive = false ][, array<string|int, mixed> $exclude = ['.DS_Store', '.well-known'] ]) : array<string|int, mixed>
Parameters
- $folder : string
- $recursive : bool = false
- $exclude : array<string|int, mixed> = ['.DS_Store', '.well-known']
Return values
array<string|int, mixed> —folderSize()
public
static folderSize(string $folder[, array<string|int, mixed> $exclude = ['.DS_Store', '.well-known'] ]) : int
Parameters
- $folder : string
- $exclude : array<string|int, mixed> = ['.DS_Store', '.well-known']
Return values
int —hour()
public
static hour([string|null $date = null ]) : string
Parameters
- $date : string|null = null
Return values
string —lang()
public
static lang([string|null $lang = '' ]) : Translator
Parameters
- $lang : string|null = ''
Return values
Translator —log()
public
static log([string $channel = '' ]) : MiniLog
Parameters
- $channel : string = ''
Return values
MiniLog —money()
public
static money(float|null $number[, string $coddivisa = '' ][, int|null $decimals = null ]) : string
Parameters
- $number : float|null
- $coddivisa : string = ''
- $decimals : int|null = null
Return values
string —noHtml()
public
static noHtml(string|null $text) : string|null
Parameters
- $text : string|null
Return values
string|null —number()
public
static number(float|null $number[, int|null $decimals = null ]) : string
Parameters
- $number : float|null
- $decimals : int|null = null
Return values
string —password()
public
static password([int $length = 10 ]) : string
Parameters
- $length : int = 10
Return values
string —randomString()
public
static randomString([int $length = 10 ]) : string
Parameters
- $length : int = 10
Return values
string —settings()
public
static settings(string $group, string $key[, mixed $default = null ]) : mixed
Parameters
- $group : string
- $key : string
- $default : mixed = null
Return values
mixed —settingsClear()
public
static settingsClear() : void
Return values
void —settingsSave()
public
static settingsSave() : bool
Return values
bool —settingsSet()
public
static settingsSet(string $group, string $key, mixed $value) : void
Parameters
- $group : string
- $key : string
- $value : mixed
Return values
void —siteUrl()
public
static siteUrl() : string
Return values
string —slug()
public
static slug(string $text[, string $separator = '-' ], int $maxLength) : string
Parameters
- $text : string
- $separator : string = '-'
- $maxLength : int
Return values
string —textBreak()
public
static textBreak(string|null $text[, int $length = 50 ][, string $break = '...' ]) : string
Parameters
- $text : string|null
- $length : int = 50
- $break : string = '...'
Return values
string —timeToDate()
public
static timeToDate(int $time) : string
Parameters
- $time : int
Return values
string —timeToDateTime()
public
static timeToDateTime(int $time) : string
Parameters
- $time : int
Return values
string —settingsLoad()
private
static settingsLoad() : void