Class Util
Static class with some commodity functionality.
Namespace: hrm
Located at Util.php
Methods summary
public static
string
|
#
escapeJavaScript( string $str )
Escapes html strings generated in PHP so that they can be used as
arguments in JavaScript functions.
Escapes html strings generated in PHP so that they can be used as
arguments in JavaScript functions.
Parameters
Returns
string Conveniently formatted string.
|
public static
string
|
#
getThisPageName( )
Returns the name of current page
Returns the name of current page
Returns
string Name of current page.
|
public static
boolean
|
#
isValueInArray( array $array, mixed $value )
Alternative to the PHP function 'array_search' to find out whether a
particular value exists in an array. PHP functions mistake '0' for ''.
Alternative to the PHP function 'array_search' to find out whether a
particular value exists in an array. PHP functions mistake '0' for ''.
Parameters
- $array
- The array where to search.
- $value
- The value to look for
Returns
boolean True if the value exists in the array, false otherwise.
Todo
Is this really necessary?
|
public static
|
#
notifyRuntimeError( string $subject, string $message )
Sends an email to the admin to notify any message. It helps in
debugging strange events, and in being aware of abnormal scheduler
stops. The message is also automatically reported to log.
Sends an email to the admin to notify any message. It helps in
debugging strange events, and in being aware of abnormal scheduler
stops. The message is also automatically reported to log.
Parameters
- $subject
- A string to be appended to the email subject.
- $message
- The body of the email.
|
public static
boolean|integer
|
#
readfile_chunked( string $filename, boolean $retbytes = true )
Chunked read file. To be used instead of PHP's own readfile function to read
very large files. This should prevent memory errors.
Chunked read file. To be used instead of PHP's own readfile function to read
very large files. This should prevent memory errors.
Parameters
- $filename
- Name of the file to read.
- $retbytes
Defines whether the number of bytes read should be returned
(default: true)
Returns
boolean|integer If reading was not successful, the function returns false.
If reading was successful, the function returns the number of read bytes if
$retbytes is true, and a boolean otherwise (true if the file was closed
successfully, false otherwise).
See
http://nl.php.net/manual/en/function.readfile.php#54295
|
public static
boolean
|
#
using_IE( )
Check whether the browser is Internet Explorer.
Check whether the browser is Internet Explorer.
Returns
boolean True if the browser is IE, false otherwise.
|