\ToolsCore

Summary

Methods
Properties
Constants
passwdGen()
strReplaceFirst()
redirect()
redirectLink()
redirectAdmin()
getShopProtocol()
getProtocol()
getHttpHost()
getShopDomain()
getShopDomainSsl()
getServerName()
getRemoteAddr()
usingSecureMode()
getCurrentUrlProtocolPrefix()
secureReferrer()
getValue()
getIsset()
setCookieLanguage()
switchLanguage()
getCountry()
setCurrency()
displayPrice()
displayNumber()
displayPriceSmarty()
convertPrice()
convertPriceFull()
dateFormat()
displayDate()
safeOutput()
htmlentitiesUTF8()
htmlentitiesDecodeUTF8()
safePostVars()
deleteDirectory()
deleteFile()
clearXMLCache()
displayError()
dieObject()
fd()
d()
debug_backtrace()
p()
isSubmit()
getMetaTags()
getHomeMetaTags()
completeMetaTags()
encrypt()
encryptIV()
getToken()
getAdminToken()
getAdminTokenLite()
getAdminTokenLiteSmarty()
getAdminUrl()
getAdminImageUrl()
getPath()
getFullPath()
link_rewrite()
str2url()
replaceAccentedChars()
truncate()
truncateString()
normalizeDirectory()
dateYears()
dateDays()
dateMonths()
hourGenerate()
dateFrom()
dateTo()
strtolower()
strlen()
stripslashes()
strtoupper()
substr()
strpos()
strrpos()
ucfirst()
ucwords()
orderbyPrice()
iconv()
isEmpty()
ps_round()
math_round()
round_helper()
ceilf()
floorf()
file_exists_cache()
file_exists_no_cache()
file_get_contents()
simplexml_load_file()
copy()
minifyHTML()
toCamelCase()
toUnderscoreCase()
getBrightness()
minifyHTMLpregCallback()
packJSinHTML()
packJSinHTMLpregCallback()
packJS()
parserSQL()
minifyCSS()
replaceByAbsoluteURL()
addJS()
addCSS()
cccCss()
cccJS()
getMediaServer()
generateHtaccess()
generateIndex()
getDefaultIndexContent()
jsonDecode()
jsonEncode()
displayAsDeprecated()
displayParameterAsDeprecated()
displayFileAsDeprecated()
enableCache()
restoreCacheSettings()
isCallable()
pRegexp()
str_replace_once()
property_exists()
checkPhpVersion()
ZipTest()
getSafeModeStatus()
ZipExtract()
chmodr()
getProductsOrder()
convertBytes()
display404Error()
url()
dieOrLog()
nl2br()
clearCache()
clearCompile()
clearSmartyCache()
clearColorListCache()
getMemoryLimit()
getOctets()
isX86_64arch()
isPHPCLI()
argvToGET()
getMaxUploadSize()
apacheModExists()
recurseCopy()
scandir()
version_compare()
alignVersionNumber()
modRewriteActive()
unSerialize()
arrayUnique()
cleanNonUnicodeSupport()
addonsRequest()
fileAttachment()
changeFileMTime()
waitUntilFileIsModified()
rtrimString()
formatBytes()
boolVal()
getUserPlatform()
getUserBrowser()
getDescriptionClean()
purifyHTML()
$round_mode
No constants found
throwDeprecated()
$file_exists_cache
$_forceCompile
$_caching
$_user_plateform
$_user_browser
$_cache_nb_media_servers
$is_addons_up
N/A
No private methods found
No private properties found
N/A

Properties

$round_mode

$round_mode : 

Type

$file_exists_cache

$file_exists_cache : 

Type

$_forceCompile

$_forceCompile : 

Type

$_caching

$_caching : 

Type

$_user_plateform

$_user_plateform : 

Type

$_user_browser

$_user_browser : 

Type

$_cache_nb_media_servers

$_cache_nb_media_servers : 

Type

$is_addons_up

$is_addons_up : 

Type

Methods

passwdGen()

passwdGen(integer  $length = 8, string  $flag = 'ALPHANUMERIC') : string

Random password generator

Parameters

integer $length

Desired length (optional)

string $flag

Output type (NUMERIC, ALPHANUMERIC, NO_NUMERIC)

Returns

string —

Password

strReplaceFirst()

strReplaceFirst(  $search,   $replace,   $subject,   $cur) 

Parameters

$search
$replace
$subject
$cur

redirect()

redirect(string  $url,   $base_uri = __PS_BASE_URI__, \Link  $link = null, string|array  $headers = null) 

Redirect user to another page

Parameters

string $url

Desired URL

$base_uri
\Link $link
string|array $headers

A list of headers to send before redirection

redirectLink()

redirectLink(string  $url) 

Redirect URLs already containing PS_BASE_URI

Parameters

string $url

Desired URL

redirectAdmin()

redirectAdmin(string  $url) 

Redirect user to another admin page

Parameters

string $url

Desired URL

getShopProtocol()

getShopProtocol() : String

getShopProtocol return the available protocol for the current shop in use SSL if Configuration is set on and available for the server

Returns

String

getProtocol()

getProtocol(boolean  $use_ssl = null) : String

getProtocol return the set protocol according to configuration (http[s])

Parameters

boolean $use_ssl

true if require ssl

Returns

String —

(http|https)

getHttpHost()

getHttpHost(boolean  $http = false, boolean  $entities = false,   $ignore_port = false) : string

getHttpHost return the <b>current</b> host used, with the protocol (http or https) if $http is true This function should not be used to choose http or https domain name.

Use Tools::getShopDomain() or Tools::getShopDomainSsl instead

Parameters

boolean $http
boolean $entities
$ignore_port

Returns

string —

host

getShopDomain()

getShopDomain(boolean  $http = false, boolean  $entities = false) : string

getShopDomain returns domain name according to configuration and ignoring ssl

Parameters

boolean $http

if true, return domain name with protocol

boolean $entities

if true,

Returns

string —

domain

getShopDomainSsl()

getShopDomainSsl(boolean  $http = false, boolean  $entities = false) : string

getShopDomainSsl returns domain name according to configuration and depending on ssl activation

Parameters

boolean $http

if true, return domain name with protocol

boolean $entities

if true,

Returns

string —

domain

getServerName()

getServerName() : string

Get the server variable SERVER_NAME

Returns

string —

server name

getRemoteAddr()

getRemoteAddr() : string

Get the server variable REMOTE_ADDR, or the first ip of HTTP_X_FORWARDED_FOR (when using proxy)

Returns

string —

$remote_addr ip of client

usingSecureMode()

usingSecureMode() : boolean

Check if the current page use SSL connection on not

Returns

boolean —

uses SSL

getCurrentUrlProtocolPrefix()

getCurrentUrlProtocolPrefix() : string

Get the current url prefix protocol (https/http)

Returns

string —

protocol

secureReferrer()

secureReferrer(string  $referrer) : string

Secure an URL referrer

Parameters

string $referrer

URL referrer

Returns

string —

secured referrer

getValue()

getValue(string  $key, mixed  $default_value = false) : mixed

Get a value from $_POST / $_GET if unavailable, take a default value

Parameters

string $key

Value key

mixed $default_value

(optional)

Returns

mixed —

Value

getIsset()

getIsset(  $key) 

Parameters

$key

setCookieLanguage()

setCookieLanguage(  $cookie = null) : string

Change language in cookie while clicking on a flag

Parameters

$cookie

Returns

string —

iso code

switchLanguage()

switchLanguage(\Context  $context = null) 

Set cookie id_lang

Parameters

\Context $context

getCountry()

getCountry(  $address = null) 

Parameters

$address

setCurrency()

setCurrency(  $cookie) : \Currency

Set cookie currency from POST or default currency

Parameters

$cookie

Returns

\Currency —

object

displayPrice()

displayPrice(float  $price, object|array  $currency = null,   $no_utf8 = false, \Context  $context = null) : string

Return price with currency sign for a given product

Parameters

float $price

Product price

object|array $currency

Current currency (object, id_currency, NULL => context currency)

$no_utf8
\Context $context

Returns

string —

Price correctly formated (sign, decimal separator...)

displayNumber()

displayNumber(  $number,   $currency) 

Parameters

$number
$currency

displayPriceSmarty()

displayPriceSmarty(  $params,   $smarty) 

Parameters

$params
$smarty

convertPrice()

convertPrice(float  $price, object|array  $currency = null, boolean  $to_currency = true, \Context  $context = null) : float

Return price converted

Parameters

float $price

Product price

object|array $currency

Current currency object

boolean $to_currency

convert to currency or from currency to default currency

\Context $context

Returns

float —

Price

convertPriceFull()

convertPriceFull(float  $amount, \Currency  $currency_from = null, \Currency  $currency_to = null) 

Convert amount from a currency to an other currency automatically

Parameters

float $amount
\Currency $currency_from

if null we used the default currency

\Currency $currency_to

if null we used the default currency

dateFormat()

dateFormat(array  $params, object  $smarty) : string

Display date regarding to language preferences

Parameters

array $params

Date, format...

object $smarty

Smarty object for language preferences

Returns

string —

Date

displayDate()

displayDate(string  $date, integer  $id_lang = null, boolean  $full = false, string  $separator = null) : string

Display date regarding to language preferences

Parameters

string $date

Date to display format UNIX

integer $id_lang

Language id DEPRECATED

boolean $full

With time or not (optional)

string $separator

DEPRECATED

Returns

string —

Date

safeOutput()

safeOutput(string  $string,   $html = false) : string

Sanitize a string

Parameters

string $string

String to sanitize

$html

Returns

string —

Sanitized string

htmlentitiesUTF8()

htmlentitiesUTF8(  $string,   $type = ENT_QUOTES) 

Parameters

$string
$type

htmlentitiesDecodeUTF8()

htmlentitiesDecodeUTF8(  $string) 

Parameters

$string

safePostVars()

safePostVars() 

deleteDirectory()

deleteDirectory(string  $dirname,   $delete_self = true) 

Delete directory and subdirectories

Parameters

string $dirname

Directory name

$delete_self

deleteFile()

deleteFile(  $file,   $exclude_files = array()) 

Delete file

Parameters

$file
$exclude_files

clearXMLCache()

clearXMLCache() 

Clear XML cache folder

displayError()

displayError(string  $string = 'Fatal error', boolean  $htmlentities = true, \Context  $context = null) 

Display an error according to an error code

Parameters

string $string

Error message

boolean $htmlentities

By default at true for parsing error message with htmlentities

\Context $context

dieObject()

dieObject(mixed  $object, boolean  $kill = true) : \$object

Display an error with detailed object

Parameters

mixed $object
boolean $kill

Returns

\$object —

if $kill = false;

fd()

fd(object  $object,   $type = 'log') 

Display a var dump in firebug console

Parameters

object $object

Object to display

$type

d()

d(object  $object,   $kill = true) 

ALIAS OF dieObject() - Display an error with detailed object

Parameters

object $object

Object to display

$kill

debug_backtrace()

debug_backtrace(  $start,   $limit = null) 

Parameters

$start
$limit

p()

p(object  $object) 

ALIAS OF dieObject() - Display an error with detailed object but don't stop the execution

Parameters

object $object

Object to display

isSubmit()

isSubmit(string  $submit) 

Check if submit has been posted

Parameters

string $submit

submit name

getMetaTags()

getMetaTags(  $id_lang,   $page_name,   $title = '') 

Parameters

$id_lang
$page_name
$title

getHomeMetaTags()

getHomeMetaTags(  $id_lang,   $page_name) 

Parameters

$id_lang
$page_name

completeMetaTags()

completeMetaTags(  $meta_tags,   $default_value, \Context  $context = null) 

Parameters

$meta_tags
$default_value
\Context $context

encrypt()

encrypt(string  $passwd) 

Encrypt password

Parameters

string $passwd

String to encrypt

encryptIV()

encryptIV(string  $data) 

Encrypt data string

Parameters

string $data

String to encrypt

getToken()

getToken(  $page = true, \Context  $context = null) 

Get token to prevent CSRF

Parameters

$page
\Context $context

getAdminToken()

getAdminToken(string  $string) 

Tokenize a string

Parameters

string $string

string to encript

getAdminTokenLite()

getAdminTokenLite(  $tab, \Context  $context = null) 

Parameters

$tab
\Context $context

getAdminTokenLiteSmarty()

getAdminTokenLiteSmarty(  $params,   $smarty) 

Parameters

$params
$smarty

getAdminUrl()

getAdminUrl(string  $url = null,   $entities = false) 

Get a valid URL to use from BackOffice

Parameters

string $url

An URL to use in BackOffice

$entities

getAdminImageUrl()

getAdminImageUrl(string  $image = null,   $entities = false) 

Get a valid image URL to use from BackOffice

Parameters

string $image

Image name

$entities

getPath()

getPath(integer  $id_category, string  $path = '',   $link_on_the_item = false,   $category_type = 'products', \Context  $context = null) 

Get the user's journey

Parameters

integer $id_category

Category ID

string $path

Path end

$link_on_the_item
$category_type
\Context $context

getFullPath()

getFullPath(  $id_category,   $end,   $type_cat = 'products', \Context  $context = null) 

Parameters

$id_category
$end
$type_cat
\Context $context

link_rewrite()

link_rewrite(string  $str, boolean  $utf8_decode = null) : string

Return the friendly url from the provided string

Parameters

string $str
boolean $utf8_decode

(deprecated)

Returns

string

str2url()

str2url(string  $str) : string

Return a friendly url made from the provided string If the mbstring library is available, the output is the same as the js function of the same name

Parameters

string $str

Returns

string

replaceAccentedChars()

replaceAccentedChars(string  $str) : string

Replace all accented chars by their equivalent non accented chars.

Parameters

string $str

Returns

string

truncate()

truncate(  $str,   $max_length,   $suffix = '...') 

Parameters

$str
$max_length
$suffix

truncateString()

truncateString(  $text,   $length = 120,   $options = array()) 

Parameters

$text
$length
$options

normalizeDirectory()

normalizeDirectory(  $directory) 

Parameters

$directory

dateYears()

dateYears() : array

Generate date form

Returns

array —

$tab html data with 3 cells :['days'], ['months'], ['years']

dateDays()

dateDays() 

dateMonths()

dateMonths() 

hourGenerate()

hourGenerate(  $hours,   $minutes,   $seconds) 

Parameters

$hours
$minutes
$seconds

dateFrom()

dateFrom(  $date) 

Parameters

$date

dateTo()

dateTo(  $date) 

Parameters

$date

strtolower()

strtolower(  $str) 

Parameters

$str

strlen()

strlen(  $str,   $encoding = 'UTF-8') 

Parameters

$str
$encoding

stripslashes()

stripslashes(  $string) 

Parameters

$string

strtoupper()

strtoupper(  $str) 

Parameters

$str

substr()

substr(  $str,   $start,   $length = false,   $encoding = 'utf-8') 

Parameters

$str
$start
$length
$encoding

strpos()

strpos(  $str,   $find,   $offset,   $encoding = 'UTF-8') 

Parameters

$str
$find
$offset
$encoding

strrpos()

strrpos(  $str,   $find,   $offset,   $encoding = 'utf-8') 

Parameters

$str
$find
$offset
$encoding

ucfirst()

ucfirst(  $str) 

Parameters

$str

ucwords()

ucwords(  $str) 

Parameters

$str

orderbyPrice()

orderbyPrice(  $array,   $order_way) 

Parameters

$array
$order_way

iconv()

iconv(  $from,   $to,   $string) 

Parameters

$from
$to
$string

isEmpty()

isEmpty(  $field) 

Parameters

$field

ps_round()

ps_round(float  $value, integer  $precision) : float

returns the rounded value of $value to specified precision, according to your configuration;

Parameters

float $value
integer $precision

Returns

float

math_round()

math_round(  $value,   $places,   $mode = PS_ROUND_HALF_UP) 

Parameters

$value
$places
$mode

round_helper()

round_helper(  $value,   $mode) 

Parameters

$value
$mode

ceilf()

ceilf(float  $value, integer  $precision) : float

returns the rounded value down of $value to specified precision

Parameters

float $value
integer $precision

Returns

float

floorf()

floorf(float  $value, integer  $precision) : float

returns the rounded value up of $value to specified precision

Parameters

float $value
integer $precision

Returns

float

file_exists_cache()

file_exists_cache(string  $filename) : boolean

file_exists() wrapper with cache to speedup performance

Parameters

string $filename

File name

Returns

boolean —

Cached result of file_exists($filename)

file_exists_no_cache()

file_exists_no_cache(string  $filename) : boolean

file_exists() wrapper with a call to clearstatcache prior

Parameters

string $filename

File name

Returns

boolean —

Cached result of file_exists($filename)

file_get_contents()

file_get_contents(  $url,   $use_include_path = false,   $stream_context = null,   $curl_timeout = 5) 

Parameters

$url
$use_include_path
$stream_context
$curl_timeout

simplexml_load_file()

simplexml_load_file(  $url,   $class_name = null) 

Parameters

$url
$class_name

copy()

copy(  $source,   $destination,   $stream_context = null) 

Parameters

$source
$destination
$stream_context

minifyHTML()

minifyHTML(  $html_content) 

Parameters

$html_content

toCamelCase()

toCamelCase(  $str,   $catapitalise_first_char = false) 

Translates a string with underscores into camel case (e.g. first_name -> firstName)

Parameters

$str
$catapitalise_first_char

toUnderscoreCase()

toUnderscoreCase(string  $string) : string

Transform a CamelCase string to underscore_case string

Parameters

string $string

Returns

string

getBrightness()

getBrightness(  $hex) 

Parameters

$hex

minifyHTMLpregCallback()

minifyHTMLpregCallback(  $preg_matches) 

Parameters

$preg_matches

packJSinHTML()

packJSinHTML(  $html_content) 

Parameters

$html_content

packJSinHTMLpregCallback()

packJSinHTMLpregCallback(  $preg_matches) 

Parameters

$preg_matches

packJS()

packJS(  $js_content) 

Parameters

$js_content

parserSQL()

parserSQL(  $sql) 

Parameters

$sql

minifyCSS()

minifyCSS(  $css_content,   $fileuri = false) 

Parameters

$css_content
$fileuri

replaceByAbsoluteURL()

replaceByAbsoluteURL(  $matches) 

Parameters

$matches

addJS()

addJS(mixed  $js_uri) : void

addJS load a javascript file in the header

Parameters

mixed $js_uri

addCSS()

addCSS(  $css_uri,   $css_media_type = 'all') 

Parameters

$css_uri
$css_media_type

cccCss()

cccCss(  $css_files) 

Parameters

$css_files

cccJS()

cccJS(  $js_files) 

Parameters

$js_files

getMediaServer()

getMediaServer(  $filename) 

Parameters

$filename

generateHtaccess()

generateHtaccess(  $path = null,   $rewrite_settings = null,   $cache_control = null,   $specific = '',   $disable_multiviews = null,   $medias = false,   $disable_modsec = null) 

Parameters

$path
$rewrite_settings
$cache_control
$specific
$disable_multiviews
$medias
$disable_modsec

generateIndex()

generateIndex() 

getDefaultIndexContent()

getDefaultIndexContent() 

jsonDecode()

jsonDecode(string  $json, boolean  $assoc = false) : array

jsonDecode convert json string to php array / object

Parameters

string $json
boolean $assoc

(since 1.4.2.4) if true, convert to associativ array

Returns

array

jsonEncode()

jsonEncode(array  $data) : string

Convert an array to json string

Parameters

array $data

Returns

string —

json

displayAsDeprecated()

displayAsDeprecated(  $message = null) 

Display a warning message indicating that the method is deprecated

Parameters

$message

displayParameterAsDeprecated()

displayParameterAsDeprecated(  $parameter) 

Display a warning message indicating that the parameter is deprecated

Parameters

$parameter

displayFileAsDeprecated()

displayFileAsDeprecated() 

enableCache()

enableCache(  $level = 1, \Context  $context = null) 

Parameters

$level
\Context $context

restoreCacheSettings()

restoreCacheSettings(\Context  $context = null) 

Parameters

\Context $context

isCallable()

isCallable(  $function) 

Parameters

$function

pRegexp()

pRegexp(  $s,   $delim) 

Parameters

$s
$delim

str_replace_once()

str_replace_once(  $needle,   $replace,   $haystack) 

Parameters

$needle
$replace
$haystack

property_exists()

property_exists(  $class, string  $property) : boolean

Function property_exists does not exist in PHP < 5.1

Parameters

$class
string $property

Returns

boolean

checkPhpVersion()

checkPhpVersion() : string

Returns

string

ZipTest()

ZipTest(  $from_file) : boolean

Parameters

$from_file

Returns

boolean —

success

getSafeModeStatus()

getSafeModeStatus() 

ZipExtract()

ZipExtract(  $from_file,   $to_dir) : boolean

Parameters

$from_file
$to_dir

Returns

boolean —

success

chmodr()

chmodr(  $path,   $filemode) 

Parameters

$path
$filemode

getProductsOrder()

getProductsOrder(string  $type, string  $value = null, boolean|\bool(false)|string  $prefix = false) : string

Get products order field name for queries.

Parameters

string $type

by|way

string $value

If no index given, use default order from admin -> pref -> products

boolean|\bool(false)|string $prefix

Returns

string —

Order by sql clause

convertBytes()

convertBytes(string  $value) : integer

Convert a shorthand byte value from a PHP configuration directive to an integer value

Parameters

string $value

value to convert

Returns

integer

display404Error()

display404Error() 

url()

url(string  $begin, string  $end) : string

Concat $begin and $end, add ? or & between strings

Parameters

string $begin
string $end

Returns

string

dieOrLog()

dieOrLog(string  $msg, boolean  $die = true) : boolean

Display error and dies or silently log the error.

Parameters

string $msg
boolean $die

Returns

boolean —

success of logging

nl2br()

nl2br(  $str) : string

Convert \n and \r\n and \r to <br />

Parameters

$str

Returns

string —

New string

clearCache()

clearCache(\Smarty  $smarty = null,   $tpl = false,   $cache_id = null,   $compile_id = null) 

Clear cache for Smarty

Parameters

\Smarty $smarty
$tpl
$cache_id
$compile_id

clearCompile()

clearCompile(  $smarty = null) 

Clear compile for Smarty

Parameters

$smarty

clearSmartyCache()

clearSmartyCache() 

Clear Smarty cache and compile folders

clearColorListCache()

clearColorListCache(  $id_product = false) 

Parameters

$id_product

getMemoryLimit()

getMemoryLimit() : integer

getMemoryLimit allow to get the memory limit in octet

Returns

integer —

the memory limit value in octet

getOctets()

getOctets(  $option) : integer

getOctet allow to gets the value of a configuration option in octet

Parameters

$option

Returns

integer —

the value of a configuration option in octet

isX86_64arch()

isX86_64arch() : boolean

Returns

boolean —

true if the server use 64bit arch

isPHPCLI()

isPHPCLI() : boolean

Returns

boolean —

true if php-cli is used

argvToGET()

argvToGET(  $argc,   $argv) 

Parameters

$argc
$argv

getMaxUploadSize()

getMaxUploadSize(integer  $max_size) : integer

Get max file upload size considering server settings and optional max value

Parameters

integer $max_size

optional max file size

Returns

integer —

max file size in bytes

apacheModExists()

apacheModExists(string  $name) : boolean

apacheModExists return true if the apache module $name is loaded

Parameters

string $name

module name

Returns

boolean —

true if exists

recurseCopy()

recurseCopy(  $src,   $dst, boolean  $del = false) 

Copy the folder $src into $dst, $dst is created if it do not exist

Parameters

$src
$dst
boolean $del

if true, delete the file after copy

scandir()

scandir(  $path,   $ext = 'php',   $dir = '',   $recursive = false) : array

Parameters

$path
$ext
$dir
$recursive

Returns

array —

List of file found

version_compare()

version_compare(  $v1,   $v2, string  $operator = '<') : mixed

Align version sent and use internal function

Parameters

$v1
$v2
string $operator

Returns

mixed

alignVersionNumber()

alignVersionNumber(  $v1,   $v2) 

Align 2 version with the same number of sub version version_compare will work better for its comparison :) (Means: '1.8' to '1.9.3' will change '1.8' to '1.8.0')

Parameters

$v1
$v2

modRewriteActive()

modRewriteActive() 

unSerialize()

unSerialize(  $serialized,   $object = false) 

Parameters

$serialized
$object

arrayUnique()

arrayUnique(array  $array) : array

Reproduce array_unique working before php version 5.2.9

Parameters

array $array

Returns

array

cleanNonUnicodeSupport()

cleanNonUnicodeSupport(string  $pattern) : \pattern

Delete unicode class from regular expression patterns

Parameters

string $pattern

Returns

\pattern

addonsRequest()

addonsRequest(  $request,   $params = array()) 

Parameters

$request
$params

fileAttachment()

fileAttachment(  $input = 'fileUpload') 

Parameters

$input

changeFileMTime()

changeFileMTime(  $file_name) 

Parameters

$file_name

waitUntilFileIsModified()

waitUntilFileIsModified(  $file_name,   $timeout = 180) 

Parameters

$file_name
$timeout

rtrimString()

rtrimString(string  $str, string  $str_search) : string

Delete a substring from another one starting from the right

Parameters

string $str
string $str_search

Returns

string

formatBytes()

formatBytes(  $size, integer  $precision = 2) : string

Format a number into a human readable format e.g. 24962496 => 23.81M

Parameters

$size
integer $precision

Returns

string

boolVal()

boolVal(  $value) 

Parameters

$value

getUserPlatform()

getUserPlatform() 

getUserBrowser()

getUserBrowser() 

getDescriptionClean()

getDescriptionClean(  $description) : string

Allows to display the category description without HTML tags and slashes

Parameters

$description

Returns

string

purifyHTML()

purifyHTML(  $html) 

Parameters

$html

throwDeprecated()

throwDeprecated(  $error,   $message,   $class) 

Parameters

$error
$message
$class