| @@ 118-132 (lines=15) @@ | ||
| 115 | } |
|
| 116 | } |
|
| 117 | ||
| 118 | private function toBytes($str) |
|
| 119 | { |
|
| 120 | $val = trim($str); |
|
| 121 | $last = strtolower($str[strlen($str) - 1]); |
|
| 122 | switch ($last) { |
|
| 123 | case 'g': |
|
| 124 | $val *= 1024; |
|
| 125 | case 'm': |
|
| 126 | $val *= 1024; |
|
| 127 | case 'k': |
|
| 128 | $val *= 1024; |
|
| 129 | } |
|
| 130 | ||
| 131 | return $val; |
|
| 132 | } |
|
| 133 | ||
| 134 | /** |
|
| 135 | * Returns array('success'=>true) or array('error'=>'error message'). |
|
| @@ 536-550 (lines=15) @@ | ||
| 533 | } |
|
| 534 | } |
|
| 535 | ||
| 536 | public static function toBytes($str) |
|
| 537 | { |
|
| 538 | $val = trim($str); |
|
| 539 | $last = strtolower($str[strlen($str) - 1]); |
|
| 540 | switch ($last) { |
|
| 541 | case 'g': |
|
| 542 | $val *= 1024; |
|
| 543 | case 'm': |
|
| 544 | $val *= 1024; |
|
| 545 | case 'k': |
|
| 546 | $val *= 1024; |
|
| 547 | } |
|
| 548 | ||
| 549 | return $val; |
|
| 550 | } |
|
| 551 | ||
| 552 | public static function toSnakeCase($camelCase) |
|
| 553 | { |
|