Index: branches/REL1_18/phase3/tests/phpunit/includes/GlobalFunctions/GlobalTest.php |
— | — | @@ -2,8 +2,7 @@ |
3 | 3 | |
4 | 4 | class GlobalTest extends MediaWikiTestCase { |
5 | 5 | function setUp() { |
6 | | - global $wgReadOnlyFile, $wgContLang, $wgLang, $wgUrlProtocols, $wgLanguageCode; |
7 | | - parent::setUp(); |
| 6 | + global $wgReadOnlyFile, $wgUrlProtocols; |
8 | 7 | $this->originals['wgReadOnlyFile'] = $wgReadOnlyFile; |
9 | 8 | $this->originals['wgUrlProtocols'] = $wgUrlProtocols; |
10 | 9 | $wgReadOnlyFile = tempnam( wfTempDir(), "mwtest_readonly" ); |
Index: branches/REL1_18/phase3/includes/diff/DifferenceEngine.php |
— | — | @@ -779,7 +779,7 @@ |
780 | 780 | function generateDiffBody( $otext, $ntext ) { |
781 | 781 | global $wgExternalDiffEngine, $wgContLang; |
782 | 782 | |
783 | | - wfProfileIn( __METHOD__ ); |
| 783 | + wfProfileIn( __METHOD__ ); |
784 | 784 | |
785 | 785 | $otext = str_replace( "\r\n", "\n", $otext ); |
786 | 786 | $ntext = str_replace( "\r\n", "\n", $ntext ); |
— | — | @@ -791,6 +791,7 @@ |
792 | 792 | # input text to be HTML-escaped already |
793 | 793 | $otext = htmlspecialchars ( $wgContLang->segmentForDiff( $otext ) ); |
794 | 794 | $ntext = htmlspecialchars ( $wgContLang->segmentForDiff( $ntext ) ); |
| 795 | + wfProfileOut( __METHOD__ ); |
795 | 796 | return $wgContLang->unsegmentForDiff( wikidiff_do_diff( $otext, $ntext, 2 ) ) . |
796 | 797 | $this->debug( 'wikidiff1' ); |
797 | 798 | } |
— | — | @@ -802,6 +803,7 @@ |
803 | 804 | $text = wikidiff2_do_diff( $otext, $ntext, 2 ); |
804 | 805 | $text .= $this->debug( 'wikidiff2' ); |
805 | 806 | wfProfileOut( 'wikidiff2_do_diff' ); |
| 807 | + wfProfileOut( __METHOD__ ); |
806 | 808 | return $text; |
807 | 809 | } |
808 | 810 | if ( $wgExternalDiffEngine != 'wikidiff3' && $wgExternalDiffEngine !== false ) { |
Index: branches/REL1_18/phase3/includes/parser/Tidy.php |
— | — | @@ -217,6 +217,8 @@ |
218 | 218 | if ( !MWInit::classExists( 'tidy' ) ) { |
219 | 219 | wfWarn( "Unable to load internal tidy class." ); |
220 | 220 | $retval = -1; |
| 221 | + |
| 222 | + wfProfileOut( __METHOD__ ); |
221 | 223 | return null; |
222 | 224 | } |
223 | 225 | |
Index: branches/REL1_18/phase3/includes/OutputPage.php |
— | — | @@ -2261,14 +2261,16 @@ |
2262 | 2262 | * @return String: The doctype, opening <html>, and head element. |
2263 | 2263 | */ |
2264 | 2264 | public function headElement( Skin $sk, $includeStyle = true ) { |
2265 | | - global $wgUseTrackbacks, $wgLang; |
| 2265 | + global $wgLang, $wgContLang, $wgUseTrackbacks; |
| 2266 | + $userdir = $wgLang->getDir(); |
| 2267 | + $sitedir = $wgContLang->getDir(); |
2266 | 2268 | |
2267 | 2269 | if ( $sk->commonPrintStylesheet() ) { |
2268 | 2270 | $this->addModuleStyles( 'mediawiki.legacy.wikiprintable' ); |
2269 | 2271 | } |
2270 | 2272 | $sk->setupUserCss( $this ); |
2271 | 2273 | |
2272 | | - $ret = Html::htmlHeader( array( 'lang' => $wgLang->getCode(), 'dir' => $wgLang->getDir() ) ); |
| 2274 | + $ret = Html::htmlHeader( array( 'lang' => $wgLang->getCode(), 'dir' => $userdir ) ); |
2273 | 2275 | |
2274 | 2276 | if ( $this->getHTMLTitle() == '' ) { |
2275 | 2277 | $this->setHTMLTitle( wfMsg( 'pagetitle', $this->getPageTitle() ) ); |
— | — | @@ -2315,9 +2317,6 @@ |
2316 | 2318 | } |
2317 | 2319 | |
2318 | 2320 | # Classes for LTR/RTL directionality support |
2319 | | - global $wgLang, $wgContLang; |
2320 | | - $userdir = $wgLang->getDir(); |
2321 | | - $sitedir = $wgContLang->getDir(); |
2322 | 2321 | $bodyAttrs['class'] = "mediawiki $userdir sitedir-$sitedir"; |
2323 | 2322 | |
2324 | 2323 | if ( $this->getContext()->getLang()->capitalizeAllNouns() ) { |
Property changes on: branches/REL1_18/phase3/includes/OutputPage.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
2325 | 2324 | Merged /trunk/phase3/includes/OutputPage.php:r92551-92552,92560,92563-92564,92568,92570,92573-92574,92576,92581 |
Index: branches/REL1_18/phase3/includes/api/ApiFormatBase.php |
— | — | @@ -257,8 +257,6 @@ |
258 | 258 | * @return string |
259 | 259 | */ |
260 | 260 | protected function formatHTML( $text ) { |
261 | | - global $wgUrlProtocols; |
262 | | - |
263 | 261 | // Escape everything first for full coverage |
264 | 262 | $text = htmlspecialchars( $text ); |
265 | 263 | |
— | — | @@ -374,4 +372,4 @@ |
375 | 373 | public function getVersion() { |
376 | 374 | return __CLASS__ . ': $Id$'; |
377 | 375 | } |
378 | | -} |
\ No newline at end of file |
| 376 | +} |
Index: branches/REL1_18/phase3/includes/api/ApiQueryWatchlist.php |
— | — | @@ -292,7 +292,6 @@ |
293 | 293 | } |
294 | 294 | |
295 | 295 | if ( $this->fld_parsedcomment && isset( $row->rc_comment ) ) { |
296 | | - global $wgUser; |
297 | 296 | $vals['parsedcomment'] = $this->getSkin()->formatComment( $row->rc_comment, $title ); |
298 | 297 | } |
299 | 298 | |
Index: branches/REL1_18/phase3/includes/Title.php |
— | — | @@ -2355,7 +2355,7 @@ |
2356 | 2356 | $conditions = array( 'ar_namespace' => $this->getNamespace(), 'ar_title' => $this->getDBkey() ); |
2357 | 2357 | |
2358 | 2358 | if( !$includeSuppressed ) { |
2359 | | - $suppressedTextBits = REVISION::DELETED_TEXT | REVISION::DELETED_RESTRICTED; |
| 2359 | + $suppressedTextBits = Revision::DELETED_TEXT | Revision::DELETED_RESTRICTED; |
2360 | 2360 | $conditions[] = $dbr->bitAnd('ar_deleted', $suppressedTextBits ) . |
2361 | 2361 | ' != ' . $suppressedTextBits; |
2362 | 2362 | } |
— | — | @@ -2367,7 +2367,7 @@ |
2368 | 2368 | if ( $this->getNamespace() == NS_FILE ) { |
2369 | 2369 | $fconditions = array( 'fa_name' => $this->getDBkey() ); |
2370 | 2370 | if( !$includeSuppressed ) { |
2371 | | - $suppressedTextBits = FILE::DELETED_FILE | FILE::DELETED_RESTRICTED; |
| 2371 | + $suppressedTextBits = File::DELETED_FILE | File::DELETED_RESTRICTED; |
2372 | 2372 | $fconditions[] = $dbr->bitAnd('fa_deleted', $suppressedTextBits ) . |
2373 | 2373 | ' != ' . $suppressedTextBits; |
2374 | 2374 | } |
Property changes on: branches/REL1_18/phase3/includes/Title.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
2375 | 2375 | Merged /trunk/phase3/includes/Title.php:r92551-92552,92560,92563-92564,92568,92570,92573-92574,92576,92581 |
Index: branches/REL1_18/phase3/includes/SkinTemplate.php |
— | — | @@ -107,7 +107,7 @@ |
108 | 108 | * |
109 | 109 | * @param $out OutputPage |
110 | 110 | */ |
111 | | - function setupSkinUserCss( OutputPage $out ){ |
| 111 | + function setupSkinUserCss( OutputPage $out ) { |
112 | 112 | $out->addModuleStyles( array( 'mediawiki.legacy.shared', 'mediawiki.legacy.commonPrint' ) ); |
113 | 113 | } |
114 | 114 | |
— | — | @@ -133,7 +133,7 @@ |
134 | 134 | */ |
135 | 135 | function outputPage( OutputPage $out ) { |
136 | 136 | global $wgUser, $wgLang, $wgContLang; |
137 | | - global $wgScript, $wgStylePath, $wgLanguageCode; |
| 137 | + global $wgScript, $wgStylePath; |
138 | 138 | global $wgMimeType, $wgJsMimeType, $wgRequest; |
139 | 139 | global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces, $wgHtml5Version; |
140 | 140 | global $wgDisableCounters, $wgLogo, $wgHideInterlanguageLinks; |
Index: branches/REL1_18/phase3/includes/libs/jsminplus.php |
— | — | @@ -15,6 +15,7 @@ |
16 | 16 | * Usage: $minified = JSMinPlus::minify($script [, $filename]) |
17 | 17 | * |
18 | 18 | * Versionlog (see also changelog.txt): |
| 19 | + * 19-07-2011 - expanded operator and keyword defines. Fixes the notices when creating several JSTokenizer |
19 | 20 | * 17-05-2009 - fixed hook:colon precedence, fixed empty body in loop and if-constructs |
20 | 21 | * 18-04-2009 - fixed crashbug in PHP 5.2.9 and several other bugfixes |
21 | 22 | * 12-04-2009 - some small bugfixes and performance improvements |
— | — | @@ -89,6 +90,83 @@ |
90 | 91 | define('EXPRESSED_FORM', 1); |
91 | 92 | define('STATEMENT_FORM', 2); |
92 | 93 | |
| 94 | +/* Operators */ |
| 95 | +define('OP_SEMICOLON', ';'); |
| 96 | +define('OP_COMMA', ','); |
| 97 | +define('OP_HOOK', '?'); |
| 98 | +define('OP_COLON', ':'); |
| 99 | +define('OP_OR', '||'); |
| 100 | +define('OP_AND', '&&'); |
| 101 | +define('OP_BITWISE_OR', '|'); |
| 102 | +define('OP_BITWISE_XOR', '^'); |
| 103 | +define('OP_BITWISE_AND', '&'); |
| 104 | +define('OP_STRICT_EQ', '==='); |
| 105 | +define('OP_EQ', '=='); |
| 106 | +define('OP_ASSIGN', '='); |
| 107 | +define('OP_STRICT_NE', '!=='); |
| 108 | +define('OP_NE', '!='); |
| 109 | +define('OP_LSH', '<<'); |
| 110 | +define('OP_LE', '<='); |
| 111 | +define('OP_LT', '<'); |
| 112 | +define('OP_URSH', '>>>'); |
| 113 | +define('OP_RSH', '>>'); |
| 114 | +define('OP_GE', '>='); |
| 115 | +define('OP_GT', '>'); |
| 116 | +define('OP_INCREMENT', '++'); |
| 117 | +define('OP_DECREMENT', '--'); |
| 118 | +define('OP_PLUS', '+'); |
| 119 | +define('OP_MINUS', '-'); |
| 120 | +define('OP_MUL', '*'); |
| 121 | +define('OP_DIV', '/'); |
| 122 | +define('OP_MOD', '%'); |
| 123 | +define('OP_NOT', '!'); |
| 124 | +define('OP_BITWISE_NOT', '~'); |
| 125 | +define('OP_DOT', '.'); |
| 126 | +define('OP_LEFT_BRACKET', '['); |
| 127 | +define('OP_RIGHT_BRACKET', ']'); |
| 128 | +define('OP_LEFT_CURLY', '{'); |
| 129 | +define('OP_RIGHT_CURLY', '}'); |
| 130 | +define('OP_LEFT_PAREN', '('); |
| 131 | +define('OP_RIGHT_PAREN', ')'); |
| 132 | +define('OP_CONDCOMMENT_END', '@*/'); |
| 133 | + |
| 134 | +define('OP_UNARY_PLUS', 'U+'); |
| 135 | +define('OP_UNARY_MINUS', 'U-'); |
| 136 | + |
| 137 | +/* Keywords */ |
| 138 | +define('KEYWORD_BREAK', 'break'); |
| 139 | +define('KEYWORD_CASE', 'case'); |
| 140 | +define('KEYWORD_CATCH', 'catch'); |
| 141 | +define('KEYWORD_CONST', 'const'); |
| 142 | +define('KEYWORD_CONTINUE', 'continue'); |
| 143 | +define('KEYWORD_DEBUGGER', 'debugger'); |
| 144 | +define('KEYWORD_DEFAULT', 'default'); |
| 145 | +define('KEYWORD_DELETE', 'delete'); |
| 146 | +define('KEYWORD_DO', 'do'); |
| 147 | +define('KEYWORD_ELSE', 'else'); |
| 148 | +define('KEYWORD_ENUM', 'enum'); |
| 149 | +define('KEYWORD_FALSE', 'false'); |
| 150 | +define('KEYWORD_FINALLY', 'finally'); |
| 151 | +define('KEYWORD_FOR', 'for'); |
| 152 | +define('KEYWORD_FUNCTION', 'function'); |
| 153 | +define('KEYWORD_IF', 'if'); |
| 154 | +define('KEYWORD_IN', 'in'); |
| 155 | +define('KEYWORD_INSTANCEOF', 'instanceof'); |
| 156 | +define('KEYWORD_NEW', 'new'); |
| 157 | +define('KEYWORD_NULL', 'null'); |
| 158 | +define('KEYWORD_RETURN', 'return'); |
| 159 | +define('KEYWORD_SWITCH', 'switch'); |
| 160 | +define('KEYWORD_THIS', 'this'); |
| 161 | +define('KEYWORD_THROW', 'throw'); |
| 162 | +define('KEYWORD_TRUE', 'true'); |
| 163 | +define('KEYWORD_TRY', 'try'); |
| 164 | +define('KEYWORD_TYPEOF', 'typeof'); |
| 165 | +define('KEYWORD_VAR', 'var'); |
| 166 | +define('KEYWORD_VOID', 'void'); |
| 167 | +define('KEYWORD_WHILE', 'while'); |
| 168 | +define('KEYWORD_WITH', 'with'); |
| 169 | + |
| 170 | + |
93 | 171 | class JSMinPlus |
94 | 172 | { |
95 | 173 | private $parser; |
— | — | @@ -1536,7 +1614,7 @@ |
1537 | 1615 | |
1538 | 1616 | if (($numargs = func_num_args()) > 2) |
1539 | 1617 | { |
1540 | | - $args = func_get_args();; |
| 1618 | + $args = func_get_args(); |
1541 | 1619 | for ($i = 2; $i < $numargs; $i++) |
1542 | 1620 | $this->addNode($args[$i]); |
1543 | 1621 | } |
— | — | @@ -1646,16 +1724,6 @@ |
1647 | 1725 | public function __construct() |
1648 | 1726 | { |
1649 | 1727 | $this->opRegExp = '#^(' . implode('|', array_map('preg_quote', array_keys($this->opTypeNames))) . ')#'; |
1650 | | - |
1651 | | - // this is quite a hidden yet convenient place to create the defines for operators and keywords |
1652 | | - foreach ($this->opTypeNames as $operand => $name) |
1653 | | - define('OP_' . $name, $operand); |
1654 | | - |
1655 | | - define('OP_UNARY_PLUS', 'U+'); |
1656 | | - define('OP_UNARY_MINUS', 'U-'); |
1657 | | - |
1658 | | - foreach ($this->keywords as $keyword) |
1659 | | - define('KEYWORD_' . strtoupper($keyword), $keyword); |
1660 | 1728 | } |
1661 | 1729 | |
1662 | 1730 | public function init($source, $filename = '', $lineno = 1) |
— | — | @@ -1977,4 +2045,3 @@ |
1978 | 2046 | public $assignOp; |
1979 | 2047 | } |
1980 | 2048 | |
1981 | | -?> |
\ No newline at end of file |
Index: branches/REL1_18/phase3/includes/specials/SpecialUndelete.php |
— | — | @@ -80,7 +80,7 @@ |
81 | 81 | ); |
82 | 82 | |
83 | 83 | // bug 19725 |
84 | | - $suppressedText = REVISION::DELETED_TEXT | REVISION::DELETED_RESTRICTED; |
| 84 | + $suppressedText = Revision::DELETED_TEXT | Revision::DELETED_RESTRICTED; |
85 | 85 | if( !$wgUser->isAllowed( 'suppressrevision' ) ) { |
86 | 86 | $conds[] = $dbr->bitAnd('ar_deleted', $suppressedText ) . |
87 | 87 | ' != ' . $suppressedText; |