Revize 18ac9009
Přidáno uživatelem Ondřej Fibich před asi 9 roky(ů)
application/helpers/file.php | ||
---|---|---|
$p = explode('.',$filename);
|
||
return strtolower($p[count($p)-1]);
|
||
}
|
||
|
||
public static function shortened_size_to_bytes($size)
|
||
{
|
||
$size = strtolower($size);
|
||
$last = substr($size, -1);
|
||
if ($last == 'b')
|
||
{
|
||
$size = substr($size, 0, -1);
|
||
}
|
||
|
||
$last = substr($size, -1);
|
||
switch ($last)
|
||
{
|
||
case 't':
|
||
$size *= 1024;
|
||
case 'g':
|
||
$size *= 1024;
|
||
case 'm':
|
||
$size *= 1024;
|
||
case 'k':
|
||
$size *= 1024;
|
||
}
|
||
|
||
return $size;
|
||
}
|
||
|
||
} // End file
|
Také k dispozici: Unified diff
Fix merge issue that removed all staff from developer branch :-).