Taufan Aditya | 7756af5 | 2012-05-15 23:57:05 +0700 | [diff] [blame] | 1 | <?php |
| 2 | |
| 3 | class Mock_Core_Utf8 extends CI_Utf8 { |
Andrey Andreev | f243ce1 | 2012-06-09 23:34:21 +0300 | [diff] [blame] | 4 | |
Taufan Aditya | 7756af5 | 2012-05-15 23:57:05 +0700 | [diff] [blame] | 5 | /** |
Andrey Andreev | f243ce1 | 2012-06-09 23:34:21 +0300 | [diff] [blame] | 6 | * We need to define several constants as |
Taufan Aditya | 7756af5 | 2012-05-15 23:57:05 +0700 | [diff] [blame] | 7 | * the same process within CI_Utf8 class constructor. |
| 8 | * |
| 9 | * @covers CI_Utf8::__construct() |
| 10 | */ |
| 11 | public function __construct() |
| 12 | { |
Andrey Andreev | f243ce1 | 2012-06-09 23:34:21 +0300 | [diff] [blame] | 13 | defined('UTF8_ENABLED') OR define('UTF8_ENABLED', TRUE); |
Taufan Aditya | 7756af5 | 2012-05-15 23:57:05 +0700 | [diff] [blame] | 14 | |
| 15 | if (extension_loaded('mbstring')) |
| 16 | { |
Andrey Andreev | f243ce1 | 2012-06-09 23:34:21 +0300 | [diff] [blame] | 17 | defined('MB_ENABLED') OR define('MB_ENABLED', TRUE); |
Taufan Aditya | 7756af5 | 2012-05-15 23:57:05 +0700 | [diff] [blame] | 18 | mb_internal_encoding('UTF-8'); |
| 19 | } |
| 20 | else |
| 21 | { |
Andrey Andreev | f243ce1 | 2012-06-09 23:34:21 +0300 | [diff] [blame] | 22 | defined('MB_ENABLED') OR define('MB_ENABLED', FALSE); |
Taufan Aditya | 7756af5 | 2012-05-15 23:57:05 +0700 | [diff] [blame] | 23 | } |
Taufan Aditya | 7756af5 | 2012-05-15 23:57:05 +0700 | [diff] [blame] | 24 | } |
| 25 | |
Andrey Andreev | 291676b | 2014-01-16 18:39:52 +0200 | [diff] [blame^] | 26 | public function is_ascii_test($str) |
| 27 | { |
| 28 | return $this->_is_ascii($str); |
| 29 | } |
| 30 | |
Taufan Aditya | 7756af5 | 2012-05-15 23:57:05 +0700 | [diff] [blame] | 31 | } |