- Fixes issue with ucwords() function on older PHP versions
- Updates Supervisor/Daemon to strip port from site_url() when it's running on localhost inside a virtual machine :)
This commit is contained in:
@@ -76,12 +76,18 @@ class Helpers {
|
||||
static function getMaxPostSize($bytes = false) {
|
||||
$maxPostSize = ini_get('post_max_size');
|
||||
if(!$bytes) return $maxPostSize;
|
||||
switch (substr ($maxPostSize, -1))
|
||||
{
|
||||
case 'M': case 'm': return (int)$maxPostSize * 1048576;
|
||||
case 'K': case 'k': return (int)$maxPostSize * 1024;
|
||||
case 'G': case 'g': return (int)$maxPostSize * 1073741824;
|
||||
default: return $maxPostSize;
|
||||
switch (substr($maxPostSize, -1)) {
|
||||
case 'M':
|
||||
case 'm':
|
||||
return (int) $maxPostSize * 1048576;
|
||||
case 'K':
|
||||
case 'k':
|
||||
return (int) $maxPostSize * 1024;
|
||||
case 'G':
|
||||
case 'g':
|
||||
return (int) $maxPostSize * 1073741824;
|
||||
default:
|
||||
return $maxPostSize;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,4 +170,12 @@ class Helpers {
|
||||
}
|
||||
return $resultArray;
|
||||
}
|
||||
|
||||
static function underscoreToCamelCase($str, $capitalise_first_char = false) {
|
||||
if($capitalise_first_char) {
|
||||
$str[0] = strtoupper($str[0]);
|
||||
}
|
||||
$func = create_function('$c', 'return strtoupper($c[1]);');
|
||||
return preg_replace_callback('/_([a-z])/', $func, $str);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user