public static
boolean
|
#
includeIfExists( string $path )
Includes a file if it exists
Includes a file if it exists
Parameters
Returns
boolean True if the file is found, false if not
Author
|
public static
string
|
#
asciiRand( integer $length, integer $subset = AloFramework\Common\Alo::ASCII_ALL )
Generates a string of random ASCII characters
Generates a string of random ASCII characters
Parameters
- $length
- The length of the string
- $subset
- Which subset to use - see class' ASCII_* constants
Returns
string
Author
Since
1.3
|
public static
string
|
#
getUniqid( string $hash = 'sha256', string $prefix = '', integer $entropy = 10000, boolean $rawOutput = false )
Generates a unique identifier
Generates a unique identifier
Parameters
- $hash
- Hash algorithm
- $prefix
- Prefix for the identifier
- $entropy
- Number of pseudo bytes used in entropy
- $rawOutput
- When set to true, outputs raw binary data. false outputs lowercase hexits.
Returns
string
Author
Since
1.3.3 Default $entropy value set to 10000, a warning is triggered if openssl_random_pseudo_bytes is
unable to locate a cryptographically strong algorithm.
1.3
See
https://secure.php.net/manual/en/function.hash.php
https://secure.php.net/manual/en/function.openssl-random-pseudo-bytes.php
Codecoverageignore
|
public static
boolean
|
#
includeOnceIfExists( string $path )
include_once() a file if it exists
include_once() a file if it exists
Parameters
Returns
boolean True if the file is found, false if not
Author
|
public static
boolean
|
#
isCliRequest( )
Checks if we're dealing with a CLI request
Checks if we're dealing with a CLI request
Returns
boolean
Author
|
public static
boolean
|
#
isRegularRequest( )
Checks if the request is non-ajax and non-CLI
Checks if the request is non-ajax and non-CLI
Returns
boolean
Author
Since
1.3
|
public static
mixed|null
|
#
get( mixed & $var )
Returns $var if it's set, null if it's not
Returns $var if it's set, null if it's not
Parameters
- $var
- Reference to the variable
Returns
mixed|null $var if it's set, null if it's not
|
public static
mixed|null
|
#
nullget( mixed & $var )
Returns $var if it's set and evaluates as true (a non-empty string, non-0 int etc), null otherwise
Returns $var if it's set and evaluates as true (a non-empty string, non-0 int etc), null otherwise
Parameters
- $var
- Reference to the variable
Returns
mixed|null The var or null
Author
|
public static
mixed
|
#
ifnull( mixed & $var, mixed $planB, boolean $useNullget = false )
Returns $var if it's set $planB if it's not
Returns $var if it's set $planB if it's not
Parameters
- $var
- Reference to the main variable
- $planB
- What to return if $var isn't available
- $useNullget
If set to true, will use self::nullget(), otherwise will use self::get() to
determinewhether $var is set
Returns
mixed $var if available, $planB if not
Author
|
public static
mixed
|
#
ifundefined( string $const, mixed $planB )
Returns the value of the constant with the name of $const if it's defined, $planB if it's not
Returns the value of the constant with the name of $const if it's defined, $planB if it's not
Parameters
- $const
- Constant name
- $planB
- What to return if $const isn't defined
Returns
mixed
Author
Since
1.1
|
public static
boolean
|
#
isAjaxRequest( )
Checks if the request was made via AJAX
Checks if the request was made via AJAX
Returns
boolean
Author
|
public static
string
|
#
getFingerprint( string $hashAlgo = 'sha256' )
Returns a hashed browser fingerprint
Returns a hashed browser fingerprint
Parameters
- $hashAlgo
- Hash algorithm to use
Returns
string
Author
Since
1.2
|
public static
boolean
|
#
isTraversable( mixed $input )
Checks if the variable is usable in a foreach loop
Checks if the variable is usable in a foreach loop
Parameters
Returns
boolean
Author
Since
1.2
|
public static
string|array|Traversable
|
#
unXss( string|array|Traversable $input )
Protects the input from cross-site scripting attacks
Protects the input from cross-site scripting attacks
Parameters
- $input
- The scalar input, or an array/Traversable
Returns
string|array| Traversable The escaped string. If an array or traversable was passed on, the input
withall its applicable values escaped.
Author
Since
1.3.2 ENT_SUBSTITUTE added
1.2
|