Add comments to Utils class
This commit is contained in:
parent
94026b5669
commit
b1a6f6698e
|
|
@ -7,17 +7,31 @@ use PhpSpec\Exception\Exception;
|
|||
|
||||
class Utils
|
||||
{
|
||||
|
||||
/**
|
||||
* Check if the current user is registered
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isRegistered()
|
||||
{
|
||||
return Auth::check() && Auth::user()->is_registered;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the current user is confirmed
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isConfirmed()
|
||||
{
|
||||
return Auth::check() && Auth::user()->is_confirmed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the DB has been set up
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isDatabaseSetup()
|
||||
{
|
||||
try {
|
||||
|
|
@ -90,6 +104,11 @@ class Utils
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine max upload size
|
||||
*
|
||||
* @return float|int
|
||||
*/
|
||||
public static function file_upload_max_size()
|
||||
{
|
||||
static $max_size = -1;
|
||||
|
|
@ -109,6 +128,12 @@ class Utils
|
|||
return $max_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses the given size
|
||||
*
|
||||
* @param $size
|
||||
* @return float
|
||||
*/
|
||||
public static function parse_size($size)
|
||||
{
|
||||
$unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size.
|
||||
|
|
|
|||
Loading…
Reference in New Issue