r22579 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22578‎ | r22579 | r22580 >
Date:20:09, 30 May 2007
Author:tstarling
Status:old
Tags:
Comment:
Updated the unit test suite to kind of partially work with modern computers. RunTests.php doesn't work just yet. Fixed an actual regression that the test suite detected -- moved some defines to Defines.php where they will be loaded consistently.
Modified paths:
  • /branches/filerepo-work/phase3/StartProfiler.php (modified) (history)
  • /branches/filerepo-work/phase3/includes/Defines.php (modified) (history)
  • /branches/filerepo-work/phase3/includes/normal/UtfNormal.php (modified) (history)
  • /branches/filerepo-work/phase3/tests/ArticleTest.php (modified) (history)
  • /branches/filerepo-work/phase3/tests/DatabaseTest.php (modified) (history)
  • /branches/filerepo-work/phase3/tests/GlobalTest.php (modified) (history)
  • /branches/filerepo-work/phase3/tests/ImageFunctionsTest.php (added) (history)
  • /branches/filerepo-work/phase3/tests/ImageFunctionsTest.php (added) (history)
  • /branches/filerepo-work/phase3/tests/ImageTest.php (deleted) (history)
  • /branches/filerepo-work/phase3/tests/README (modified) (history)
  • /branches/filerepo-work/phase3/tests/RunTests.php (modified) (history)
  • /branches/filerepo-work/phase3/tests/SanitizerTest.php (modified) (history)
  • /branches/filerepo-work/phase3/tests/SearchEngineTest.php (modified) (history)
  • /branches/filerepo-work/phase3/tests/SearchMySQL4Test.php (modified) (history)
  • /branches/filerepo-work/phase3/tests/run-test.php (added) (history)

Diff [purge]

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 @@
22 <?php
33
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 -
154 /** @todo document */
16 -class SearchEngine_TestCase extends PHPUnit_TestCase {
 5+class SearchEngine_TestCase extends PHPUnit_Framework_TestCase {
176 var $db, $search;
187
198 function insertSearchData() {
Index: branches/filerepo-work/phase3/tests/GlobalTest.php
@@ -1,32 +1,6 @@
22 <?php
33
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 {
315 function testRandom() {
326 # This could hypothetically fail, but it shouldn't ;)
337 $this->assertFalse(
@@ -208,4 +182,4 @@
209183 /* TODO: many more! */
210184 }
211185
212 -?>
\ No newline at end of file
 186+?>
Index: branches/filerepo-work/phase3/tests/DatabaseTest.php
@@ -1,25 +1,12 @@
22 <?php
33
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 {
105 var $db;
116
12 - function DatabaseTest( $name ) {
13 - $this->PHPUnit_TestCase( $name );
14 - }
15 -
167 function setUp() {
17 - $this->db = new Database();
 8+ $this->db = wfGetDB( DB_SLAVE );
189 }
1910
20 - function tearDown() {
21 - unset( $this->db );
22 - }
23 -
2411 function testAddQuotesNull() {
2512 $this->assertEquals(
2613 'NULL',
Index: branches/filerepo-work/phase3/tests/README
@@ -1,8 +1,9 @@
22 Some quickie unit tests done with the PHPUnit testing framework. To run the
33 test suite, run 'make test' in this dir or 'php RunTests.php'
44
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:
78
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 @@
22 <?php
33
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 {
215 function testDecodeNamed() {
226 $this->assertEquals(
237 "\xc3\xa9cole",
@@ -62,4 +46,4 @@
6347 /* TODO: many more! */
6448 }
6549
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
150 + native
Name: svn:keywords
251 + Author Date Id Revision
Index: branches/filerepo-work/phase3/tests/SearchMySQL4Test.php
@@ -1,7 +1,5 @@
22 <?php
3 -
43 require_once( 'SearchEngineTest.php' );
5 -require_once( '../includes/SearchMySQL4.php' );
64
75 class SearchMySQL4Test extends SearchEngine_TestCase {
86 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
19 + native
Index: branches/filerepo-work/phase3/tests/ArticleTest.php
@@ -1,16 +1,8 @@
22 <?php
33
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 {
95 var $saveGlobals = array();
106
11 - function ArticleTest( $name ) {
12 - $this->PHPUnit_TestCase( $name );
13 - }
14 -
157 function setUp() {
168 $globalSet = array(
179 'wgLegacyEncoding' => false,
@@ -101,20 +93,6 @@
10294 Revision::getRevisionText( $row ), "getRevisionText" );
10395 }
10496
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 -
11997 function testCompressRevisionTextUtf8Gzip() {
12098 $GLOBALS['wgCompressRevisions'] = true;
12199 $row->old_text = "Wiki est l'\xc3\xa9cole superieur !";
@@ -128,23 +106,6 @@
129107 $this->assertEquals( "Wiki est l'\xc3\xa9cole superieur !",
130108 Revision::getRevisionText( $row ), "getRevisionText" );
131109 }
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 -
149110 }
150111
151 -?>
\ No newline at end of file
 112+?>
Index: branches/filerepo-work/phase3/tests/RunTests.php
@@ -1,17 +1,12 @@
22 <?php
33
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" );
85
 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' );
98 error_reporting( E_ALL );
10 -define( "MEDIAWIKI", true );
 9+require_once( 'PHPUnit/Framework.php' );
1110
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 -
1611 $testOptions = array(
1712 'mysql4' => array(
1813 'server' => null,
@@ -25,10 +20,6 @@
2621 'database' => null ),
2722 );
2823
29 -if( file_exists( 'LocalTestSettings.php' ) ) {
30 - include( './LocalTestSettings.php' );
31 -}
32 -
3324 $tests = array(
3425 'GlobalTest',
3526 'DatabaseTest',
@@ -38,14 +29,14 @@
3930 'ImageTest'
4031 );
4132
42 -if( isset( $_SERVER['argv'][1] ) ) {
 33+if( count( $args ) ) {
4334 // to override...
44 - $tests = array( $_SERVER['argv'][1] );
 35+ $tests = $args;
4536 }
4637
4738 foreach( $tests as $test ) {
4839 require_once( $test . '.php' );
49 - $suite = new PHPUnit_TestSuite( $test );
 40+ $suite = new PHPUnit_Framework_TestSuite( $test );
5041 $result = PHPUnit::run( $suite );
5142 echo $result->toString();
5243 }
Index: branches/filerepo-work/phase3/includes/Defines.php
@@ -205,5 +205,61 @@
206206 define( 'LIST_NAMES', 3);
207207 define( 'LIST_OR', 4);
208208
 209+/**
 210+ * Unicode and normalisation related
 211+ */
 212+define( 'UNICODE_HANGUL_FIRST', 0xac00 );
 213+define( 'UNICODE_HANGUL_LAST', 0xd7a3 );
209214
 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+
210266 ?>
Index: branches/filerepo-work/phase3/includes/normal/UtfNormal.php
@@ -29,59 +29,6 @@
3030 global $utfCompatibilityDecomp;
3131 $utfCompatibilityDecomp = NULL;
3232
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 -
8633 /**
8734 * For using the ICU wrapper
8835 */
Index: branches/filerepo-work/phase3/StartProfiler.php
@@ -1,22 +1,24 @@
22 <?php
33
4 -require_once( dirname(__FILE__).'/includes/ProfilerStub.php' );
 4+#require_once( './includes/ProfilerStub.php' );
55
66 /**
77 * To use a profiler, delete the line above and add something like this:
88 *
9 - * require_once( dirname(__FILE__).'/includes/Profiler.php' );
 9+ * require_once( './includes/Profiler.php' );
1010 * $wgProfiler = new Profiler;
1111 *
1212 * Or for a sampling profiler:
1313 * if ( !mt_rand( 0, 100 ) ) {
14 - * require_once( dirname(__FILE__).'/includes/Profiler.php' );
 14+ * require_once( './includes/Profiler.php' );
1515 * $wgProfiler = new Profiler;
1616 * } else {
17 - * require_once( dirname(__FILE__).'/includes/ProfilerStub.php' );
 17+ * require_once( './includes/ProfilerStub.php' );
1818 * }
1919 *
2020 * Configuration of the profiler output can be done in LocalSettings.php
2121 */
 22+require_once( dirname(__FILE__).'/includes/Profiler.php' );
 23+$wgProfiler = new Profiler;
2224
2325 ?>