| @@ 1101-1112 (lines=12) @@ | ||
| 1098 | $this->defaultCommand = $commandName; |
|
| 1099 | } |
|
| 1100 | ||
| 1101 | private function stringWidth($string) |
|
| 1102 | { |
|
| 1103 | if (!function_exists('mb_strwidth')) { |
|
| 1104 | return strlen($string); |
|
| 1105 | } |
|
| 1106 | ||
| 1107 | if (false === $encoding = mb_detect_encoding($string)) { |
|
| 1108 | return strlen($string); |
|
| 1109 | } |
|
| 1110 | ||
| 1111 | return mb_strwidth($string, $encoding); |
|
| 1112 | } |
|
| 1113 | ||
| 1114 | private function splitStringByWidth($string, $width) |
|
| 1115 | { |
|
| @@ 52-63 (lines=12) @@ | ||
| 49 | * |
|
| 50 | * @return int The length of the string |
|
| 51 | */ |
|
| 52 | public static function strlen($string) |
|
| 53 | { |
|
| 54 | if (!function_exists('mb_strwidth')) { |
|
| 55 | return strlen($string); |
|
| 56 | } |
|
| 57 | ||
| 58 | if (false === $encoding = mb_detect_encoding($string)) { |
|
| 59 | return strlen($string); |
|
| 60 | } |
|
| 61 | ||
| 62 | return mb_strwidth($string, $encoding); |
|
| 63 | } |
|
| 64 | ||
| 65 | public static function formatTime($secs) |
|
| 66 | { |
|