Index: branches/filerepo-work/phase3/tests/ImageTest.php |
— | — | @@ -1,66 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -require_once( 'PHPUnit.php' ); |
5 | | -require_once( '../includes/Defines.php' ); |
6 | | -require_once( '../includes/Profiling.php' ); |
7 | | -require_once( '../includes/GlobalFunctions.php' ); |
8 | | -require_once( '../includes/Image.php' ); |
9 | | - |
10 | | -class ImageTest extends PHPUnit_TestCase { |
11 | | - function ImageTest( $name ) { |
12 | | - $this->PHPUnit_TestCase( $name ); |
13 | | - } |
14 | | - |
15 | | - function setUp() { |
16 | | - } |
17 | | - |
18 | | - function tearDown() { |
19 | | - } |
20 | | - |
21 | | - function testFitBoxWidth() { |
22 | | - $vals = array( |
23 | | - array( |
24 | | - 'width' => 50, |
25 | | - 'height' => 50, |
26 | | - 'tests' => array( |
27 | | - 50 => 50, |
28 | | - 17 => 17, |
29 | | - 18 => 18 ) ), |
30 | | - array( |
31 | | - 'width' => 366, |
32 | | - 'height' => 300, |
33 | | - 'tests' => array( |
34 | | - 50 => 61, |
35 | | - 17 => 21, |
36 | | - 18 => 22 ) ), |
37 | | - array( |
38 | | - 'width' => 300, |
39 | | - 'height' => 366, |
40 | | - 'tests' => array( |
41 | | - 50 => 41, |
42 | | - 17 => 14, |
43 | | - 18 => 15 ) ), |
44 | | - array( |
45 | | - 'width' => 100, |
46 | | - 'height' => 400, |
47 | | - 'tests' => array( |
48 | | - 50 => 12, |
49 | | - 17 => 4, |
50 | | - 18 => 4 ) ) ); |
51 | | - foreach( $vals as $row ) { |
52 | | - extract( $row ); |
53 | | - foreach( $tests as $max => $expected ) { |
54 | | - $y = round( $expected * $height / $width ); |
55 | | - $result = wfFitBoxWidth( $width, $height, $max ); |
56 | | - $y2 = round( $result * $height / $width ); |
57 | | - $this->assertEquals( $expected, |
58 | | - $result, |
59 | | - "($width, $height, $max) wanted: {$expected}x$y, got: {$result}x$y2" ); |
60 | | - } |
61 | | - } |
62 | | - } |
63 | | - |
64 | | - /* TODO: many more! */ |
65 | | -} |
66 | | - |
67 | | -?> |
\ No newline at end of file |
Index: branches/filerepo-work/phase3/tests/SearchEngineTest.php |
— | — | @@ -1,18 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -$IP = '..'; |
5 | | -require_once( 'PHPUnit.php' ); |
6 | | -require_once( '../includes/Defines.php' ); |
7 | | -require_once( '../includes/DefaultSettings.php' ); |
8 | | -require_once( '../includes/Profiling.php' ); |
9 | | -require_once( '../includes/Hooks.php' ); |
10 | | -require_once( '../includes/MagicWord.php' ); |
11 | | -require_once( '../languages/Language.php' ); |
12 | | - |
13 | | -require_once( '../includes/SearchEngine.php' ); |
14 | | - |
15 | 4 | /** @todo document */ |
16 | | -class SearchEngine_TestCase extends PHPUnit_TestCase { |
| 5 | +class SearchEngine_TestCase extends PHPUnit_Framework_TestCase { |
17 | 6 | var $db, $search; |
18 | 7 | |
19 | 8 | function insertSearchData() { |
Index: branches/filerepo-work/phase3/tests/GlobalTest.php |
— | — | @@ -1,32 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -require_once( 'PHPUnit.php' ); |
5 | | -require_once( '../includes/Defines.php' ); |
6 | | -require_once( '../includes/Profiling.php' ); |
7 | | -require_once( '../includes/GlobalFunctions.php' ); |
8 | | - |
9 | | -class GlobalTest extends PHPUnit_TestCase { |
10 | | - function GlobalTest( $name ) { |
11 | | - $this->PHPUnit_TestCase( $name ); |
12 | | - } |
13 | | - |
14 | | - function setUp() { |
15 | | - $this->save = array(); |
16 | | - $saveVars = array( 'wgReadOnlyFile' ); |
17 | | - foreach( $saveVars as $var ) { |
18 | | - if( isset( $GLOBALS[$var] ) ) { |
19 | | - $this->save[$var] = $GLOBALS[$var]; |
20 | | - } |
21 | | - } |
22 | | - $GLOBALS['wgReadOnlyFile'] = wfTempDir() . '/testReadOnly-' . mt_rand(); |
23 | | - } |
24 | | - |
25 | | - function tearDown() { |
26 | | - foreach( $this->save as $var => $data ) { |
27 | | - $GLOBALS[$var] = $data; |
28 | | - } |
29 | | - } |
30 | | - |
| 4 | +class GlobalTest extends PHPUnit_Framework_TestCase { |
31 | 5 | function testRandom() { |
32 | 6 | # This could hypothetically fail, but it shouldn't ;) |
33 | 7 | $this->assertFalse( |
— | — | @@ -208,4 +182,4 @@ |
209 | 183 | /* TODO: many more! */ |
210 | 184 | } |
211 | 185 | |
212 | | -?> |
\ No newline at end of file |
| 186 | +?> |
Index: branches/filerepo-work/phase3/tests/DatabaseTest.php |
— | — | @@ -1,25 +1,12 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -require_once( 'PHPUnit.php' ); |
5 | | -require_once( '../includes/Defines.php' ); |
6 | | -require_once( '../includes/Database.php' ); |
7 | | -require_once( '../includes/GlobalFunctions.php' ); |
8 | | - |
9 | | -class DatabaseTest extends PHPUnit_TestCase { |
| 4 | +class DatabaseTest extends PHPUnit_Framework_TestCase { |
10 | 5 | var $db; |
11 | 6 | |
12 | | - function DatabaseTest( $name ) { |
13 | | - $this->PHPUnit_TestCase( $name ); |
14 | | - } |
15 | | - |
16 | 7 | function setUp() { |
17 | | - $this->db = new Database(); |
| 8 | + $this->db = wfGetDB( DB_SLAVE ); |
18 | 9 | } |
19 | 10 | |
20 | | - function tearDown() { |
21 | | - unset( $this->db ); |
22 | | - } |
23 | | - |
24 | 11 | function testAddQuotesNull() { |
25 | 12 | $this->assertEquals( |
26 | 13 | 'NULL', |
Index: branches/filerepo-work/phase3/tests/README |
— | — | @@ -1,8 +1,9 @@ |
2 | 2 | Some quickie unit tests done with the PHPUnit testing framework. To run the |
3 | 3 | test suite, run 'make test' in this dir or 'php RunTests.php' |
4 | 4 | |
5 | | -You can install PHPUnit via pear like this: |
6 | | -# pear install PHPUnit |
| 5 | +PHPUnit is no longer maintained by PEAR. To get the current version of |
| 6 | +PHPUnit, first uninstall any old version of PHPUnit or PHPUnit2 from PEAR, |
| 7 | +then install the current version from phpunit.de like this: |
7 | 8 | |
8 | | -Or fetch and install it manually: |
9 | | -http://pear.php.net/package/PHPUnit |
| 9 | +# pear channel-discover pear.phpunit.de |
| 10 | +# pear install phpunit/PHPUnit |
Index: branches/filerepo-work/phase3/tests/SanitizerTest.php |
— | — | @@ -1,22 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -require_once( 'PHPUnit.php' ); |
5 | | -require_once( '../includes/Defines.php' ); |
6 | | -require_once( '../includes/Profiling.php' ); |
7 | | -require_once( '../includes/GlobalFunctions.php' ); |
8 | | -require_once( '../includes/Sanitizer.php' ); |
9 | | - |
10 | | -class SanitizerTest extends PHPUnit_TestCase { |
11 | | - function SanitizerTest( $name ) { |
12 | | - $this->PHPUnit_TestCase( $name ); |
13 | | - } |
14 | | - |
15 | | - function setUp() { |
16 | | - } |
17 | | - |
18 | | - function tearDown() { |
19 | | - } |
20 | | - |
| 4 | +class SanitizerTest extends PHPUnit_Framework_TestCase { |
21 | 5 | function testDecodeNamed() { |
22 | 6 | $this->assertEquals( |
23 | 7 | "\xc3\xa9cole", |
— | — | @@ -62,4 +46,4 @@ |
63 | 47 | /* TODO: many more! */ |
64 | 48 | } |
65 | 49 | |
66 | | -?> |
\ No newline at end of file |
| 50 | +?> |
Index: branches/filerepo-work/phase3/tests/ImageFunctionsTest.php |
— | — | @@ -0,0 +1,48 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +class ImageFunctionsTest extends PHPUnit_Framework_TestCase { |
| 5 | + function testFitBoxWidth() { |
| 6 | + $vals = array( |
| 7 | + array( |
| 8 | + 'width' => 50, |
| 9 | + 'height' => 50, |
| 10 | + 'tests' => array( |
| 11 | + 50 => 50, |
| 12 | + 17 => 17, |
| 13 | + 18 => 18 ) ), |
| 14 | + array( |
| 15 | + 'width' => 366, |
| 16 | + 'height' => 300, |
| 17 | + 'tests' => array( |
| 18 | + 50 => 61, |
| 19 | + 17 => 21, |
| 20 | + 18 => 22 ) ), |
| 21 | + array( |
| 22 | + 'width' => 300, |
| 23 | + 'height' => 366, |
| 24 | + 'tests' => array( |
| 25 | + 50 => 41, |
| 26 | + 17 => 14, |
| 27 | + 18 => 15 ) ), |
| 28 | + array( |
| 29 | + 'width' => 100, |
| 30 | + 'height' => 400, |
| 31 | + 'tests' => array( |
| 32 | + 50 => 12, |
| 33 | + 17 => 4, |
| 34 | + 18 => 4 ) ) ); |
| 35 | + foreach( $vals as $row ) { |
| 36 | + extract( $row ); |
| 37 | + foreach( $tests as $max => $expected ) { |
| 38 | + $y = round( $expected * $height / $width ); |
| 39 | + $result = wfFitBoxWidth( $width, $height, $max ); |
| 40 | + $y2 = round( $result * $height / $width ); |
| 41 | + $this->assertEquals( $expected, |
| 42 | + $result, |
| 43 | + "($width, $height, $max) wanted: {$expected}x$y, got: {$result}x$y2" ); |
| 44 | + } |
| 45 | + } |
| 46 | + } |
| 47 | +} |
| 48 | + |
| 49 | +?> |
Property changes on: branches/filerepo-work/phase3/tests/ImageFunctionsTest.php |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 50 | + native |
Name: svn:keywords |
2 | 51 | + Author Date Id Revision |
Index: branches/filerepo-work/phase3/tests/SearchMySQL4Test.php |
— | — | @@ -1,7 +1,5 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | require_once( 'SearchEngineTest.php' ); |
5 | | -require_once( '../includes/SearchMySQL4.php' ); |
6 | 4 | |
7 | 5 | class SearchMySQL4Test extends SearchEngine_TestCase { |
8 | 6 | var $db; |
Index: branches/filerepo-work/phase3/tests/run-test.php |
— | — | @@ -0,0 +1,7 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +require_once( dirname(__FILE__) . '/../maintenance/commandLine.inc' ); |
| 5 | +ini_set( 'include_path', get_include_path() . PATH_SEPARATOR . /*$_SERVER['PHP_PEAR_INSTALL_DIR']*/ 'C:\php\pear' ); |
| 6 | +require( 'PHPUnit/TextUI/Command.php' ); |
| 7 | + |
| 8 | +?> |
Property changes on: branches/filerepo-work/phase3/tests/run-test.php |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 9 | + native |
Index: branches/filerepo-work/phase3/tests/ArticleTest.php |
— | — | @@ -1,16 +1,8 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -require_once( 'PHPUnit.php' ); |
5 | | -require_once( '../includes/Defines.php' ); |
6 | | -require_once( '../includes/Article.php' ); |
7 | | - |
8 | | -class ArticleTest extends PHPUnit_TestCase { |
| 4 | +class ArticleTest extends PHPUnit_Framework_TestCase { |
9 | 5 | var $saveGlobals = array(); |
10 | 6 | |
11 | | - function ArticleTest( $name ) { |
12 | | - $this->PHPUnit_TestCase( $name ); |
13 | | - } |
14 | | - |
15 | 7 | function setUp() { |
16 | 8 | $globalSet = array( |
17 | 9 | 'wgLegacyEncoding' => false, |
— | — | @@ -101,20 +93,6 @@ |
102 | 94 | Revision::getRevisionText( $row ), "getRevisionText" ); |
103 | 95 | } |
104 | 96 | |
105 | | - function testCompressRevisionTextLatin1() { |
106 | | - $GLOBALS['wgUseLatin1'] = true; |
107 | | - $row->old_text = "Wiki est l'\xe9cole superieur !"; |
108 | | - $row->old_flags = Revision::compressRevisionText( $row->old_text ); |
109 | | - $this->assertFalse( false !== strpos( $row->old_flags, 'utf-8' ), |
110 | | - "Flags should not contain 'utf-8'" ); |
111 | | - $this->assertFalse( false !== strpos( $row->old_flags, 'gzip' ), |
112 | | - "Flags should not contain 'gzip'" ); |
113 | | - $this->assertEquals( "Wiki est l'\xe9cole superieur !", |
114 | | - $row->old_text, "Direct check" ); |
115 | | - $this->assertEquals( "Wiki est l'\xe9cole superieur !", |
116 | | - Revision::getRevisionText( $row ), "getRevisionText" ); |
117 | | - } |
118 | | - |
119 | 97 | function testCompressRevisionTextUtf8Gzip() { |
120 | 98 | $GLOBALS['wgCompressRevisions'] = true; |
121 | 99 | $row->old_text = "Wiki est l'\xc3\xa9cole superieur !"; |
— | — | @@ -128,23 +106,6 @@ |
129 | 107 | $this->assertEquals( "Wiki est l'\xc3\xa9cole superieur !", |
130 | 108 | Revision::getRevisionText( $row ), "getRevisionText" ); |
131 | 109 | } |
132 | | - |
133 | | - function testCompressRevisionTextLatin1Gzip() { |
134 | | - $GLOBALS['wgCompressRevisions'] = true; |
135 | | - $GLOBALS['wgUseLatin1'] = true; |
136 | | - $row = new stdClass; |
137 | | - $row->old_text = "Wiki est l'\xe9cole superieur !"; |
138 | | - $row->old_flags = Revision::compressRevisionText( $row->old_text ); |
139 | | - $this->assertFalse( false !== strpos( $row->old_flags, 'utf-8' ), |
140 | | - "Flags should not contain 'utf-8'" ); |
141 | | - $this->assertTrue( false !== strpos( $row->old_flags, 'gzip' ), |
142 | | - "Flags should contain 'gzip'" ); |
143 | | - $this->assertEquals( "Wiki est l'\xe9cole superieur !", |
144 | | - gzinflate( $row->old_text ), "Direct check" ); |
145 | | - $this->assertEquals( "Wiki est l'\xe9cole superieur !", |
146 | | - Revision::getRevisionText( $row ), "getRevisionText" ); |
147 | | - } |
148 | | - |
149 | 110 | } |
150 | 111 | |
151 | | -?> |
\ No newline at end of file |
| 112 | +?> |
Index: branches/filerepo-work/phase3/tests/RunTests.php |
— | — | @@ -1,17 +1,12 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -if( php_sapi_name() != 'cli' ) { |
5 | | - echo 'Must be run from the command line.'; |
6 | | - die( -1 ); |
7 | | -} |
| 4 | +die( "This is broken, use run-test.php for now.\n" ); |
8 | 5 | |
| 6 | +require_once( dirname( __FILE__ ) . '/../maintenance/commandLine.inc' ); |
| 7 | +ini_set( 'include_path', get_include_path() . PATH_SEPARATOR . /*$_SERVER['PHP_PEAR_INSTALL_DIR']*/ 'C:\php\pear' ); |
9 | 8 | error_reporting( E_ALL ); |
10 | | -define( "MEDIAWIKI", true ); |
| 9 | +require_once( 'PHPUnit/Framework.php' ); |
11 | 10 | |
12 | | -set_include_path( get_include_path() . PATH_SEPARATOR . 'PHPUnit' ); |
13 | | -set_include_path( get_include_path() . PATH_SEPARATOR . '..' ); |
14 | | -require_once( 'PHPUnit.php' ); |
15 | | - |
16 | 11 | $testOptions = array( |
17 | 12 | 'mysql4' => array( |
18 | 13 | 'server' => null, |
— | — | @@ -25,10 +20,6 @@ |
26 | 21 | 'database' => null ), |
27 | 22 | ); |
28 | 23 | |
29 | | -if( file_exists( 'LocalTestSettings.php' ) ) { |
30 | | - include( './LocalTestSettings.php' ); |
31 | | -} |
32 | | - |
33 | 24 | $tests = array( |
34 | 25 | 'GlobalTest', |
35 | 26 | 'DatabaseTest', |
— | — | @@ -38,14 +29,14 @@ |
39 | 30 | 'ImageTest' |
40 | 31 | ); |
41 | 32 | |
42 | | -if( isset( $_SERVER['argv'][1] ) ) { |
| 33 | +if( count( $args ) ) { |
43 | 34 | // to override... |
44 | | - $tests = array( $_SERVER['argv'][1] ); |
| 35 | + $tests = $args; |
45 | 36 | } |
46 | 37 | |
47 | 38 | foreach( $tests as $test ) { |
48 | 39 | require_once( $test . '.php' ); |
49 | | - $suite = new PHPUnit_TestSuite( $test ); |
| 40 | + $suite = new PHPUnit_Framework_TestSuite( $test ); |
50 | 41 | $result = PHPUnit::run( $suite ); |
51 | 42 | echo $result->toString(); |
52 | 43 | } |
Index: branches/filerepo-work/phase3/includes/Defines.php |
— | — | @@ -205,5 +205,61 @@ |
206 | 206 | define( 'LIST_NAMES', 3); |
207 | 207 | define( 'LIST_OR', 4); |
208 | 208 | |
| 209 | +/** |
| 210 | + * Unicode and normalisation related |
| 211 | + */ |
| 212 | +define( 'UNICODE_HANGUL_FIRST', 0xac00 ); |
| 213 | +define( 'UNICODE_HANGUL_LAST', 0xd7a3 ); |
209 | 214 | |
| 215 | +define( 'UNICODE_HANGUL_LBASE', 0x1100 ); |
| 216 | +define( 'UNICODE_HANGUL_VBASE', 0x1161 ); |
| 217 | +define( 'UNICODE_HANGUL_TBASE', 0x11a7 ); |
| 218 | + |
| 219 | +define( 'UNICODE_HANGUL_LCOUNT', 19 ); |
| 220 | +define( 'UNICODE_HANGUL_VCOUNT', 21 ); |
| 221 | +define( 'UNICODE_HANGUL_TCOUNT', 28 ); |
| 222 | +define( 'UNICODE_HANGUL_NCOUNT', UNICODE_HANGUL_VCOUNT * UNICODE_HANGUL_TCOUNT ); |
| 223 | + |
| 224 | +define( 'UNICODE_HANGUL_LEND', UNICODE_HANGUL_LBASE + UNICODE_HANGUL_LCOUNT - 1 ); |
| 225 | +define( 'UNICODE_HANGUL_VEND', UNICODE_HANGUL_VBASE + UNICODE_HANGUL_VCOUNT - 1 ); |
| 226 | +define( 'UNICODE_HANGUL_TEND', UNICODE_HANGUL_TBASE + UNICODE_HANGUL_TCOUNT - 1 ); |
| 227 | + |
| 228 | +define( 'UNICODE_SURROGATE_FIRST', 0xd800 ); |
| 229 | +define( 'UNICODE_SURROGATE_LAST', 0xdfff ); |
| 230 | +define( 'UNICODE_MAX', 0x10ffff ); |
| 231 | +define( 'UNICODE_REPLACEMENT', 0xfffd ); |
| 232 | + |
| 233 | + |
| 234 | +define( 'UTF8_HANGUL_FIRST', "\xea\xb0\x80" /*codepointToUtf8( UNICODE_HANGUL_FIRST )*/ ); |
| 235 | +define( 'UTF8_HANGUL_LAST', "\xed\x9e\xa3" /*codepointToUtf8( UNICODE_HANGUL_LAST )*/ ); |
| 236 | + |
| 237 | +define( 'UTF8_HANGUL_LBASE', "\xe1\x84\x80" /*codepointToUtf8( UNICODE_HANGUL_LBASE )*/ ); |
| 238 | +define( 'UTF8_HANGUL_VBASE', "\xe1\x85\xa1" /*codepointToUtf8( UNICODE_HANGUL_VBASE )*/ ); |
| 239 | +define( 'UTF8_HANGUL_TBASE', "\xe1\x86\xa7" /*codepointToUtf8( UNICODE_HANGUL_TBASE )*/ ); |
| 240 | + |
| 241 | +define( 'UTF8_HANGUL_LEND', "\xe1\x84\x92" /*codepointToUtf8( UNICODE_HANGUL_LEND )*/ ); |
| 242 | +define( 'UTF8_HANGUL_VEND', "\xe1\x85\xb5" /*codepointToUtf8( UNICODE_HANGUL_VEND )*/ ); |
| 243 | +define( 'UTF8_HANGUL_TEND', "\xe1\x87\x82" /*codepointToUtf8( UNICODE_HANGUL_TEND )*/ ); |
| 244 | + |
| 245 | +define( 'UTF8_SURROGATE_FIRST', "\xed\xa0\x80" /*codepointToUtf8( UNICODE_SURROGATE_FIRST )*/ ); |
| 246 | +define( 'UTF8_SURROGATE_LAST', "\xed\xbf\xbf" /*codepointToUtf8( UNICODE_SURROGATE_LAST )*/ ); |
| 247 | +define( 'UTF8_MAX', "\xf4\x8f\xbf\xbf" /*codepointToUtf8( UNICODE_MAX )*/ ); |
| 248 | +define( 'UTF8_REPLACEMENT', "\xef\xbf\xbd" /*codepointToUtf8( UNICODE_REPLACEMENT )*/ ); |
| 249 | +#define( 'UTF8_REPLACEMENT', '!' ); |
| 250 | + |
| 251 | +define( 'UTF8_OVERLONG_A', "\xc1\xbf" ); |
| 252 | +define( 'UTF8_OVERLONG_B', "\xe0\x9f\xbf" ); |
| 253 | +define( 'UTF8_OVERLONG_C', "\xf0\x8f\xbf\xbf" ); |
| 254 | + |
| 255 | +# These two ranges are illegal |
| 256 | +define( 'UTF8_FDD0', "\xef\xb7\x90" /*codepointToUtf8( 0xfdd0 )*/ ); |
| 257 | +define( 'UTF8_FDEF', "\xef\xb7\xaf" /*codepointToUtf8( 0xfdef )*/ ); |
| 258 | +define( 'UTF8_FFFE', "\xef\xbf\xbe" /*codepointToUtf8( 0xfffe )*/ ); |
| 259 | +define( 'UTF8_FFFF', "\xef\xbf\xbf" /*codepointToUtf8( 0xffff )*/ ); |
| 260 | + |
| 261 | +define( 'UTF8_HEAD', false ); |
| 262 | +define( 'UTF8_TAIL', true ); |
| 263 | + |
| 264 | + |
| 265 | + |
210 | 266 | ?> |
Index: branches/filerepo-work/phase3/includes/normal/UtfNormal.php |
— | — | @@ -29,59 +29,6 @@ |
30 | 30 | global $utfCompatibilityDecomp; |
31 | 31 | $utfCompatibilityDecomp = NULL; |
32 | 32 | |
33 | | -define( 'UNICODE_HANGUL_FIRST', 0xac00 ); |
34 | | -define( 'UNICODE_HANGUL_LAST', 0xd7a3 ); |
35 | | - |
36 | | -define( 'UNICODE_HANGUL_LBASE', 0x1100 ); |
37 | | -define( 'UNICODE_HANGUL_VBASE', 0x1161 ); |
38 | | -define( 'UNICODE_HANGUL_TBASE', 0x11a7 ); |
39 | | - |
40 | | -define( 'UNICODE_HANGUL_LCOUNT', 19 ); |
41 | | -define( 'UNICODE_HANGUL_VCOUNT', 21 ); |
42 | | -define( 'UNICODE_HANGUL_TCOUNT', 28 ); |
43 | | -define( 'UNICODE_HANGUL_NCOUNT', UNICODE_HANGUL_VCOUNT * UNICODE_HANGUL_TCOUNT ); |
44 | | - |
45 | | -define( 'UNICODE_HANGUL_LEND', UNICODE_HANGUL_LBASE + UNICODE_HANGUL_LCOUNT - 1 ); |
46 | | -define( 'UNICODE_HANGUL_VEND', UNICODE_HANGUL_VBASE + UNICODE_HANGUL_VCOUNT - 1 ); |
47 | | -define( 'UNICODE_HANGUL_TEND', UNICODE_HANGUL_TBASE + UNICODE_HANGUL_TCOUNT - 1 ); |
48 | | - |
49 | | -define( 'UNICODE_SURROGATE_FIRST', 0xd800 ); |
50 | | -define( 'UNICODE_SURROGATE_LAST', 0xdfff ); |
51 | | -define( 'UNICODE_MAX', 0x10ffff ); |
52 | | -define( 'UNICODE_REPLACEMENT', 0xfffd ); |
53 | | - |
54 | | - |
55 | | -define( 'UTF8_HANGUL_FIRST', "\xea\xb0\x80" /*codepointToUtf8( UNICODE_HANGUL_FIRST )*/ ); |
56 | | -define( 'UTF8_HANGUL_LAST', "\xed\x9e\xa3" /*codepointToUtf8( UNICODE_HANGUL_LAST )*/ ); |
57 | | - |
58 | | -define( 'UTF8_HANGUL_LBASE', "\xe1\x84\x80" /*codepointToUtf8( UNICODE_HANGUL_LBASE )*/ ); |
59 | | -define( 'UTF8_HANGUL_VBASE', "\xe1\x85\xa1" /*codepointToUtf8( UNICODE_HANGUL_VBASE )*/ ); |
60 | | -define( 'UTF8_HANGUL_TBASE', "\xe1\x86\xa7" /*codepointToUtf8( UNICODE_HANGUL_TBASE )*/ ); |
61 | | - |
62 | | -define( 'UTF8_HANGUL_LEND', "\xe1\x84\x92" /*codepointToUtf8( UNICODE_HANGUL_LEND )*/ ); |
63 | | -define( 'UTF8_HANGUL_VEND', "\xe1\x85\xb5" /*codepointToUtf8( UNICODE_HANGUL_VEND )*/ ); |
64 | | -define( 'UTF8_HANGUL_TEND', "\xe1\x87\x82" /*codepointToUtf8( UNICODE_HANGUL_TEND )*/ ); |
65 | | - |
66 | | -define( 'UTF8_SURROGATE_FIRST', "\xed\xa0\x80" /*codepointToUtf8( UNICODE_SURROGATE_FIRST )*/ ); |
67 | | -define( 'UTF8_SURROGATE_LAST', "\xed\xbf\xbf" /*codepointToUtf8( UNICODE_SURROGATE_LAST )*/ ); |
68 | | -define( 'UTF8_MAX', "\xf4\x8f\xbf\xbf" /*codepointToUtf8( UNICODE_MAX )*/ ); |
69 | | -define( 'UTF8_REPLACEMENT', "\xef\xbf\xbd" /*codepointToUtf8( UNICODE_REPLACEMENT )*/ ); |
70 | | -#define( 'UTF8_REPLACEMENT', '!' ); |
71 | | - |
72 | | -define( 'UTF8_OVERLONG_A', "\xc1\xbf" ); |
73 | | -define( 'UTF8_OVERLONG_B', "\xe0\x9f\xbf" ); |
74 | | -define( 'UTF8_OVERLONG_C', "\xf0\x8f\xbf\xbf" ); |
75 | | - |
76 | | -# These two ranges are illegal |
77 | | -define( 'UTF8_FDD0', "\xef\xb7\x90" /*codepointToUtf8( 0xfdd0 )*/ ); |
78 | | -define( 'UTF8_FDEF', "\xef\xb7\xaf" /*codepointToUtf8( 0xfdef )*/ ); |
79 | | -define( 'UTF8_FFFE', "\xef\xbf\xbe" /*codepointToUtf8( 0xfffe )*/ ); |
80 | | -define( 'UTF8_FFFF', "\xef\xbf\xbf" /*codepointToUtf8( 0xffff )*/ ); |
81 | | - |
82 | | -define( 'UTF8_HEAD', false ); |
83 | | -define( 'UTF8_TAIL', true ); |
84 | | - |
85 | | - |
86 | 33 | /** |
87 | 34 | * For using the ICU wrapper |
88 | 35 | */ |
Index: branches/filerepo-work/phase3/StartProfiler.php |
— | — | @@ -1,22 +1,24 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -require_once( dirname(__FILE__).'/includes/ProfilerStub.php' ); |
| 4 | +#require_once( './includes/ProfilerStub.php' ); |
5 | 5 | |
6 | 6 | /** |
7 | 7 | * To use a profiler, delete the line above and add something like this: |
8 | 8 | * |
9 | | - * require_once( dirname(__FILE__).'/includes/Profiler.php' ); |
| 9 | + * require_once( './includes/Profiler.php' ); |
10 | 10 | * $wgProfiler = new Profiler; |
11 | 11 | * |
12 | 12 | * Or for a sampling profiler: |
13 | 13 | * if ( !mt_rand( 0, 100 ) ) { |
14 | | - * require_once( dirname(__FILE__).'/includes/Profiler.php' ); |
| 14 | + * require_once( './includes/Profiler.php' ); |
15 | 15 | * $wgProfiler = new Profiler; |
16 | 16 | * } else { |
17 | | - * require_once( dirname(__FILE__).'/includes/ProfilerStub.php' ); |
| 17 | + * require_once( './includes/ProfilerStub.php' ); |
18 | 18 | * } |
19 | 19 | * |
20 | 20 | * Configuration of the profiler output can be done in LocalSettings.php |
21 | 21 | */ |
| 22 | +require_once( dirname(__FILE__).'/includes/Profiler.php' ); |
| 23 | +$wgProfiler = new Profiler; |
22 | 24 | |
23 | 25 | ?> |