JUtility

JUtility is a utility functions class

package

Joomla.Platform

subpackage

Utilities

since

11.1

Methods

array_unshift_ref

Prepend a reference to an element to the beginning of an array.

array_unshift_ref( &$array,  &$value) : integer
deprecated

Renumbers numeric keys, so $value is always inserted to $array[0]

deprecated

12.1

see

http://www.php.net/manual/en/function.array-unshift.php#40270

note

PHP no longer supports array_unshift of references.

since

11.1

Arguments

$array

$value

Response

integer

dump

Method to dump the structure of a variable for debugging purposes

dump( &$var, boolean $htmlSafe = true) : string
static deprecated
deprecated

12.1

since

11.1

Arguments

$var

$htmlSafe

booleanTrue to ensure all characters are htmlsafe

Response

string

getHash

Provides a secure hash based on a seed

getHash(string $seed) : string
static deprecated
deprecated

12.1 Use JApplication::getHash() instead.

see \JApplication::getHash()
since

11.1

Arguments

$seed

stringSeed string.

Response

string

getToken

Method to determine a hash for anti-spoofing variable names

getToken(boolean $forceNew = false) : string
static deprecated
deprecated

12.1 Use JSession::getFormToken() instead

see \JSession::getFormToken()
since

11.1

Arguments

$forceNew

booleanForce creation of a new token.

Response

stringHashed var name

isWinOS

Method to determine if the host OS is Windows.

isWinOS() : boolean
static deprecated
deprecated

12.1

see \JApplication::isWinOS()
since

11.1

Response

booleanTrue if Windows OS.

parseAttributes

Method to extract key/value pairs out of a string with XML style attributes

parseAttributes(string $string) : array
static
since

11.1

Arguments

$string

stringString containing XML style attributes

Response

arrayKey/Value pairs for the attributes

return_bytes

Return the byte value of a particular string

return_bytes(string $val) : integer
deprecated
deprecated

12.1

see \JHtmlNumber::bytes
since

11.1

Arguments

$val

stringString optionally with G, M or K suffix

Response

integerSize in bytes

sendAdminMail

Sends mail to administrator for approval of a user submission

sendAdminMail(string $adminName, string $adminEmail, string $email, string $type, string $title, string $author, string $url = null) : boolean
static deprecated
deprecated

12.1

see \JMail::sendAdminMail()
since

11.1

Arguments

$adminName

stringName of administrator

$adminEmail

stringEmail address of administrator

$email

string[NOT USED]

$type

stringType of item to approve

$title

stringTitle of item to approve

$author

stringAuthor of item to approve

$url

stringurl

Response

booleanTrue on success

sendMail

Mail function (uses phpMailer)

sendMail(string $from, string $fromname, mixed $recipient, string $subject, string $body, boolean $mode, mixed $cc = null, mixed $bcc = null, mixed $attachment = null, mixed $replyto = null, mixed $replytoname = null) : boolean
static deprecated
deprecated

12.1

see \JMail::sendMail()
since

11.1

Arguments

$from

stringFrom email address

$fromname

stringFrom name

$recipient

mixedRecipient email address(es)

$subject

stringEmail subject

$body

stringMessage body

$mode

booleanFalse = plain text, true = HTML

$cc

mixedCC email address(es)

$bcc

mixedBCC email address(es)

$attachment

mixedAttachment file name(s)

$replyto

mixedReply to email address(es)

$replytoname

mixedReply to name(s)

Response

booleanTrue on success