Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -461,8 +461,6 @@ |
462 | 462 | 'Watchlist' => array( 'Watchlist' ), |
463 | 463 | 'Whatlinkshere' => array( 'WhatLinksHere' ), |
464 | 464 | 'Withoutinterwiki' => array( 'WithoutInterwiki' ), |
465 | | - 'GlobalFileUsage' => array( 'GlobalFileUsage' ), |
466 | | - 'GlobalTemplateUsage' => array( 'GlobalTemplateUsage' ), |
467 | 465 | ); |
468 | 466 | |
469 | 467 | /** |
— | — | @@ -1412,9 +1410,6 @@ |
1413 | 1411 | 'templatesused' => '{{PLURAL:$1|Template|Templates}} used on this page:', |
1414 | 1412 | 'templatesusedpreview' => '{{PLURAL:$1|Template|Templates}} used in this preview:', |
1415 | 1413 | 'templatesusedsection' => '{{PLURAL:$1|Template|Templates}} used in this section:', |
1416 | | -'distanttemplatesused' => 'Distant {{PLURAL:$1|template|templates}} used on this page:', |
1417 | | -'distanttemplatesusedpreview' => 'Distant {{PLURAL:$1|template|templates}} used in this preview:', |
1418 | | -'distanttemplatesusedsection' => 'Distant {{PLURAL:$1|template|templates}} used in this section:', |
1419 | 1414 | 'template-protected' => '(protected)', |
1420 | 1415 | 'template-semiprotected' => '(semi-protected)', |
1421 | 1416 | 'hiddencategories' => 'This page is a member of {{PLURAL:$1|1 hidden category|$1 hidden categories}}:', |
— | — | @@ -4580,27 +4575,7 @@ |
4581 | 4576 | 'compare-title-not-exists' => 'The title you specified does not exist.', |
4582 | 4577 | 'compare-revision-not-exists' => 'The revision you specified does not exist.', |
4583 | 4578 | |
4584 | | -# Special:GlobalFileUsage |
4585 | | -'globalfileusage' => 'Global file usage', |
4586 | | -'globalfileusage-for' => 'Global file usage for "$1"', |
4587 | | -'globalfileusage-desc' => '[[Special:GlobalFileUsage|Special page]] to view global file usage', |
4588 | | -'globalfileusage-ok' => 'Search', |
4589 | | -'globalfileusage-text' => 'Search global file usage', |
4590 | | -'globalfileusage-no-results' => '[[$1]] is not used on other wikis.', |
4591 | | -'globalfileusage-on-wiki' => 'Usage on $2', |
4592 | | -'globalfileusage-more' => 'View [[{{#Special:GlobalUsage}}/$1|more global usage]] of this file.', |
4593 | | -'globalfileusage-filterlocal' => 'Do not show local usage', |
4594 | 4579 | |
4595 | | -# Special:GlobalTemplateUsage |
4596 | | -'globaltemplateusage' => 'Global template usage', |
4597 | | -'globaltemplateusage-for' => 'Global template usage for "$1"', |
4598 | | -'globaltemplateusage-ok' => 'Search', |
4599 | | -'globaltemplateusage-text' => 'Search global template usage', |
4600 | | -'globaltemplateusage-no-results' => '[[$1]] is not used on other wikis.', |
4601 | | -'globaltemplateusage-on-wiki' => 'Usage on $2', |
4602 | | -'globaltemplateusage-more' => 'View [[{{#Special:GlobalUsage}}/$1|more global usage]] of this template.', |
4603 | | -'globaltemplateusage-filterlocal' => 'Do not show local usage', |
4604 | | - |
4605 | 4580 | # Database error messages |
4606 | 4581 | 'dberr-header' => 'This wiki has a problem', |
4607 | 4582 | 'dberr-problems' => 'Sorry! |
Index: trunk/phase3/maintenance/archives/patch-globalnamespaces.sql |
— | — | @@ -1,14 +0,0 @@ |
2 | | -CREATE TABLE /*_*/globalnamespaces ( |
3 | | - -- The wiki ID of the remote wiki |
4 | | - gn_wiki varchar(64) NOT NULL, |
5 | | - |
6 | | - -- The namespace ID of the transcluded page on that wiki |
7 | | - gn_namespace int NOT NULL, |
8 | | - |
9 | | - -- The namespace text of transcluded page |
10 | | - -- Needed for display purposes, since the local namespace ID doesn't necessarily match a distant one |
11 | | - gn_namespacetext varchar(255) NOT NULL |
12 | | - |
13 | | -) /*$wgDBTableOptions*/; |
14 | | -CREATE UNIQUE INDEX /*i*/gn_index ON /*_*/globalnamespaces (gn_wiki, gn_namespace, gn_namespacetext); |
Index: trunk/phase3/maintenance/archives/patch-globaltemplatelinks.sql |
— | — | @@ -1,36 +0,0 @@ |
2 | | -CREATE TABLE /*_*/globaltemplatelinks ( |
3 | | - -- The wiki ID of the remote wiki |
4 | | - gtl_from_wiki varchar(64) NOT NULL, |
5 | | - |
6 | | - -- The page ID of the calling page on the remote wiki |
7 | | - gtl_from_page int unsigned NOT NULL, |
8 | | - |
9 | | - -- The namespace of the calling page on the remote wiki |
10 | | - -- Needed for display purposes, since the foreign namespace ID doesn't necessarily match a local one |
11 | | - -- The link between the namespace and the namespace name is made by the globalnamespaces table |
12 | | - gtl_from_namespace int NOT NULL, |
13 | | - |
14 | | - -- The title of the calling page on the remote wiki |
15 | | - -- Needed for display purposes |
16 | | - gtl_from_title varchar(255) binary NOT NULL, |
17 | | - |
18 | | - -- The interwiki prefix of the wiki that hosts the transcluded page |
19 | | - gtl_to_prefix varchar(32) NOT NULL, |
20 | | - |
21 | | - -- The namespace of the transcluded page on that wiki |
22 | | - gtl_to_namespace int NOT NULL, |
23 | | - |
24 | | - -- The namespace name of transcluded page |
25 | | - -- Needed for display purposes, since the local namespace ID doesn't necessarily match a distant one |
26 | | - gtl_to_namespacetext varchar(255) NOT NULL, |
27 | | - |
28 | | - -- The title of the transcluded page on that wiki |
29 | | - gtl_to_title varchar(255) binary NOT NULL |
30 | | -) /*$wgDBTableOptions*/; |
31 | | - |
32 | | -CREATE UNIQUE INDEX /*i*/gtl_to_from ON /*_*/globaltemplatelinks (gtl_to_prefix, gtl_to_namespace, gtl_to_title, gtl_from_wiki, gtl_from_page); |
33 | | -CREATE UNIQUE INDEX /*i*/gtl_from_to ON /*_*/globaltemplatelinks (gtl_from_wiki, gtl_from_page, gtl_to_prefix, gtl_to_namespace, gtl_to_title); |
Index: trunk/phase3/maintenance/archives/patch-globalinterwiki.sql |
— | — | @@ -1,10 +0,0 @@ |
2 | | -CREATE TABLE /*_*/globalinterwiki ( |
3 | | - -- The wiki ID of the wiki |
4 | | - giw_wikiid varchar(64) NOT NULL, |
5 | | - |
6 | | - -- The interwiki prefix of that wiki |
7 | | - giw_prefix varchar(32) NOT NULL |
8 | | - |
9 | | -) /*$wgDBTableOptions*/; |
10 | | -CREATE UNIQUE INDEX /*i*/giw_index ON /*_*/globalinterwiki (giw_wikiid, giw_prefix); |
Index: trunk/phase3/maintenance/tables.sql |
— | — | @@ -1474,68 +1474,4 @@ |
1475 | 1475 | -- Should cover *most* configuration - strings, ints, bools, etc. |
1476 | 1476 | CREATE INDEX /*i*/cf_name_value ON /*_*/config (cf_name,cf_value(255)); |
1477 | 1477 | |
1478 | | -CREATE TABLE /*_*/globaltemplatelinks ( |
1479 | | - -- The wiki ID of the remote wiki |
1480 | | - gtl_from_wiki varchar(64) NOT NULL, |
1481 | | - |
1482 | | - -- The page ID of the calling page on the remote wiki |
1483 | | - gtl_from_page int unsigned NOT NULL, |
1484 | | - |
1485 | | - -- The namespace of the calling page on the remote wiki |
1486 | | - -- Needed for display purposes, since the foreign namespace ID doesn't necessarily match a local one |
1487 | | - -- The link between the namespace and the namespace name is made by the globalnamespaces table |
1488 | | - gtl_from_namespace int NOT NULL, |
1489 | | - |
1490 | | - -- The title of the calling page on the remote wiki |
1491 | | - -- Needed for display purposes |
1492 | | - gtl_from_title varchar(255) binary NOT NULL, |
1493 | | - |
1494 | | - -- The interwiki prefix of the wiki that hosts the transcluded page |
1495 | | - gtl_to_prefix varchar(32) NOT NULL, |
1496 | | - |
1497 | | - -- The namespace of the transcluded page on that wiki |
1498 | | - gtl_to_namespace int NOT NULL, |
1499 | | - |
1500 | | - -- The namespace name of transcluded page |
1501 | | - -- Needed for display purposes, since the local namespace ID doesn't necessarily match a distant one |
1502 | | - gtl_to_namespacetext varchar(255) NOT NULL, |
1503 | | - |
1504 | | - -- The title of the transcluded page on that wiki |
1505 | | - gtl_to_title varchar(255) binary NOT NULL |
1506 | | -) /*$wgDBTableOptions*/; |
1507 | | - |
1508 | | -CREATE UNIQUE INDEX /*i*/gtl_to_from ON /*_*/globaltemplatelinks (gtl_to_prefix, gtl_to_namespace, gtl_to_title, gtl_from_wiki, gtl_from_page); |
1509 | | -CREATE UNIQUE INDEX /*i*/gtl_from_to ON /*_*/globaltemplatelinks (gtl_from_wiki, gtl_from_page, gtl_to_prefix, gtl_to_namespace, gtl_to_title); |
1510 | | - |
1511 | | -CREATE TABLE /*_*/globalnamespaces ( |
1512 | | - -- The wiki ID of the remote wiki |
1513 | | - gn_wiki varchar(64) NOT NULL, |
1514 | | - |
1515 | | - -- The namespace ID of the transcluded page on that wiki |
1516 | | - gn_namespace int NOT NULL, |
1517 | | - |
1518 | | - -- The namespace text of transcluded page |
1519 | | - -- Needed for display purposes, since the local namespace ID doesn't necessarily match a distant one |
1520 | | - gn_namespacetext varchar(255) NOT NULL |
1521 | | - |
1522 | | -) /*$wgDBTableOptions*/; |
1523 | | -CREATE UNIQUE INDEX /*i*/gn_index ON /*_*/globalnamespaces (gn_wiki, gn_namespace, gn_namespacetext); |
1524 | | - |
1525 | | -CREATE TABLE /*_*/globalinterwiki ( |
1526 | | - -- The wiki ID of the wiki |
1527 | | - giw_wikiid varchar(64) NOT NULL, |
1528 | | - |
1529 | | - -- The interwiki prefix of that wiki |
1530 | | - giw_prefix varchar(32) NOT NULL |
1531 | | - |
1532 | | -) /*$wgDBTableOptions*/; |
1533 | | -CREATE UNIQUE INDEX /*i*/giw_index ON /*_*/globalinterwiki (giw_wikiid, giw_prefix); |
1534 | | - |
1535 | | - |
1536 | 1478 | -- vim: sw=2 sts=2 et |
Property changes on: trunk/phase3/maintenance/tables.sql |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1537 | 1479 | Reverse-merged /branches/iwtransclusion/phase3v3/maintenance/tables.sql:r92983-95395 |
Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -645,9 +645,6 @@ |
646 | 646 | 'templatesused', |
647 | 647 | 'templatesusedpreview', |
648 | 648 | 'templatesusedsection', |
649 | | - 'distanttemplatesused', |
650 | | - 'distanttemplatesusedpreview', |
651 | | - 'distanttemplatesusedsection', |
652 | 649 | 'template-protected', |
653 | 650 | 'template-semiprotected', |
654 | 651 | 'hiddencategories', |
— | — | @@ -3444,27 +3441,6 @@ |
3445 | 3442 | 'compare-title-not-exists', |
3446 | 3443 | 'compare-revision-not-exists', |
3447 | 3444 | ), |
3448 | | - 'globalfileusage' => array( |
3449 | | - 'globalfileusage', |
3450 | | - 'globalfileusage-for', |
3451 | | - 'globalfileusage-desc', |
3452 | | - 'globalfileusage-ok', |
3453 | | - 'globalfileusage-text', |
3454 | | - 'globalfileusage-no-results', |
3455 | | - 'globalfileusage-on-wiki', |
3456 | | - 'globalfileusage-more', |
3457 | | - 'globalfileusage-filterlocal', |
3458 | | - ), |
3459 | | - 'globaltemplateusage' => array( |
3460 | | - 'globaltemplateusage', |
3461 | | - 'globaltemplateusage-for', |
3462 | | - 'globaltemplateusage-ok', |
3463 | | - 'globaltemplateusage-text', |
3464 | | - 'globaltemplateusage-no-results', |
3465 | | - 'globaltemplateusage-on-wiki', |
3466 | | - 'globaltemplateusage-more', |
3467 | | - 'globaltemplateusage-filterlocal', |
3468 | | - ), |
3469 | 3445 | 'db-error-messages' => array( |
3470 | 3446 | 'dberr-header', |
3471 | 3447 | 'dberr-problems', |
— | — | @@ -3752,8 +3728,6 @@ |
3753 | 3729 | 'external_images' => 'External image whitelist', |
3754 | 3730 | 'special-tags' => 'Special:Tags', |
3755 | 3731 | 'comparepages' => 'Special:ComparePages', |
3756 | | - 'globalfileusage' => 'Special:GlobalFileUsage', |
3757 | | - 'globaltemplateusage' => 'Special:GlobalTemplateUsage', |
3758 | 3732 | 'db-error-messages' => 'Database error messages', |
3759 | 3733 | 'html-forms' => 'HTML forms', |
3760 | 3734 | 'sqlite' => 'SQLite database support', |
Index: trunk/phase3/includes/GlobalUsageQuery.php |
— | — | @@ -1,367 +0,0 @@ |
2 | | -<?php |
3 | | -/** |
4 | | - * A helper class to query the globalimagelinks table |
5 | | - * |
6 | | - */ |
7 | | -class GlobalUsageQuery { |
8 | | - private $limit = 50; |
9 | | - private $offset; |
10 | | - private $hasMore = false; |
11 | | - private $filterLocal = false; |
12 | | - private $result; |
13 | | - private $continue; |
14 | | - private $reversed = false; |
15 | | - private $target = null; |
16 | | - |
17 | | - /** |
18 | | - * @param $target mixed Title or db key, or array of db keys of target(s) |
19 | | - */ |
20 | | - public function __construct( $target ) { |
21 | | - global $wgGlobalDatabase; |
22 | | - $this->db = wfGetDB( DB_SLAVE, array(), $wgGlobalDatabase ); |
23 | | - if ( $target instanceof Title && $target->getNamespace( ) == NS_FILE ) { |
24 | | - $this->target = $target->getDBKey(); |
25 | | - } else { |
26 | | - $this->target = $target; |
27 | | - } |
28 | | - $this->offset = array(); |
29 | | - } |
30 | | - |
31 | | - /** |
32 | | - * Set the offset parameter |
33 | | - * |
34 | | - * @param $offset string offset |
35 | | - * @param $reversed bool True if this is the upper offset |
36 | | - */ |
37 | | - public function setOffset( $offset, $reversed = null ) { |
38 | | - if ( !is_null( $reversed ) ) { |
39 | | - $this->reversed = $reversed; |
40 | | - } |
41 | | - |
42 | | - if ( !is_array( $offset ) ) { |
43 | | - $offset = explode( '|', $offset ); |
44 | | - } |
45 | | - |
46 | | - if ( count( $offset ) == 3 ) { |
47 | | - $this->offset = $offset; |
48 | | - return true; |
49 | | - } else { |
50 | | - return false; |
51 | | - } |
52 | | - } |
53 | | - /** |
54 | | - * Return the offset set by the user |
55 | | - * |
56 | | - * @return array offset |
57 | | - */ |
58 | | - public function getOffsetString() { |
59 | | - return implode( '|', $this->offset ); |
60 | | - } |
61 | | - /** |
62 | | - * Is the result reversed |
63 | | - * |
64 | | - * @return bool |
65 | | - */ |
66 | | - public function isReversed() { |
67 | | - return $this->reversed; |
68 | | - } |
69 | | - |
70 | | - /** |
71 | | - * Returns the string used for continuation in a file search |
72 | | - * |
73 | | - * @return string |
74 | | - * |
75 | | - */ |
76 | | - public function getContinueFileString() { |
77 | | - if ( $this->hasMore() ) { |
78 | | - return "{$this->lastRow->gil_to}|{$this->lastRow->gil_wiki}|{$this->lastRow->gil_page}"; |
79 | | - } else { |
80 | | - return ''; |
81 | | - } |
82 | | - } |
83 | | - |
84 | | - /** |
85 | | - * Returns the string used for continuation in a template search |
86 | | - * |
87 | | - * @return string |
88 | | - * |
89 | | - */ |
90 | | - public function getContinueTemplateString() { |
91 | | - if ( $this->hasMore() ) { |
92 | | - return "{$this->lastRow->gtl_to_title}|{$this->lastRow->gtl_from_wiki}|{$this->lastRow->gtl_from_page}"; |
93 | | - } else { |
94 | | - return ''; |
95 | | - } |
96 | | - } |
97 | | - |
98 | | - /** |
99 | | - * Set the maximum amount of items to return. Capped at 500. |
100 | | - * |
101 | | - * @param $limit int The limit |
102 | | - */ |
103 | | - public function setLimit( $limit ) { |
104 | | - $this->limit = min( $limit, 500 ); |
105 | | - } |
106 | | - /** |
107 | | - * Returns the user set limit |
108 | | - */ |
109 | | - public function getLimit() { |
110 | | - return $this->limit; |
111 | | - } |
112 | | - |
113 | | - /** |
114 | | - * Set whether to filter out the local usage |
115 | | - */ |
116 | | - public function filterLocal( $value = true ) { |
117 | | - $this->filterLocal = $value; |
118 | | - } |
119 | | - |
120 | | - /** |
121 | | - * Executes the query for a file search |
122 | | - */ |
123 | | - public function searchTemplate() { |
124 | | - global $wgLocalInterwiki; |
125 | | - |
126 | | - /* Construct a where clause */ |
127 | | - // Add target template(s) |
128 | | - $where = array( 'gtl_to_prefix' => $wgLocalInterwiki, |
129 | | - 'gtl_to_namespace' => $this->target->getNamespace( ), |
130 | | - 'gtl_to_title' => $this->target->getDBkey( ) |
131 | | - ); |
132 | | - |
133 | | - // Set the continuation condition |
134 | | - $order = 'ASC'; |
135 | | - if ( $this->offset ) { |
136 | | - $qTo = $this->db->addQuotes( $this->offset[0] ); |
137 | | - $qWiki = $this->db->addQuotes( $this->offset[1] ); |
138 | | - $qPage = intval( $this->offset[2] ); |
139 | | - |
140 | | - // Check which limit we got in order to determine which way to traverse rows |
141 | | - if ( $this->reversed ) { |
142 | | - // Reversed traversal; do not include offset row |
143 | | - $op1 = '<'; |
144 | | - $op2 = '<'; |
145 | | - $order = 'DESC'; |
146 | | - } else { |
147 | | - // Normal traversal; include offset row |
148 | | - $op1 = '>'; |
149 | | - $op2 = '>='; |
150 | | - $order = 'ASC'; |
151 | | - } |
152 | | - |
153 | | - $where[] = "(gtl_to_title $op1 $qTo) OR " . |
154 | | - "(gtl_to_title = $qTo AND gtl_from_wiki $op1 $qWiki) OR " . |
155 | | - "(gtl_to_title = $qTo AND gtl_from_wiki = $qWiki AND gtl_from_page $op2 $qPage)"; |
156 | | - } |
157 | | - |
158 | | - /* Perform select (Duh.) */ |
159 | | - $res = $this->db->select( |
160 | | - array( |
161 | | - 'globaltemplatelinks', |
162 | | - 'globalnamespaces' |
163 | | - ), |
164 | | - array( |
165 | | - 'gtl_to_title', |
166 | | - 'gtl_from_wiki', |
167 | | - 'gtl_from_page', |
168 | | - 'gtl_from_namespace', |
169 | | - 'gtl_from_title' |
170 | | - ), |
171 | | - $where, |
172 | | - __METHOD__, |
173 | | - array( |
174 | | - 'ORDER BY' => "gtl_to_title $order, gtl_from_wiki $order, gtl_from_page $order", |
175 | | - // Select an extra row to check whether we have more rows available |
176 | | - 'LIMIT' => $this->limit + 1, |
177 | | - ), |
178 | | - array( |
179 | | - 'gtl_from_namespace = gn_namespace' |
180 | | - ) |
181 | | - ); |
182 | | - |
183 | | - /* Process result */ |
184 | | - // Always return the result in the same order; regardless whether reversed was specified |
185 | | - // reversed is really only used to determine from which direction the offset is |
186 | | - $rows = array(); |
187 | | - foreach ( $res as $row ) { |
188 | | - $rows[] = $row; |
189 | | - } |
190 | | - if ( $this->reversed ) { |
191 | | - $rows = array_reverse( $rows ); |
192 | | - } |
193 | | - |
194 | | - // Build the result array |
195 | | - $count = 0; |
196 | | - $this->hasMore = false; |
197 | | - $this->result = array(); |
198 | | - foreach ( $rows as $row ) { |
199 | | - $count++; |
200 | | - if ( $count > $this->limit ) { |
201 | | - // We've reached the extra row that indicates that there are more rows |
202 | | - $this->hasMore = true; |
203 | | - $this->lastRow = $row; |
204 | | - break; |
205 | | - } |
206 | | - |
207 | | - if ( !isset( $this->result[$row->gtl_to_title] ) ) { |
208 | | - $this->result[$row->gtl_to_title] = array(); |
209 | | - } |
210 | | - if ( !isset( $this->result[$row->gtl_to_title][$row->gtl_from_wiki] ) ) { |
211 | | - $this->result[$row->gtl_to_title][$row->gtl_from_wiki] = array(); |
212 | | - } |
213 | | - |
214 | | - $this->result[$row->gtl_to_title][$row->gtl_from_wiki][] = array( |
215 | | - 'template' => $row->gtl_to_title, |
216 | | - 'id' => $row->gtl_from_page, |
217 | | - 'namespace' => $row->gn_namespacetext, |
218 | | - 'title' => $row->gtl_from_title, |
219 | | - 'wiki' => $row->gtl_from_wiki, |
220 | | - ); |
221 | | - } |
222 | | - } |
223 | | - |
224 | | - /** |
225 | | - * Executes the query for a template search |
226 | | - */ |
227 | | - public function searchFile() { |
228 | | - /* Construct a where clause */ |
229 | | - // Add target image(s) |
230 | | - $where = array( 'gil_to' => $this->target ); |
231 | | - |
232 | | - if ( $this->filterLocal ) { |
233 | | - // Don't show local file usage |
234 | | - $where[] = 'gil_wiki != ' . $this->db->addQuotes( wfWikiId() ); |
235 | | - } |
236 | | - |
237 | | - // Set the continuation condition |
238 | | - $order = 'ASC'; |
239 | | - if ( $this->offset ) { |
240 | | - $qTo = $this->db->addQuotes( $this->offset[0] ); |
241 | | - $qWiki = $this->db->addQuotes( $this->offset[1] ); |
242 | | - $qPage = intval( $this->offset[2] ); |
243 | | - |
244 | | - // Check which limit we got in order to determine which way to traverse rows |
245 | | - if ( $this->reversed ) { |
246 | | - // Reversed traversal; do not include offset row |
247 | | - $op1 = '<'; |
248 | | - $op2 = '<'; |
249 | | - $order = 'DESC'; |
250 | | - } else { |
251 | | - // Normal traversal; include offset row |
252 | | - $op1 = '>'; |
253 | | - $op2 = '>='; |
254 | | - $order = 'ASC'; |
255 | | - } |
256 | | - |
257 | | - $where[] = "(gil_to $op1 $qTo) OR " . |
258 | | - "(gil_to = $qTo AND gil_wiki $op1 $qWiki) OR " . |
259 | | - "(gil_to = $qTo AND gil_wiki = $qWiki AND gil_page $op2 $qPage)"; |
260 | | - } |
261 | | - |
262 | | - /* Perform select (Duh.) */ |
263 | | - $res = $this->db->select( 'globalimagelinks', |
264 | | - array( |
265 | | - 'gil_to', |
266 | | - 'gil_wiki', |
267 | | - 'gil_page', |
268 | | - 'gil_page_namespace', |
269 | | - 'gil_page_title' |
270 | | - ), |
271 | | - $where, |
272 | | - __METHOD__, |
273 | | - array( |
274 | | - 'ORDER BY' => "gil_to $order, gil_wiki $order, gil_page $order", |
275 | | - // Select an extra row to check whether we have more rows available |
276 | | - 'LIMIT' => $this->limit + 1, |
277 | | - ) |
278 | | - ); |
279 | | - |
280 | | - /* Process result */ |
281 | | - // Always return the result in the same order; regardless whether reversed was specified |
282 | | - // reversed is really only used to determine from which direction the offset is |
283 | | - $rows = array(); |
284 | | - foreach ( $res as $row ) { |
285 | | - $rows[] = $row; |
286 | | - } |
287 | | - if ( $this->reversed ) { |
288 | | - $rows = array_reverse( $rows ); |
289 | | - } |
290 | | - |
291 | | - // Build the result array |
292 | | - $count = 0; |
293 | | - $this->hasMore = false; |
294 | | - $this->result = array(); |
295 | | - foreach ( $rows as $row ) { |
296 | | - $count++; |
297 | | - if ( $count > $this->limit ) { |
298 | | - // We've reached the extra row that indicates that there are more rows |
299 | | - $this->hasMore = true; |
300 | | - $this->lastRow = $row; |
301 | | - break; |
302 | | - } |
303 | | - |
304 | | - if ( !isset( $this->result[$row->gil_to] ) ) { |
305 | | - $this->result[$row->gil_to] = array(); |
306 | | - } |
307 | | - if ( !isset( $this->result[$row->gil_to][$row->gil_wiki] ) ) { |
308 | | - $this->result[$row->gil_to][$row->gil_wiki] = array(); |
309 | | - } |
310 | | - |
311 | | - $this->result[$row->gil_to][$row->gil_wiki][] = array( |
312 | | - 'image' => $row->gil_to, |
313 | | - 'id' => $row->gil_page, |
314 | | - 'namespace' => $row->gil_page_namespace, |
315 | | - 'title' => $row->gil_page_title, |
316 | | - 'wiki' => $row->gil_wiki, |
317 | | - ); |
318 | | - } |
319 | | - } |
320 | | - |
321 | | - /** |
322 | | - * Returns the result set. The result is a 4 dimensional array |
323 | | - * (file, wiki, page), whose items are arrays with keys: |
324 | | - * - image or template: File name or template name |
325 | | - * - id: Page id |
326 | | - * - namespace: Page namespace text |
327 | | - * - title: Unprefixed page title |
328 | | - * - wiki: Wiki id |
329 | | - * |
330 | | - * @return array Result set |
331 | | - */ |
332 | | - public function getResult() { |
333 | | - return $this->result; |
334 | | - } |
335 | | - /** |
336 | | - * Returns a 3 dimensional array with the result of the first file. Useful |
337 | | - * if only one resource was queried. |
338 | | - * |
339 | | - * For further information see documentation of getResult() |
340 | | - * |
341 | | - * @return array Result set |
342 | | - */ |
343 | | - public function getSingleResult() { |
344 | | - if ( $this->result ) { |
345 | | - return current( $this->result ); |
346 | | - } else { |
347 | | - return array(); |
348 | | - } |
349 | | - } |
350 | | - |
351 | | - /** |
352 | | - * Returns whether there are more results |
353 | | - * |
354 | | - * @return bool |
355 | | - */ |
356 | | - public function hasMore() { |
357 | | - return $this->hasMore; |
358 | | - } |
359 | | - |
360 | | - /** |
361 | | - * Returns the result length |
362 | | - * |
363 | | - * @return int |
364 | | - */ |
365 | | - public function count() { |
366 | | - return count( $this->result ); |
367 | | - } |
368 | | -} |
Index: trunk/phase3/includes/AutoLoader.php |
— | — | @@ -559,7 +559,6 @@ |
560 | 560 | 'BmpHandler' => 'includes/media/BMP.php', |
561 | 561 | 'DjVuHandler' => 'includes/media/DjVu.php', |
562 | 562 | 'Exif' => 'includes/media/Exif.php', |
563 | | - 'GlobalUsageQuery' => 'includes/GlobalUsageQuery.php', |
564 | 563 | 'FormatExif' => 'includes/media/FormatMetadata.php', |
565 | 564 | 'FormatMetadata' => 'includes/media/FormatMetadata.php', |
566 | 565 | 'GIFHandler' => 'includes/media/GIF.php', |
— | — | @@ -773,8 +772,6 @@ |
774 | 773 | 'SpecialEmailUser' => 'includes/specials/SpecialEmailuser.php', |
775 | 774 | 'SpecialExport' => 'includes/specials/SpecialExport.php', |
776 | 775 | 'SpecialFilepath' => 'includes/specials/SpecialFilepath.php', |
777 | | - 'SpecialGlobalFileUsage' => 'includes/specials/SpecialGlobalFileUsage.php', |
778 | | - 'SpecialGlobalTemplateUsage' => 'includes/specials/SpecialGlobalTemplateUsage.php', |
779 | 776 | 'SpecialImport' => 'includes/specials/SpecialImport.php', |
780 | 777 | 'SpecialListFiles' => 'includes/specials/SpecialListfiles.php', |
781 | 778 | 'SpecialListGroupRights' => 'includes/specials/SpecialListgrouprights.php', |
Property changes on: trunk/phase3/includes/AutoLoader.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
782 | 779 | Reverse-merged /branches/iwtransclusion/phase3v3/includes/AutoLoader.php:r92983-95395 |
783 | 780 | Reverse-merged /branches/iwtransclusion/phase3/includes/AutoLoader.php:r70966,71049 |
784 | 781 | Reverse-merged /branches/iwtransclusion/phase3v2/includes/AutoLoader.php:r87111-87112 |
Index: trunk/phase3/includes/Linker.php |
— | — | @@ -1662,42 +1662,6 @@ |
1663 | 1663 | } |
1664 | 1664 | |
1665 | 1665 | /** |
1666 | | - * Returns HTML for the "templates used on this page" list. |
1667 | | - * |
1668 | | - * @param $templates Array of templates from Article::getUsedTemplate |
1669 | | - * or similar |
1670 | | - * @param $preview Boolean: whether this is for a preview |
1671 | | - * @param $section Boolean: whether this is for a section edit |
1672 | | - * @return String: HTML output |
1673 | | - */ |
1674 | | - public static function formatDistantTemplates( $templates, $preview = false, $section = false ) { |
1675 | | - wfProfileIn( __METHOD__ ); |
1676 | | - |
1677 | | - $outText = ''; |
1678 | | - if ( count( $templates ) > 0 ) { |
1679 | | - |
1680 | | - # Construct the HTML |
1681 | | - $outText = '<div class="mw-templatesUsedExplanation">'; |
1682 | | - if ( $preview ) { |
1683 | | - $outText .= wfMsgExt( 'distanttemplatesusedpreview', array( 'parse' ), count( $templates ) ); |
1684 | | - } elseif ( $section ) { |
1685 | | - $outText .= wfMsgExt( 'distanttemplatesusedsection', array( 'parse' ), count( $templates ) ); |
1686 | | - } else { |
1687 | | - $outText .= wfMsgExt( 'distanttemplatesused', array( 'parse' ), count( $templates ) ); |
1688 | | - } |
1689 | | - $outText .= "</div><ul>\n"; |
1690 | | - |
1691 | | - usort( $templates, array( 'Title', 'compare' ) ); |
1692 | | - foreach ( $templates as $titleObj ) { |
1693 | | - $outText .= '<li>' . self::link( $titleObj ) . '</li>'; |
1694 | | - } |
1695 | | - $outText .= '</ul>'; |
1696 | | - } |
1697 | | - wfProfileOut( __METHOD__ ); |
1698 | | - return $outText; |
1699 | | - } |
1700 | | - |
1701 | | - /** |
1702 | 1666 | * Returns HTML for the "hidden categories on this page" list. |
1703 | 1667 | * |
1704 | 1668 | * @param $hiddencats Array of hidden categories from Article::getHiddenCategories |
Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -1817,39 +1817,6 @@ |
1818 | 1818 | } |
1819 | 1819 | |
1820 | 1820 | /** |
1821 | | - * Build a partial where clause from a 3-d array |
1822 | | - * The keys on each level may be either integers or strings. |
1823 | | - * |
1824 | | - * @param $data Array: organized as 3-d array(baseKeyVal => array(middleKeyVal => array(subKeyVal => <ignored>, ...), ...), ...) |
1825 | | - * @param $baseKey String: field name to match the base-level keys to (eg 'gtl_to_prefix') |
1826 | | - * @param $middleKey String: field name to match the middle-level keys to (eg 'gtl_to_namespace') |
1827 | | - * @param $subKey String: field name to match the sub-level keys to (eg 'gtl_to_title') |
1828 | | - * @return Mixed: string SQL fragment, or false if no items in array. |
1829 | | - */ |
1830 | | - function makeWhereFrom3d( $data, $baseKey, $middleKey, $subKey ) { |
1831 | | - $conds = array(); |
1832 | | - foreach ( $data as $base => $subdata ) { |
1833 | | - foreach ( $subdata as $middle => $sub ) { |
1834 | | - if ( count( $sub ) ) { |
1835 | | - $conds[] = $this->makeList( |
1836 | | - array( $baseKey => $base, |
1837 | | - $middleKey => $middle, |
1838 | | - $subKey => array_keys( $sub ) ), |
1839 | | - LIST_AND |
1840 | | - ); |
1841 | | - } |
1842 | | - } |
1843 | | - } |
1844 | | - |
1845 | | - if ( $conds ) { |
1846 | | - return $this->makeList( $conds, LIST_OR ); |
1847 | | - } else { |
1848 | | - // Nothing to search for... |
1849 | | - return false; |
1850 | | - } |
1851 | | - } |
1852 | | - |
1853 | | - /** |
1854 | 1821 | * Bitwise operations |
1855 | 1822 | */ |
1856 | 1823 | |
Property changes on: trunk/phase3/includes/db/Database.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1857 | 1824 | Reverse-merged /branches/iwtransclusion/phase3/includes/db/Database.php:r70576,70764 |
1858 | 1825 | Reverse-merged /branches/iwtransclusion/phase3v2/includes/db/Database.php:r87108 |
1859 | 1826 | Reverse-merged /branches/iwtransclusion/phase3v3/includes/db/Database.php:r92983-95395 |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -2998,35 +2998,14 @@ |
2999 | 2999 | $wgPreprocessorCacheThreshold = 1000; |
3000 | 3000 | |
3001 | 3001 | /** |
3002 | | - * Enable interwiki transcluding. Only when iw_trans=1 in the interwiki table. |
3003 | | - * If the interwiki prefix is associated with a wiki ID in the interwiki table, |
3004 | | - * then the distant templates will be retrieved in the distant DB. If there is |
3005 | | - * no wiki ID but a API URL for that prefix, the distant templates will be |
3006 | | - * retrieved using the API and cached in memcached. |
| 3002 | + * Enable interwiki transcluding. Only when iw_trans=1. |
3007 | 3003 | */ |
3008 | | -$wgEnableInterwikiTranscluding = false; |
| 3004 | +$wgEnableScaryTranscluding = false; |
3009 | 3005 | |
3010 | 3006 | /** |
3011 | | - * If $wgEnableInterwikiTranscluding is set to true and if an interwiki prefix |
3012 | | - * is associated with a wiki ID, then, this option should be set to true to |
3013 | | - * enable the cache invalidation of the distant pages when the local templates |
3014 | | - * are edited and also to display the list of the distant templates used by |
3015 | | - * the local pages. Enabling this requires to set up a global shared database |
3016 | | - * (see next option $wgGlobalDatabase). |
| 3007 | + * (see next option $wgGlobalDatabase). |
3017 | 3008 | */ |
3018 | | -$wgEnableInterwikiTemplatesTracking = false; |
3019 | | - |
3020 | | -/** |
3021 | | - * If $wgEnableInterwikiTemplatesTracking is set to true, this option should |
3022 | | - * contain the wiki ID of the database that hosts the globaltemplatelinks table. |
3023 | 3009 | */ |
3024 | | -$wgGlobalDatabase = ''; |
3025 | | - |
3026 | | -/** |
3027 | | - * If $wgEnableInterwikiTranscluding is set to true and if an interwiki |
3028 | | - * prefix is associated with an API URL and no wiki ID, this will be |
3029 | | - * the expiry time for the transcluded templates cached in memcached. |
3030 | | - */ |
3031 | 3010 | $wgTranscludeCacheExpiry = 3600; |
3032 | 3011 | |
3033 | 3012 | /** @} */ # end of parser settings } |
— | — | @@ -5198,8 +5177,6 @@ |
5199 | 5178 | 'Export' => 'pagetools', |
5200 | 5179 | 'Import' => 'pagetools', |
5201 | 5180 | 'Whatlinkshere' => 'pagetools', |
5202 | | - 'GlobalFileUsage' => 'pagetools', |
5203 | | - 'GlobalTemplateUsage' => 'pagetools', |
5204 | 5181 | |
5205 | 5182 | 'Statistics' => 'wiki', |
5206 | 5183 | 'Version' => 'wiki', |
Index: trunk/phase3/includes/specials/SpecialGlobalTemplateUsage.php |
— | — | @@ -1,196 +0,0 @@ |
2 | | -<?php |
3 | | -/** |
4 | | - * This file has been copied from Extension:GlobalUsage and adapted |
5 | | - * to show the usage of a template instead of a file. |
6 | | - * Special page to show global template usage. Also contains hook functions for |
7 | | - * showing usage on an template page. |
8 | | - * |
9 | | - * @author Bryan Tong Minh <bryan.tongminh@gmail.com> |
10 | | - * @author Peter Potrowl <peter017@gmail.com> |
11 | | - */ |
12 | | - |
13 | | -class SpecialGlobalTemplateUsage extends SpecialPage { |
14 | | - public function __construct() { |
15 | | - parent::__construct( 'GlobalTemplateUsage' ); |
16 | | - } |
17 | | - |
18 | | - /** |
19 | | - * Entry point |
20 | | - */ |
21 | | - public function execute( $par ) { |
22 | | - $target = $par ? $par : $this->getRequest()->getVal( 'target' ); |
23 | | - $this->target = Title::newFromText( $target ); |
24 | | - |
25 | | - $this->setHeaders(); |
26 | | - |
27 | | - $this->showForm(); |
28 | | - |
29 | | - if ( $this->target !== null ) { |
30 | | - $this->getOutput()->setPageTitle( wfMsg( 'globaltemplateusage-for', $this->target->getPrefixedText() ) ); |
31 | | - |
32 | | - $this->showResult(); |
33 | | - } |
34 | | - } |
35 | | - |
36 | | - /** |
37 | | - * Shows the search form |
38 | | - */ |
39 | | - private function showForm() { |
40 | | - global $wgScript; |
41 | | - |
42 | | - /* Build form */ |
43 | | - $html = Xml::openElement( 'form', array( 'action' => $wgScript ) ) . "\n"; |
44 | | - // Name of SpecialPage |
45 | | - $html .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . "\n"; |
46 | | - // Limit |
47 | | - $html .= Html::hidden( 'limit', $this->getRequest()->getInt( 'limit', 50 ) ); |
48 | | - // Input box with target prefilled if available |
49 | | - $formContent = "\t" . Xml::input( 'target', 40, is_null( $this->target ) ? '' |
50 | | - : $this->target->getPrefixedText( ) ) |
51 | | - // Submit button |
52 | | - . "\n\t" . Xml::element( 'input', array( |
53 | | - 'type' => 'submit', |
54 | | - 'value' => wfMsg( 'globaltemplateusage-ok' ) |
55 | | - ) ); |
56 | | - |
57 | | - // Wrap the entire form in a nice fieldset |
58 | | - $html .= Xml::fieldSet( wfMsg( 'globaltemplateusage-text' ), $formContent ) . "\n</form>"; |
59 | | - |
60 | | - $this->getOutput()->addHtml( $html ); |
61 | | - } |
62 | | - |
63 | | - /** |
64 | | - * Creates as queryer and executes it based on the WebRequest object |
65 | | - */ |
66 | | - private function showResult() { |
67 | | - $request = $this->getRequest(); |
68 | | - $query = new GlobalUsageQuery( $this->target ); |
69 | | - |
70 | | - // Extract params from the WebRequest object |
71 | | - if ( $request->getText( 'from' ) ) { |
72 | | - $query->setOffset( $request->getText( 'from' ) ); |
73 | | - } elseif ( $request->getText( 'to' ) ) { |
74 | | - $query->setOffset( $request->getText( 'to' ), true ); |
75 | | - } |
76 | | - $query->setLimit( $request->getInt( 'limit', 50 ) ); |
77 | | - |
78 | | - // Perform query |
79 | | - $query->searchTemplate(); |
80 | | - |
81 | | - $out = $this->getOutput(); |
82 | | - |
83 | | - // Don't show form element if there is no data |
84 | | - if ( $query->count() == 0 ) { |
85 | | - $out->addWikiMsg( 'globaltemplateusage-no-results', $this->target->getPrefixedText( ) ); |
86 | | - return; |
87 | | - } |
88 | | - |
89 | | - $navbar = $this->getNavBar( $query ); |
90 | | - $targetName = $this->target->getPrefixedText( ); |
91 | | - |
92 | | - // Top navbar |
93 | | - $out->addHtml( $navbar ); |
94 | | - |
95 | | - $out->addHtml( '<div id="mw-globaltemplateusage-result">' ); |
96 | | - foreach ( $query->getSingleResult() as $wiki => $result ) { |
97 | | - $out->addHtml( |
98 | | - '<h2>' . wfMsgExt( |
99 | | - 'globaltemplateusage-on-wiki', 'parseinline', |
100 | | - $targetName, WikiMap::getWikiName( $wiki ) ) |
101 | | - . "</h2><ul>\n" ); |
102 | | - foreach ( $result as $item ) { |
103 | | - $out->addHtml( "\t<li>" . self::formatItem( $item ) . "</li>\n" ); |
104 | | - } |
105 | | - $out->addHtml( "</ul>\n" ); |
106 | | - } |
107 | | - $out->addHtml( '</div>' ); |
108 | | - |
109 | | - // Bottom navbar |
110 | | - $out->addHtml( $navbar ); |
111 | | - } |
112 | | - |
113 | | - /** |
114 | | - * Helper to format a specific item |
115 | | - */ |
116 | | - public static function formatItem( $item ) { |
117 | | - if ( !$item['namespace'] ) { |
118 | | - $page = $item['title']; |
119 | | - } else { |
120 | | - $page = "{$item['namespace']}:{$item['title']}"; |
121 | | - } |
122 | | - |
123 | | - $link = WikiMap::makeForeignLink( $item['wiki'], $page, |
124 | | - str_replace( '_', ' ', $page ) ); |
125 | | - // Return only the title if no link can be constructed |
126 | | - return $link === false ? $page : $link; |
127 | | - } |
128 | | - |
129 | | - /** |
130 | | - * Helper function to create the navbar, stolen from wfViewPrevNext |
131 | | - * |
132 | | - * @param $query GlobalTemplateUsageQuery An executed GlobalTemplateUsageQuery object |
133 | | - * @return string Navbar HTML |
134 | | - */ |
135 | | - protected function getNavBar( $query ) { |
136 | | - $lang = $this->getLang(); |
137 | | - $target = $this->target->getPrefixedText(); |
138 | | - $limit = $query->getLimit(); |
139 | | - $fmtLimit = $lang->formatNum( $limit ); |
140 | | - |
141 | | - # Find out which strings are for the prev and which for the next links |
142 | | - $offset = $query->getOffsetString(); |
143 | | - $continue = $query->getContinueTemplateString(); |
144 | | - if ( $query->isReversed() ) { |
145 | | - $from = $offset; |
146 | | - $to = $continue; |
147 | | - } else { |
148 | | - $from = $continue; |
149 | | - $to = $offset; |
150 | | - } |
151 | | - |
152 | | - # Get prev/next link display text |
153 | | - $prev = wfMsgExt( 'prevn', array( 'parsemag', 'escape' ), $fmtLimit ); |
154 | | - $next = wfMsgExt( 'nextn', array( 'parsemag', 'escape' ), $fmtLimit ); |
155 | | - # Get prev/next link title text |
156 | | - $pTitle = wfMsgExt( 'prevn-title', array( 'parsemag', 'escape' ), $fmtLimit ); |
157 | | - $nTitle = wfMsgExt( 'nextn-title', array( 'parsemag', 'escape' ), $fmtLimit ); |
158 | | - |
159 | | - # Fetch the title object |
160 | | - $title = $this->getTitle(); |
161 | | - |
162 | | - # Make 'previous' link |
163 | | - if ( $to ) { |
164 | | - $attr = array( 'title' => $pTitle, 'class' => 'mw-prevlink' ); |
165 | | - $q = array( 'limit' => $limit, 'to' => $to, 'target' => $target ); |
166 | | - $plink = Linker::link( $title, $prev, $attr, $q ); |
167 | | - } else { |
168 | | - $plink = $prev; |
169 | | - } |
170 | | - |
171 | | - # Make 'next' link |
172 | | - if ( $from ) { |
173 | | - $attr = array( 'title' => $nTitle, 'class' => 'mw-nextlink' ); |
174 | | - $q = array( 'limit' => $limit, 'from' => $from, 'target' => $target ); |
175 | | - $nlink = Linker::link( $title, $next, $attr, $q ); |
176 | | - } else { |
177 | | - $nlink = $next; |
178 | | - } |
179 | | - |
180 | | - # Make links to set number of items per page |
181 | | - $numLinks = array(); |
182 | | - foreach ( array( 20, 50, 100, 250, 500 ) as $num ) { |
183 | | - $fmtLimit = $lang->formatNum( $num ); |
184 | | - |
185 | | - $q = array( 'offset' => $offset, 'limit' => $num, 'target' => $target ); |
186 | | - $lTitle = wfMsgExt( 'shown-title', array( 'parsemag', 'escape' ), $num ); |
187 | | - $attr = array( 'title' => $lTitle, 'class' => 'mw-numlink' ); |
188 | | - |
189 | | - $numLinks[] = Linker::link( $title, $fmtLimit, $attr, $q ); |
190 | | - } |
191 | | - $nums = $lang->pipeList( $numLinks ); |
192 | | - |
193 | | - return wfMsgHtml( 'viewprevnext', $plink, $nlink, $nums ); |
194 | | - } |
195 | | -} |
196 | | - |
197 | | - |
Index: trunk/phase3/includes/specials/SpecialGlobalFileUsage.php |
— | — | @@ -1,213 +0,0 @@ |
2 | | -<?php |
3 | | -/** |
4 | | - * Special page to show global file usage. Also contains hook functions for |
5 | | - * showing usage on an image page. |
6 | | - */ |
7 | | - |
8 | | -class SpecialGlobalFileUsage extends SpecialPage { |
9 | | - public function __construct() { |
10 | | - parent::__construct( 'GlobalFileUsage' ); |
11 | | - } |
12 | | - |
13 | | - /** |
14 | | - * Entry point |
15 | | - */ |
16 | | - public function execute( $par ) { |
17 | | - $request = $this->getRequest(); |
18 | | - $target = $par ? $par : $request->getVal( 'target' ); |
19 | | - $this->target = Title::makeTitleSafe( NS_FILE, $target ); |
20 | | - |
21 | | - $this->filterLocal = $request->getCheck( 'filterlocal' ); |
22 | | - |
23 | | - $this->setHeaders(); |
24 | | - |
25 | | - $this->showForm(); |
26 | | - |
27 | | - if ( !is_null( $this->target ) ) { |
28 | | - $this->getOutput()->setPageTitle( wfMsg( 'globalfileusage-for', $this->target->getPrefixedText() ) ); |
29 | | - $this->showResult(); |
30 | | - } |
31 | | - } |
32 | | - |
33 | | - /** |
34 | | - * Shows the search form |
35 | | - */ |
36 | | - private function showForm() { |
37 | | - global $wgScript, $wgContLang; |
38 | | - |
39 | | - /* Build form */ |
40 | | - $html = Xml::openElement( 'form', array( 'action' => $wgScript ) ) . "\n"; |
41 | | - // Name of SpecialPage |
42 | | - $html .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . "\n"; |
43 | | - // Limit |
44 | | - $html .= Html::hidden( 'limit', $this->getRequest()->getInt( 'limit', 50 ) ); |
45 | | - // Input box with target prefilled if available |
46 | | - $formContent = "\t" . Xml::input( 'target', 40, is_null( $this->target ) ? '' |
47 | | - : $this->target->getText() ) |
48 | | - // Submit button |
49 | | - . "\n\t" . Xml::element( 'input', array( |
50 | | - 'type' => 'submit', |
51 | | - 'value' => wfMsg( 'globalfileusage-ok' ) |
52 | | - ) ) |
53 | | - // Filter local checkbox |
54 | | - . "\n\t<p>" . Xml::checkLabel( wfMsg( 'globalfileusage-filterlocal' ), |
55 | | - 'filterlocal', 'mw-filterlocal', $this->filterLocal ) . '</p>'; |
56 | | - |
57 | | - if ( !is_null( $this->target ) ) { |
58 | | - $file = wfFindFile( $this->target ); |
59 | | - if ( $file !== null ) { |
60 | | - // Show the image if it exists |
61 | | - $html .= Linker::makeImageLink2( $this->target, $file, |
62 | | - array( 'align' => $this->getLang()->alignEnd(), 'thumbnail' => true ) ); |
63 | | - } |
64 | | - } |
65 | | - |
66 | | - // Wrap the entire form in a nice fieldset |
67 | | - $html .= Xml::fieldSet( wfMsg( 'globalfileusage-text' ), $formContent ) . "\n</form>"; |
68 | | - |
69 | | - $this->getOutput()->addHtml( $html ); |
70 | | - } |
71 | | - |
72 | | - /** |
73 | | - * Creates as queryer and executes it based on the WebRequest object |
74 | | - */ |
75 | | - private function showResult() { |
76 | | - $request = $this->getRequest(); |
77 | | - $query = new GlobalUsageQuery( $this->target ); |
78 | | - |
79 | | - // Extract params from the WebRequest object |
80 | | - if ( $request->getText( 'from' ) ) { |
81 | | - $query->setOffset( $request->getText( 'from' ) ); |
82 | | - } elseif ( $request->getText( 'to' ) ) { |
83 | | - $query->setOffset( $request->getText( 'to' ), true ); |
84 | | - } |
85 | | - $query->setLimit( $request->getInt( 'limit', 50 ) ); |
86 | | - $query->filterLocal( $this->filterLocal ); |
87 | | - |
88 | | - // Perform query |
89 | | - $query->searchFile(); |
90 | | - |
91 | | - // Show result |
92 | | - $out = $this->getOutput(); |
93 | | - |
94 | | - // Don't show form element if there is no data |
95 | | - if ( $query->count() == 0 ) { |
96 | | - $out->addWikiMsg( 'globalfileusage-no-results', $this->target->getPrefixedText() ); |
97 | | - return; |
98 | | - } |
99 | | - |
100 | | - $offset = $query->getOffsetString(); |
101 | | - $navbar = $this->getNavBar( $query ); |
102 | | - $targetName = $this->target->getText(); |
103 | | - |
104 | | - // Top navbar |
105 | | - $out->addHtml( $navbar ); |
106 | | - |
107 | | - $out->addHtml( '<div id="mw-globalfileusage-result">' ); |
108 | | - foreach ( $query->getSingleResult() as $wiki => $result ) { |
109 | | - $out->addHtml( |
110 | | - '<h2>' . wfMsgExt( |
111 | | - 'globalfileusage-on-wiki', 'parseinline', |
112 | | - $targetName, WikiMap::getWikiName( $wiki ) ) |
113 | | - . "</h2><ul>\n" ); |
114 | | - foreach ( $result as $item ) { |
115 | | - $out->addHtml( "\t<li>" . self::formatItem( $item ) . "</li>\n" ); |
116 | | - } |
117 | | - $out->addHtml( "</ul>\n" ); |
118 | | - } |
119 | | - $out->addHtml( '</div>' ); |
120 | | - |
121 | | - // Bottom navbar |
122 | | - $out->addHtml( $navbar ); |
123 | | - } |
124 | | - |
125 | | - /** |
126 | | - * Helper to format a specific item |
127 | | - */ |
128 | | - public static function formatItem( $item ) { |
129 | | - if ( !$item['namespace'] ) { |
130 | | - $page = $item['title']; |
131 | | - } else { |
132 | | - $page = "{$item['namespace']}:{$item['title']}"; |
133 | | - } |
134 | | - |
135 | | - $link = WikiMap::makeForeignLink( $item['wiki'], $page, |
136 | | - str_replace( '_', ' ', $page ) ); |
137 | | - // Return only the title if no link can be constructed |
138 | | - return $link === false ? $page : $link; |
139 | | - } |
140 | | - |
141 | | - /** |
142 | | - * Helper function to create the navbar, stolen from wfViewPrevNext |
143 | | - * |
144 | | - * @param $query GlobalUsageQuery An executed GlobalUsageQuery object |
145 | | - * @return string Navbar HTML |
146 | | - */ |
147 | | - protected function getNavBar( $query ) { |
148 | | - $lang = $this->getLang(); |
149 | | - $target = $this->target->getText(); |
150 | | - $limit = $query->getLimit(); |
151 | | - $fmtLimit = $lang->formatNum( $limit ); |
152 | | - |
153 | | - # Find out which strings are for the prev and which for the next links |
154 | | - $offset = $query->getOffsetString(); |
155 | | - $continue = $query->getContinueFileString(); |
156 | | - if ( $query->isReversed() ) { |
157 | | - $from = $offset; |
158 | | - $to = $continue; |
159 | | - } else { |
160 | | - $from = $continue; |
161 | | - $to = $offset; |
162 | | - } |
163 | | - |
164 | | - # Get prev/next link display text |
165 | | - $prev = wfMsgExt( 'prevn', array( 'parsemag', 'escape' ), $fmtLimit ); |
166 | | - $next = wfMsgExt( 'nextn', array( 'parsemag', 'escape' ), $fmtLimit ); |
167 | | - # Get prev/next link title text |
168 | | - $pTitle = wfMsgExt( 'prevn-title', array( 'parsemag', 'escape' ), $fmtLimit ); |
169 | | - $nTitle = wfMsgExt( 'nextn-title', array( 'parsemag', 'escape' ), $fmtLimit ); |
170 | | - |
171 | | - # Fetch the title object |
172 | | - $title = $this->getTitle(); |
173 | | - |
174 | | - # Make 'previous' link |
175 | | - if ( $to ) { |
176 | | - $attr = array( 'title' => $pTitle, 'class' => 'mw-prevlink' ); |
177 | | - $q = array( 'limit' => $limit, 'to' => $to, 'target' => $target ); |
178 | | - if ( $this->filterLocal ) |
179 | | - $q['filterlocal'] = '1'; |
180 | | - $plink = Linker::link( $title, $prev, $attr, $q ); |
181 | | - } else { |
182 | | - $plink = $prev; |
183 | | - } |
184 | | - |
185 | | - # Make 'next' link |
186 | | - if ( $from ) { |
187 | | - $attr = array( 'title' => $nTitle, 'class' => 'mw-nextlink' ); |
188 | | - $q = array( 'limit' => $limit, 'from' => $from, 'target' => $target ); |
189 | | - if ( $this->filterLocal ) |
190 | | - $q['filterlocal'] = '1'; |
191 | | - $nlink = Linker::link( $title, $next, $attr, $q ); |
192 | | - } else { |
193 | | - $nlink = $next; |
194 | | - } |
195 | | - |
196 | | - # Make links to set number of items per page |
197 | | - $numLinks = array(); |
198 | | - foreach ( array( 20, 50, 100, 250, 500 ) as $num ) { |
199 | | - $fmtLimit = $lang->formatNum( $num ); |
200 | | - |
201 | | - $q = array( 'offset' => $offset, 'limit' => $num, 'target' => $target ); |
202 | | - if ( $this->filterLocal ) |
203 | | - $q['filterlocal'] = '1'; |
204 | | - $lTitle = wfMsgExt( 'shown-title', array( 'parsemag', 'escape' ), $num ); |
205 | | - $attr = array( 'title' => $lTitle, 'class' => 'mw-numlink' ); |
206 | | - |
207 | | - $numLinks[] = Linker::link( $title, $fmtLimit, $attr, $q ); |
208 | | - } |
209 | | - $nums = $lang->pipeList( $numLinks ); |
210 | | - |
211 | | - return wfMsgHtml( 'viewprevnext', $plink, $nlink, $nums ); |
212 | | - } |
213 | | -} |
214 | | - |
Index: trunk/phase3/includes/specials/SpecialSearch.php |
— | — | @@ -34,8 +34,8 @@ |
35 | 35 | * For users tt replaces the set of enabled namespaces from the query |
36 | 36 | * string when applicable. Extensions can add new profiles with hooks |
37 | 37 | * with custom search options just for that profile. |
38 | | - * @var null|string |
39 | | - */ |
| 38 | + * null|string |
| 39 | + */ |
40 | 40 | protected $profile; |
41 | 41 | |
42 | 42 | /// Search engine |
Index: trunk/phase3/includes/cache/HTMLCacheUpdate.php |
— | — | @@ -50,16 +50,7 @@ |
51 | 51 | return; |
52 | 52 | } |
53 | 53 | |
54 | | - if ( $this->mTable === 'globaltemplatelinks' ) { |
55 | | - global $wgEnableInterwikiTemplatesTracking; |
56 | 54 | |
57 | | - if ( $wgEnableInterwikiTemplatesTracking ) { |
58 | | - $distantPageArray = $this->mCache->getDistantTemplateLinks( 'globaltemplatelinks' ); |
59 | | - $this->invalidateDistantTitles( $distantPageArray ); |
60 | | - } |
61 | | - return; |
62 | | - } |
63 | | - |
64 | 55 | # Get an estimate of the number of rows from the BacklinkCache |
65 | 56 | $numRows = $this->mCache->getNumLinks( $this->mTable ); |
66 | 57 | if ( $numRows > $this->mRowsPerJob * 2 ) { |
— | — | @@ -77,7 +68,6 @@ |
78 | 69 | $this->invalidateTitles( $titleArray ); |
79 | 70 | } |
80 | 71 | } |
81 | | - wfRunHooks( 'HTMLCacheUpdate::doUpdate', array($this->mTitle) ); |
82 | 72 | } |
83 | 73 | |
84 | 74 | /** |
— | — | @@ -208,46 +198,10 @@ |
209 | 199 | } |
210 | 200 | } |
211 | 201 | |
212 | | - /** |
213 | | - * Invalidate an array of distant pages, given the wiki ID and page ID of those pages |
214 | | - */ |
215 | | - protected function invalidateDistantTitles( $distantPageArray ) { |
216 | | - global $wgUseSquid; |
217 | | - |
218 | | - $pagesByWiki = array(); |
219 | | - $titleArray = array(); |
220 | | - # Sort by WikiID in $pagesByWiki |
221 | | - # Create the distant titles for Squid in $titleArray |
222 | | - foreach ( $distantPageArray as $row ) { |
223 | | - $wikiid = $row->gtl_from_wiki; |
224 | | - if( !isset( $pagesByWiki[$wikiid] ) ) { |
225 | 202 | $pagesByWiki[$wikiid] = array(); |
226 | 203 | } |
227 | | - $pagesByWiki[$wikiid][] = $row->gtl_from_page; |
228 | | - $titleArray[] = Title::makeTitle( $row->gtl_from_namespace, $row->gtl_from_title, '', $row->gil_interwiki ); |
229 | | - } |
230 | 204 | |
231 | | - foreach ( $pagesByWiki as $wikiid => $pages ) { |
232 | | - $dbw = wfGetDB( DB_MASTER, array( ), $wikiid ); |
233 | | - $timestamp = $dbw->timestamp(); |
234 | | - $batches = array_chunk( $pages, $this->mRowsPerQuery ); |
235 | | - foreach ( $batches as $batch ) { |
236 | | - $dbw->update( 'page', |
237 | | - array( 'page_touched' => $timestamp ), |
238 | | - array( 'page_id IN (' . $dbw->makeList( $batch ) . ')' ), |
239 | | - __METHOD__ |
240 | | - ); |
241 | | - } |
242 | | - } |
243 | 205 | |
244 | | - # Update squid |
245 | | - if ( $wgUseSquid ) { |
246 | | - $u = SquidUpdate::newFromTitles( $titleArray ); |
247 | | - $u->doUpdate(); |
248 | | - } |
249 | | - } |
250 | | -} |
251 | | - |
252 | 206 | /** |
253 | 207 | * Job wrapper for HTMLCacheUpdate. Gets run whenever a related |
254 | 208 | * job gets called from the queue. |
Index: trunk/phase3/includes/SpecialPageFactory.php |
— | — | @@ -126,8 +126,6 @@ |
127 | 127 | // Page tools |
128 | 128 | 'ComparePages' => 'SpecialComparePages', |
129 | 129 | 'Export' => 'SpecialExport', |
130 | | - 'GlobalFileUsage' => 'SpecialGlobalFileUsage', |
131 | | - 'GlobalTemplateUsage' => 'SpecialGlobalTemplateUsage', |
132 | 130 | 'Import' => 'SpecialImport', |
133 | 131 | 'Undelete' => 'SpecialUndelete', |
134 | 132 | 'Whatlinkshere' => 'SpecialWhatlinkshere', |
— | — | @@ -264,7 +262,7 @@ |
265 | 263 | /** |
266 | 264 | * Add a page to a certain display group for Special:SpecialPages |
267 | 265 | * |
268 | | - * @param $page SpecialPage|string |
| 266 | + * @param $page Mixed: SpecialPage or string |
269 | 267 | * @param $group String |
270 | 268 | */ |
271 | 269 | public static function setGroup( $page, $group ) { |
— | — | @@ -277,8 +275,6 @@ |
278 | 276 | * Get the group that the special page belongs in on Special:SpecialPage |
279 | 277 | * |
280 | 278 | * @param $page SpecialPage |
281 | | - * |
282 | | - * @return string |
283 | 279 | */ |
284 | 280 | public static function getGroup( &$page ) { |
285 | 281 | $name = $page->getName(); |
Property changes on: trunk/phase3/includes/SpecialPageFactory.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
286 | 282 | Reverse-merged /branches/iwtransclusion/phase3v2/includes/SpecialPageFactory.php:r87111-87112 |
287 | 283 | Reverse-merged /branches/iwtransclusion/phase3v3/includes/SpecialPageFactory.php:r92983-95395 |
288 | 284 | Reverse-merged /branches/iwtransclusion/phase3/includes/SpecialPageFactory.php:r70966,71049,74205 |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -1376,7 +1376,7 @@ |
1377 | 1377 | * during form output near the top, for captchas and the like. |
1378 | 1378 | */ |
1379 | 1379 | function showEditForm( $formCallback = null ) { |
1380 | | - global $wgOut, $wgUser, $wgEnableInterwikiTranscluding, $wgEnableInterwikiTemplatesTracking; |
| 1380 | + global $wgOut, $wgUser; |
1381 | 1381 | |
1382 | 1382 | wfProfileIn( __METHOD__ ); |
1383 | 1383 | |
— | — | @@ -1410,6 +1410,7 @@ |
1411 | 1411 | $toolbar = ''; |
1412 | 1412 | } |
1413 | 1413 | |
| 1414 | + |
1414 | 1415 | $wgOut->addHTML( $this->editFormPageTop ); |
1415 | 1416 | |
1416 | 1417 | if ( $wgUser->getOption( 'previewontop' ) ) { |
— | — | @@ -1421,9 +1422,6 @@ |
1422 | 1423 | $templates = $this->getTemplates(); |
1423 | 1424 | $formattedtemplates = Linker::formatTemplates( $templates, $this->preview, $this->section != ''); |
1424 | 1425 | |
1425 | | - $distantTemplates = $this->getDistantTemplates(); |
1426 | | - $formattedDistantTemplates = Linker::formatDistantTemplates( $distantTemplates, $this->preview, $this->section != '' ); |
1427 | | - |
1428 | 1426 | $hiddencats = $this->mArticle->getHiddenCategories(); |
1429 | 1427 | $formattedhiddencats = Linker::formatHiddenCategories( $hiddencats ); |
1430 | 1428 | |
— | — | @@ -1522,21 +1520,6 @@ |
1523 | 1521 | <div class='templatesUsed'> |
1524 | 1522 | {$formattedtemplates} |
1525 | 1523 | </div> |
1526 | | -HTML |
1527 | | -); |
1528 | | - |
1529 | | - if ( $wgEnableInterwikiTranscluding && $wgEnableInterwikiTemplatesTracking ) { |
1530 | | - $wgOut->addHTML( <<<HTML |
1531 | | -{$this->editFormTextAfterTools} |
1532 | | -<div class='distantTemplatesUsed'> |
1533 | | -{$formattedDistantTemplates} |
1534 | | -</div> |
1535 | | -HTML |
1536 | | -); |
1537 | | - } |
1538 | | - |
1539 | | - $wgOut->addHTML( <<<HTML |
1540 | | -{$this->editFormTextAfterTools} |
1541 | 1524 | <div class='hiddencats'> |
1542 | 1525 | {$formattedhiddencats} |
1543 | 1526 | </div> |
— | — | @@ -2198,28 +2181,6 @@ |
2199 | 2182 | } |
2200 | 2183 | } |
2201 | 2184 | |
2202 | | - function getDistantTemplates() { |
2203 | | - global $wgEnableInterwikiTemplatesTracking; |
2204 | | - if ( !$wgEnableInterwikiTemplatesTracking ) { |
2205 | | - return array( ); |
2206 | | - } |
2207 | | - if ( $this->preview || $this->section != '' ) { |
2208 | | - $templates = array(); |
2209 | | - if ( !isset( $this->mParserOutput ) ) return $templates; |
2210 | | - $templatesList = $this->mParserOutput->getDistantTemplates(); |
2211 | | - foreach( $templatesList as $prefix => $templatesbyns ) { |
2212 | | - foreach( $templatesbyns as $ns => $template ) { |
2213 | | - foreach( array_keys( $template ) as $dbk ) { |
2214 | | - $templates[] = Title::makeTitle( $ns, $dbk, null, $prefix ); |
2215 | | - } |
2216 | | - } |
2217 | | - } |
2218 | | - return $templates; |
2219 | | - } else { |
2220 | | - return $this->mArticle->getUsedDistantTemplates(); |
2221 | | - } |
2222 | | - } |
2223 | | - |
2224 | 2185 | /** |
2225 | 2186 | * Call the stock "user is blocked" page |
2226 | 2187 | */ |
Index: trunk/phase3/includes/LinksUpdate.php |
— | — | @@ -29,7 +29,6 @@ |
30 | 30 | $mLinks, //!< Map of title strings to IDs for the links in the document |
31 | 31 | $mImages, //!< DB keys of the images used, in the array key only |
32 | 32 | $mTemplates, //!< Map of title strings to IDs for the template references, including broken ones |
33 | | - $mDistantTemplates,//!< Map of title strings to IDs for the distant template references, including broken ones |
34 | 33 | $mExternals, //!< URLs of external links, array key only |
35 | 34 | $mCategories, //!< Map of category names to sort keys |
36 | 35 | $mInterlangs, //!< Map of language codes to titles |
— | — | @@ -67,7 +66,6 @@ |
68 | 67 | $this->mLinks = $parserOutput->getLinks(); |
69 | 68 | $this->mImages = $parserOutput->getImages(); |
70 | 69 | $this->mTemplates = $parserOutput->getTemplates(); |
71 | | - $this->mDistantTemplates = $parserOutput->getDistantTemplates(); |
72 | 70 | $this->mExternals = $parserOutput->getExternalLinks(); |
73 | 71 | $this->mCategories = $parserOutput->getCategories(); |
74 | 72 | $this->mProperties = $parserOutput->getProperties(); |
— | — | @@ -154,15 +152,6 @@ |
155 | 153 | $this->incrTableUpdate( 'templatelinks', 'tl', $this->getTemplateDeletions( $existing ), |
156 | 154 | $this->getTemplateInsertions( $existing ) ); |
157 | 155 | |
158 | | - # Distant template links |
159 | | - global $wgGlobalDatabase; |
160 | | - if ( $wgGlobalDatabase ) { |
161 | | - $existing = $this->getDistantExistingTemplates(); |
162 | | - $this->incrSharedTableUpdate( 'globaltemplatelinks', 'gtl', |
163 | | - $this->getDistantTemplateDeletions( $existing ), |
164 | | - $this->getDistantTemplateInsertions( $existing ) ); |
165 | | - } |
166 | | - |
167 | 156 | # Category links |
168 | 157 | $existing = $this->getExistingCategories(); |
169 | 158 | |
— | — | @@ -378,54 +367,12 @@ |
379 | 368 | if ( $where ) { |
380 | 369 | $this->mDb->delete( $table, $where, __METHOD__ ); |
381 | 370 | } |
382 | | - if ( isset( $insertions['globaltemplatelinks'] ) ) { |
383 | | - $this->mDb->insert( 'globaltemplatelinks', $insertions['globaltemplatelinks'], __METHOD__, 'IGNORE' ); |
384 | | - unset( $insertions['globaltemplatelinks'] ); |
385 | | - } |
386 | | - if ( isset( $insertions['globalnamespaces'] ) ) { |
387 | | - $this->mDb->insert( 'globalnamespaces', $insertions['globalnamespaces'], __METHOD__, 'IGNORE' ); |
388 | | - unset( $insertions['globalnamespaces'] ); |
389 | | - } |
390 | | - if ( isset( $insertions['globalinterwiki'] ) ) { |
391 | | - $this->mDb->insert( 'globalinterwiki', $insertions['globalinterwiki'], __METHOD__, 'IGNORE' ); |
392 | | - unset( $insertions['globalinterwiki'] ); |
393 | | - } |
394 | 371 | if ( count( $insertions ) ) { |
395 | 372 | $this->mDb->insert( $table, $insertions, __METHOD__, 'IGNORE' ); |
396 | 373 | } |
397 | 374 | } |
398 | 375 | |
399 | | - /** |
400 | | - * Update a shared table by doing a delete query then an insert query |
401 | | - * @private |
402 | | - */ |
403 | | - function incrSharedTableUpdate( $table, $prefix, $deletions, $insertions ) { |
404 | | - global $wgGlobalDatabase; |
405 | 376 | |
406 | | - if ( $wgGlobalDatabase ) { |
407 | | - $dbw = wfGetDB( DB_MASTER, array(), $wgGlobalDatabase ); |
408 | | - $where = array( "{$prefix}_from_wiki" => wfWikiID(), |
409 | | - "{$prefix}_from_page" => $this->mId |
410 | | - ); |
411 | | - $baseKey = "{$prefix}_to_wiki"; |
412 | | - $middleKey = "{$prefix}_to_namespace"; |
413 | | - |
414 | | - $clause = $dbw->makeWhereFrom3d( $deletions, $baseKey, $middleKey, "{$prefix}_to_title" ); |
415 | | - if ( $clause ) { |
416 | | - $where[] = $clause; |
417 | | - } else { |
418 | | - $where = false; |
419 | | - } |
420 | | - |
421 | | - if ( $where ) { |
422 | | - $dbw->delete( $table, $where, __METHOD__ ); |
423 | | - } |
424 | | - if ( count( $insertions ) ) { |
425 | | - $dbw->insert( $table, $insertions, __METHOD__, 'IGNORE' ); |
426 | | - } |
427 | | - } |
428 | | - } |
429 | | - |
430 | 377 | /** |
431 | 378 | * Get an array of pagelinks insertions for passing to the DB |
432 | 379 | * Skips the titles specified by the 2-D array $existing |
— | — | @@ -468,44 +415,6 @@ |
469 | 416 | } |
470 | 417 | |
471 | 418 | /** |
472 | | - * Get an array of distant template insertions. Like getLinkInsertions() |
473 | | - * @private |
474 | | - */ |
475 | | - function getDistantTemplateInsertions( $existing = array() ) { |
476 | | - $arr = array(); |
477 | | - foreach( $this->mDistantTemplates as $prefix => $templatesToNS ) { |
478 | | - foreach( $templatesToNS as $ns => $dbkeys ) { |
479 | | - $diffs = isset( $existing[$prefix] ) && isset( $existing[$prefix][$ns] ) |
480 | | - ? array_diff_key( $dbkeys, $existing[$prefix][$ns] ) |
481 | | - : $dbkeys; |
482 | | - $interwiki = Interwiki::fetch( $prefix ); |
483 | | - $wikiid = $interwiki->getWikiID(); |
484 | | - foreach ( $diffs as $dbk => $id ) { |
485 | | - $arr['globaltemplatelinks'][] = array( |
486 | | - 'gtl_from_wiki' => wfWikiID(), |
487 | | - 'gtl_from_page' => $this->mId, |
488 | | - 'gtl_from_namespace' => $this->mTitle->getNamespace(), |
489 | | - 'gtl_from_title' => $this->mTitle->getText(), |
490 | | - 'gtl_to_wiki' => $wikiid, |
491 | | - 'gtl_to_namespace' => $ns, |
492 | | - 'gtl_to_title' => $dbk |
493 | | - ); |
494 | | - $arr['globalinterwiki'][] = array( |
495 | | - 'giw_wikiid' => $wikiid, |
496 | | - 'giw_prefix' => $prefix, |
497 | | - ); |
498 | | - $arr['globalnamespaces'][] = array( |
499 | | - 'gn_wiki' => wfWikiID( ), |
500 | | - 'gn_namespace' => $this->mTitle->getNamespace(), |
501 | | - 'gn_namespacetext' => $this->mTitle->getNsText(), |
502 | | - ); |
503 | | - } |
504 | | - } |
505 | | - } |
506 | | - return $arr; |
507 | | - } |
508 | | - |
509 | | - /** |
510 | 419 | * Get an array of image insertions |
511 | 420 | * Skips the names specified in $existing |
512 | 421 | * @private |
— | — | @@ -672,30 +581,6 @@ |
673 | 582 | } |
674 | 583 | |
675 | 584 | /** |
676 | | - * Given an array of existing templates, returns those templates which are not in $this |
677 | | - * and thus should be deleted. |
678 | | - * @private |
679 | | - */ |
680 | | - function getDistantTemplateDeletions( $existing ) { |
681 | | - $del = array(); |
682 | | - foreach ( $existing as $wikiid => $templatesForNS ) { |
683 | | - if ( isset( $this->mDistantTemplates[$wikiid] ) ) { |
684 | | - $del[$wikiid] = array_diff_key( $existing[$wikiid], $this->mDistantTemplates[$wikiid] ); |
685 | | - } else { |
686 | | - $del[$wikiid] = $existing[$wikiid]; |
687 | | - } |
688 | | - foreach ( $templatesForNS as $ns => $dbkeys ) { |
689 | | - if ( isset( $this->mDistantTemplates[$wikiid][$ns] ) ) { |
690 | | - $del[$wikiid][$ns] = array_diff_key( $existing[$wikiid][$ns], $this->mDistantTemplates[$wikiid][$ns] ); |
691 | | - } else { |
692 | | - $del[$wikiid][$ns] = $existing[$wikiid][$ns]; |
693 | | - } |
694 | | - } |
695 | | - } |
696 | | - return $del; |
697 | | - } |
698 | | - |
699 | | - /** |
700 | 585 | * Given an array of existing images, returns those images which are not in $this |
701 | 586 | * and thus should be deleted. |
702 | 587 | * @private |
— | — | @@ -791,36 +676,6 @@ |
792 | 677 | } |
793 | 678 | |
794 | 679 | /** |
795 | | - * Get an array of existing distant templates, as a 3-D array |
796 | | - * @private |
797 | | - */ |
798 | | - function getDistantExistingTemplates() { |
799 | | - global $wgGlobalDatabase; |
800 | | - |
801 | | - $arr = array(); |
802 | | - if ( $wgGlobalDatabase ) { |
803 | | - $dbr = wfGetDB( DB_SLAVE, array(), $wgGlobalDatabase ); |
804 | | - $res = $dbr->select( |
805 | | - 'globaltemplatelinks', |
806 | | - array( 'gtl_to_wiki', 'gtl_to_namespace', 'gtl_to_title' ), |
807 | | - array( 'gtl_from_wiki' => wfWikiID(), 'gtl_from_page' => $this->mId ), |
808 | | - __METHOD__, |
809 | | - $this->mOptions |
810 | | - ); |
811 | | - foreach ( $res as $row ) { |
812 | | - if ( !isset( $arr[$row->gtl_to_wiki] ) ) { |
813 | | - $arr[$row->gtl_to_wiki] = array(); |
814 | | - } |
815 | | - if ( !isset( $arr[$row->gtl_to_wiki][$row->gtl_to_namespace] ) ) { |
816 | | - $arr[$row->gtl_to_wiki][$row->gtl_to_namespace] = array(); |
817 | | - } |
818 | | - $arr[$row->gtl_to_wiki][$row->gtl_to_namespace][$row->gtl_to_title] = 1; |
819 | | - } |
820 | | - } |
821 | | - return $arr; |
822 | | - } |
823 | | - |
824 | | - /** |
825 | 680 | * Get an array of existing images, image names in the keys |
826 | 681 | * @private |
827 | 682 | */ |
Index: trunk/phase3/includes/parser/Preprocessor_Hash.php |
— | — | @@ -976,7 +976,6 @@ |
977 | 977 | if ( $flags & PPFrame::NO_TEMPLATES ) { |
978 | 978 | $newIterator = $this->virtualBracketedImplode( '{{', '|', '}}', $bits['title'], $bits['parts'] ); |
979 | 979 | } else { |
980 | | - $bits['interwiki'] = $this->title->getInterwiki( ); |
981 | 980 | $ret = $this->parser->braceSubstitution( $bits, $this ); |
982 | 981 | if ( isset( $ret['object'] ) ) { |
983 | 982 | $newIterator = $ret['object']; |
Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -3022,7 +3022,7 @@ |
3023 | 3023 | * @private |
3024 | 3024 | */ |
3025 | 3025 | function braceSubstitution( $piece, $frame ) { |
3026 | | - global $wgNonincludableNamespaces, $wgEnableInterwikiTranscluding, $wgEnableInterwikiTemplatesTracking; |
| 3026 | + global $wgContLang, $wgNonincludableNamespaces; |
3027 | 3027 | wfProfileIn( __METHOD__ ); |
3028 | 3028 | wfProfileIn( __METHOD__.'-setup' ); |
3029 | 3029 | |
— | — | @@ -3030,6 +3030,7 @@ |
3031 | 3031 | $found = false; # $text has been filled |
3032 | 3032 | $nowiki = false; # wiki markup in $text should be escaped |
3033 | 3033 | $isHTML = false; # $text is HTML, armour it against wikitext transformation |
| 3034 | + $forceRawInterwiki = false; # Force interwiki transclusion to be done in raw mode not rendered |
3034 | 3035 | $isChildObj = false; # $text is a DOM node needing expansion in a child frame |
3035 | 3036 | $isLocalObj = false; # $text is a DOM node needing expansion in the current frame |
3036 | 3037 | |
— | — | @@ -3194,9 +3195,6 @@ |
3195 | 3196 | } |
3196 | 3197 | $title = Title::newFromText( $part1, $ns ); |
3197 | 3198 | if ( $title ) { |
3198 | | - if ( !$title->isExternal() && $piece['interwiki'] !== '' ) { |
3199 | | - $title->setInterwiki( $piece['interwiki'] ); |
3200 | | - } |
3201 | 3199 | $titleText = $title->getPrefixedText(); |
3202 | 3200 | # Check for language variants if the template is not found |
3203 | 3201 | if ( $this->getFunctionLang()->hasVariants() && $title->getArticleID() == 0 ) { |
— | — | @@ -3264,22 +3262,18 @@ |
3265 | 3263 | $text = "[[:$titleText]]"; |
3266 | 3264 | $found = true; |
3267 | 3265 | } |
3268 | | - } elseif ( $wgEnableInterwikiTranscluding && $title->isTrans() ) { |
3269 | | - |
3270 | | - $text = Interwiki::interwikiTransclude( $title ); |
3271 | | - $this->registerDistantTemplate( $title ); |
3272 | | - |
3273 | | - if ( $wgEnableInterwikiTemplatesTracking ) { |
3274 | | - $this->registerDistantTemplate( $title ); |
3275 | | - } |
3276 | | - |
3277 | | - if ( $text !== false ) { |
| 3266 | + } elseif ( $title->isTrans() ) { |
| 3267 | + # Interwiki transclusion |
| 3268 | + if ( $this->ot['html'] && !$forceRawInterwiki ) { |
| 3269 | + $text = $this->interwikiTransclude( $title, 'render' ); |
| 3270 | + $isHTML = true; |
| 3271 | + } else { |
| 3272 | + $text = $this->interwikiTransclude( $title, 'raw' ); |
3278 | 3273 | # Preprocess it like a template |
3279 | 3274 | $text = $this->preprocessToDom( $text, self::PTD_FOR_INCLUSION ); |
3280 | | - $found = true; |
3281 | 3275 | $isChildObj = true; |
3282 | 3276 | } |
3283 | | - |
| 3277 | + $found = true; |
3284 | 3278 | } |
3285 | 3279 | |
3286 | 3280 | # Do infinite loop check |
— | — | @@ -3429,19 +3423,10 @@ |
3430 | 3424 | } |
3431 | 3425 | |
3432 | 3426 | /** |
3433 | | - * Register a distant template as used |
| 3427 | + * Fetch the unparsed text of a template and register a reference to it. |
| 3428 | + * @param Title $title |
| 3429 | + * @return mixed string or false |
3434 | 3430 | */ |
3435 | | - function registerDistantTemplate( $title ) { |
3436 | | - $stuff = Parser::distantTemplateCallback( $title, $this ); |
3437 | | - $text = $stuff['text']; |
3438 | | - $finalTitle = isset( $stuff['finalTitle'] ) ? $stuff['finalTitle'] : $title; |
3439 | | - if ( isset( $stuff['deps'] ) ) { |
3440 | | - foreach ( $stuff['deps'] as $dep ) { |
3441 | | - $this->mOutput->addDistantTemplate( $dep['title'], $dep['page_id'], $dep['rev_id'] ); |
3442 | | - } |
3443 | | - } |
3444 | | - } |
3445 | | - |
3446 | 3431 | function fetchTemplate( $title ) { |
3447 | 3432 | $rv = $this->fetchTemplateAndTitle( $title ); |
3448 | 3433 | return $rv[0]; |
— | — | @@ -3570,23 +3555,58 @@ |
3571 | 3556 | return array( $file, $title ); |
3572 | 3557 | } |
3573 | 3558 | |
3574 | | - static function distantTemplateCallback( $title, $parser=false ) { |
3575 | | - $text = ''; |
3576 | | - $rev_id = null; |
3577 | | - $deps[] = array( |
3578 | | - 'title' => $title, |
3579 | | - 'page_id' => $title->getArticleID(), |
3580 | | - 'rev_id' => $rev_id ); |
| 3559 | + /** |
| 3560 | + * Transclude an interwiki link. |
| 3561 | + * |
| 3562 | + * @param $title Title |
| 3563 | + * @param $action |
| 3564 | + * |
| 3565 | + * @return string |
| 3566 | + */ |
| 3567 | + function interwikiTransclude( $title, $action ) { |
| 3568 | + global $wgEnableScaryTranscluding; |
3581 | 3569 | |
3582 | | - $finalTitle = $title; |
| 3570 | + if ( !$wgEnableScaryTranscluding ) { |
| 3571 | + return wfMsgForContent('scarytranscludedisabled'); |
| 3572 | + } |
3583 | 3573 | |
3584 | | - return array( |
3585 | | - 'text' => $text, |
3586 | | - 'finalTitle' => $finalTitle, |
3587 | | - 'deps' => $deps ); |
| 3574 | + $url = $title->getFullUrl( "action=$action" ); |
| 3575 | + |
| 3576 | + if ( strlen( $url ) > 255 ) { |
| 3577 | + return wfMsgForContent( 'scarytranscludetoolong' ); |
3588 | 3578 | } |
| 3579 | + return $this->fetchScaryTemplateMaybeFromCache( $url ); |
| 3580 | + } |
3589 | 3581 | |
3590 | 3582 | /** |
| 3583 | + * @param $url string |
| 3584 | + * @return Mixed|String |
| 3585 | + */ |
| 3586 | + function fetchScaryTemplateMaybeFromCache( $url ) { |
| 3587 | + global $wgTranscludeCacheExpiry; |
| 3588 | + $dbr = wfGetDB( DB_SLAVE ); |
| 3589 | + $tsCond = $dbr->timestamp( time() - $wgTranscludeCacheExpiry ); |
| 3590 | + $obj = $dbr->selectRow( 'transcache', array('tc_time', 'tc_contents' ), |
| 3591 | + array( 'tc_url' => $url, "tc_time >= " . $dbr->addQuotes( $tsCond ) ) ); |
| 3592 | + if ( $obj ) { |
| 3593 | + return $obj->tc_contents; |
| 3594 | + } |
| 3595 | + |
| 3596 | + $text = Http::get( $url ); |
| 3597 | + if ( !$text ) { |
| 3598 | + return wfMsgForContent( 'scarytranscludefailed', $url ); |
| 3599 | + } |
| 3600 | + |
| 3601 | + $dbw = wfGetDB( DB_MASTER ); |
| 3602 | + $dbw->replace( 'transcache', array('tc_url'), array( |
| 3603 | + 'tc_url' => $url, |
| 3604 | + 'tc_time' => $dbw->timestamp( time() ), |
| 3605 | + 'tc_contents' => $text) |
| 3606 | + ); |
| 3607 | + return $text; |
| 3608 | + } |
| 3609 | + |
| 3610 | + /** |
3591 | 3611 | * Triple brace replacement -- used for template arguments |
3592 | 3612 | * @private |
3593 | 3613 | * |
Index: trunk/phase3/includes/parser/ParserOutput.php |
— | — | @@ -121,8 +121,6 @@ |
122 | 122 | $mLinks = array(), # 2-D map of NS/DBK to ID for the links in the document. ID=zero for broken. |
123 | 123 | $mTemplates = array(), # 2-D map of NS/DBK to ID for the template references. ID=zero for broken. |
124 | 124 | $mTemplateIds = array(), # 2-D map of NS/DBK to rev ID for the template references. ID=zero for broken. |
125 | | - $mDistantTemplates = array(), # 3-D map of WIKIID/NS/DBK to ID for the template references. ID=zero for broken. |
126 | | - $mDistantTemplateIds = array(), # 3-D map of WIKIID/NS/DBK to rev ID for the template references. ID=zero for broken. |
127 | 125 | $mImages = array(), # DB keys of the images used, in the array key only |
128 | 126 | $mFileSearchOptions = array(), # DB keys of the images used mapped to sha1 and MW timestamp |
129 | 127 | $mExternalLinks = array(), # External link URLs, in the key only |
— | — | @@ -193,8 +191,6 @@ |
194 | 192 | function getEditSectionTokens() { return $this->mEditSectionTokens; } |
195 | 193 | function &getLinks() { return $this->mLinks; } |
196 | 194 | function &getTemplates() { return $this->mTemplates; } |
197 | | - function &getDistantTemplates() { return $this->mDistantTemplates; } |
198 | | - function &getDistantTemplateIds() { return $this->mDistantTemplateIds; } |
199 | 195 | function &getTemplateIds() { return $this->mTemplateIds; } |
200 | 196 | function &getImages() { return $this->mImages; } |
201 | 197 | function &getFileSearchOptions() { return $this->mFileSearchOptions; } |
— | — | @@ -316,31 +312,6 @@ |
317 | 313 | $this->mTemplateIds[$ns][$dbk] = $rev_id; // For versioning |
318 | 314 | } |
319 | 315 | |
320 | | - function addDistantTemplate( $title, $page_id, $rev_id ) { |
321 | | - $prefix = $title->getInterwiki(); |
322 | | - if ( $prefix !=='' ) { |
323 | | - $ns = $title->getNamespace(); |
324 | | - $dbk = $title->getDBkey(); |
325 | | - |
326 | | - if ( !isset( $this->mDistantTemplates[$prefix] ) ) { |
327 | | - $this->mDistantTemplates[$prefix] = array(); |
328 | | - } |
329 | | - if ( !isset( $this->mDistantTemplates[$prefix][$ns] ) ) { |
330 | | - $this->mDistantTemplates[$prefix][$ns] = array(); |
331 | | - } |
332 | | - $this->mDistantTemplates[$prefix][$ns][$dbk] = $page_id; |
333 | | - |
334 | | - // For versioning |
335 | | - if ( !isset( $this->mDistantTemplateIds[$prefix] ) ) { |
336 | | - $this->mDistantTemplateIds[$prefix] = array(); |
337 | | - } |
338 | | - if ( !isset( $this->mDistantTemplateIds[$prefix][$ns] ) ) { |
339 | | - $this->mDistantTemplateIds[$prefix][$ns] = array(); |
340 | | - } |
341 | | - $this->mDistantTemplateIds[$prefix][$ns][$dbk] = $rev_id; |
342 | | - } |
343 | | - } |
344 | | - |
345 | 316 | /** |
346 | 317 | * @param $title Title object, must be an interwiki link |
347 | 318 | * @throws MWException if given invalid input |
Index: trunk/phase3/includes/parser/Preprocessor_DOM.php |
— | — | @@ -1039,8 +1039,7 @@ |
1040 | 1040 | $params = array( |
1041 | 1041 | 'title' => new PPNode_DOM( $title ), |
1042 | 1042 | 'parts' => new PPNode_DOM( $parts ), |
1043 | | - 'lineStart' => $lineStart, |
1044 | | - 'interwiki' => $this->title->getInterwiki( ) ); |
| 1043 | + 'lineStart' => $lineStart ); |
1045 | 1044 | $ret = $this->parser->braceSubstitution( $params, $this ); |
1046 | 1045 | if ( isset( $ret['object'] ) ) { |
1047 | 1046 | $newIterator = $ret['object']; |
Index: trunk/phase3/includes/Revision.php |
— | — | @@ -110,7 +110,8 @@ |
111 | 111 | 'minor_edit' => $row->ar_minor_edit, |
112 | 112 | 'text_id' => isset( $row->ar_text_id ) ? $row->ar_text_id : null, |
113 | 113 | 'deleted' => $row->ar_deleted, |
114 | | - 'len' => $row->ar_len); |
| 114 | + 'len' => $row->ar_len |
| 115 | + ); |
115 | 116 | if ( isset( $row->ar_text ) && !$row->ar_text_id ) { |
116 | 117 | // Pre-1.5 ar_text row |
117 | 118 | $attribs['text'] = self::getRevisionText( $row, 'ar_' ); |
— | — | @@ -166,30 +167,6 @@ |
167 | 168 | } |
168 | 169 | |
169 | 170 | /** |
170 | | - * Stores the origin wiki of a revision in case it is a foreign wiki |
171 | | - */ |
172 | | - function setWikiID( $wikiID ) { |
173 | | - $this->mWikiID = $wikiID; |
174 | | - } |
175 | | - |
176 | | - /** |
177 | | - * Load the current revision of a given page of a foreign wiki. |
178 | | - * The WikiID is stored for further use, such as loadText() and getTimestampFromId() |
179 | | - */ |
180 | | - public static function loadFromTitleForeignWiki( $wikiID, $title ) { |
181 | | - $dbr = wfGetDB( DB_SLAVE, array(), $wikiID ); |
182 | | - |
183 | | - $revision = self::loadFromTitle( $dbr, $title ); |
184 | | - |
185 | | - if( $revision ) { |
186 | | - $revision->setWikiID( $wikiID ); |
187 | | - } |
188 | | - |
189 | | - return $revision; |
190 | | - |
191 | | - } |
192 | | - |
193 | | - /** |
194 | 171 | * Load either the current, or a specified, revision |
195 | 172 | * that's attached to a given page. If not attached |
196 | 173 | * to that page, will return null. |
— | — | @@ -426,7 +403,6 @@ |
427 | 404 | throw new MWException( 'Revision constructor passed invalid row format.' ); |
428 | 405 | } |
429 | 406 | $this->mUnpatrolled = null; |
430 | | - $this->mWikiID = false; |
431 | 407 | } |
432 | 408 | |
433 | 409 | /** |
— | — | @@ -474,8 +450,7 @@ |
475 | 451 | if( isset( $this->mTitle ) ) { |
476 | 452 | return $this->mTitle; |
477 | 453 | } |
478 | | - $dbr = wfGetDB( DB_SLAVE, array(), $this->mWikiID ); |
479 | | - |
| 454 | + $dbr = wfGetDB( DB_SLAVE ); |
480 | 455 | $row = $dbr->selectRow( |
481 | 456 | array( 'page', 'revision' ), |
482 | 457 | array( 'page_namespace', 'page_title' ), |
— | — | @@ -614,7 +589,7 @@ |
615 | 590 | if( $this->mUnpatrolled !== null ) { |
616 | 591 | return $this->mUnpatrolled; |
617 | 592 | } |
618 | | - $dbr = wfGetDB( DB_SLAVE, array(), $this->mWikiID ); |
| 593 | + $dbr = wfGetDB( DB_SLAVE ); |
619 | 594 | $this->mUnpatrolled = $dbr->selectField( 'recentchanges', |
620 | 595 | 'rc_id', |
621 | 596 | array( // Add redundant user,timestamp condition so we can use the existing index |
— | — | @@ -950,11 +925,7 @@ |
951 | 926 | // Caching may be beneficial for massive use of external storage |
952 | 927 | global $wgRevisionCacheExpiry, $wgMemc; |
953 | 928 | $textId = $this->getTextId(); |
954 | | - if( isset( $this->mWikiID ) && $this->mWikiID !== false ) { |
955 | | - $key = wfForeignMemcKey( $this->mWikiID, null, 'revisiontext', 'textid', $textId ); |
956 | | - } else { |
957 | 929 | $key = wfMemcKey( 'revisiontext', 'textid', $textId ); |
958 | | - } |
959 | 930 | if( $wgRevisionCacheExpiry ) { |
960 | 931 | $text = $wgMemc->get( $key ); |
961 | 932 | if( is_string( $text ) ) { |
— | — | @@ -974,7 +945,7 @@ |
975 | 946 | |
976 | 947 | if( !$row ) { |
977 | 948 | // Text data is immutable; check slaves first. |
978 | | - $dbr = wfGetDB( DB_SLAVE, array(), $this->mWikiID ); |
| 949 | + $dbr = wfGetDB( DB_SLAVE ); |
979 | 950 | $row = $dbr->selectRow( 'text', |
980 | 951 | array( 'old_text', 'old_flags' ), |
981 | 952 | array( 'old_id' => $this->getTextId() ), |
— | — | @@ -983,7 +954,7 @@ |
984 | 955 | |
985 | 956 | if( !$row && wfGetLB()->getServerCount() > 1 ) { |
986 | 957 | // Possible slave lag! |
987 | | - $dbw = wfGetDB( DB_MASTER, array(), $this->mWikiID ); |
| 958 | + $dbw = wfGetDB( DB_MASTER ); |
988 | 959 | $row = $dbw->selectRow( 'text', |
989 | 960 | array( 'old_text', 'old_flags' ), |
990 | 961 | array( 'old_id' => $this->getTextId() ), |
— | — | @@ -1094,8 +1065,7 @@ |
1095 | 1066 | * @return String |
1096 | 1067 | */ |
1097 | 1068 | static function getTimestampFromId( $title, $id ) { |
1098 | | - $wikiId = wfWikiID(); |
1099 | | - $dbr = wfGetDB( DB_SLAVE, array(), $wikiId ); |
| 1069 | + $dbr = wfGetDB( DB_SLAVE ); |
1100 | 1070 | // Casting fix for DB2 |
1101 | 1071 | if ( $id == '' ) { |
1102 | 1072 | $id = 0; |
— | — | @@ -1105,7 +1075,7 @@ |
1106 | 1076 | $timestamp = $dbr->selectField( 'revision', 'rev_timestamp', $conds, __METHOD__ ); |
1107 | 1077 | if ( $timestamp === false && wfGetLB()->getServerCount() > 1 ) { |
1108 | 1078 | # Not in slave, try master |
1109 | | - $dbw = wfGetDB( DB_MASTER, array(), $wikiId ); |
| 1079 | + $dbw = wfGetDB( DB_MASTER ); |
1110 | 1080 | $timestamp = $dbw->selectField( 'revision', 'rev_timestamp', $conds, __METHOD__ ); |
1111 | 1081 | } |
1112 | 1082 | return wfTimestamp( TS_MW, $timestamp ); |
Property changes on: trunk/phase3/includes/Revision.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1113 | 1083 | Reverse-merged /branches/iwtransclusion/phase3/includes/Revision.php:r69730,69745-69746,69781,69783,69853,69948,70411,70575 |
1114 | 1084 | Reverse-merged /branches/iwtransclusion/phase3v2/includes/Revision.php:r87105-87107 |
1115 | 1085 | Reverse-merged /branches/iwtransclusion/phase3v3/includes/Revision.php:r92983-95395 |
Index: trunk/phase3/includes/installer/SqliteUpdater.php |
— | — | @@ -63,8 +63,6 @@ |
64 | 64 | // 1.19 |
65 | 65 | array( 'addTable', 'config', 'patch-config.sql' ), |
66 | 66 | array( 'addIndex', 'logging', 'type_action', 'patch-logging-type-action-index.sql'), |
67 | | - array( 'addTable', 'globaltemplatelinks', 'patch-globaltemplatelinks.sql' ), |
68 | | - array( 'addTable', 'globalnamespaces', 'patch-globalnamespaces.sql' ), |
69 | 67 | array( 'addTable', 'globalinterwiki', 'patch-globalinterwiki.sql' ), |
70 | 68 | array( 'doMigrateUserOptions' ), |
71 | 69 | ); |
Index: trunk/phase3/includes/installer/MysqlUpdater.php |
— | — | @@ -185,9 +185,6 @@ |
186 | 186 | // 1.19 |
187 | 187 | array( 'addTable', 'config', 'patch-config.sql' ), |
188 | 188 | array( 'addIndex', 'logging', 'type_action', 'patch-logging-type-action-index.sql'), |
189 | | - array( 'addTable', 'globaltemplatelinks', 'patch-globaltemplatelinks.sql' ), |
190 | | - array( 'addTable', 'globalnamespaces', 'patch-globalnamespaces.sql' ), |
191 | | - array( 'addTable', 'globalinterwiki', 'patch-globalinterwiki.sql' ), |
192 | 189 | array( 'doMigrateUserOptions' ), |
193 | 190 | array( 'dropField', 'user', 'user_options', 'patch-drop-user_options.sql' ), |
194 | 191 | |
Index: trunk/phase3/includes/interwiki/Interwiki.php |
— | — | @@ -9,7 +9,6 @@ |
10 | 10 | * All information is loaded on creation when called by Interwiki::fetch( $prefix ). |
11 | 11 | * All work is done on slave, because this should *never* change (except during |
12 | 12 | * schema updates etc, which aren't wiki-related) |
13 | | - * This class also contains the functions that allow interwiki templates transclusion. |
14 | 13 | */ |
15 | 14 | class Interwiki { |
16 | 15 | |
— | — | @@ -172,7 +171,6 @@ |
173 | 172 | $mc = array( |
174 | 173 | 'iw_url' => $iw->mURL, |
175 | 174 | 'iw_api' => $iw->mAPI, |
176 | | - 'iw_wikiid' => $iw->mWikiID, |
177 | 175 | 'iw_local' => $iw->mLocal, |
178 | 176 | 'iw_trans' => $iw->mTrans |
179 | 177 | ); |
— | — | @@ -197,7 +195,6 @@ |
198 | 196 | $iw->mURL = $mc['iw_url']; |
199 | 197 | $iw->mLocal = isset( $mc['iw_local'] ) ? $mc['iw_local'] : 0; |
200 | 198 | $iw->mTrans = isset( $mc['iw_trans'] ) ? $mc['iw_trans'] : 0; |
201 | | - $iw->mAPI = isset( $mc['iw_api'] ) ? $mc['iw_api'] : |
202 | 199 | $iw->mAPI = isset( $mc['iw_api'] ) ? $mc['iw_api'] : ''; |
203 | 200 | $iw->mWikiID = isset( $mc['iw_wikiid'] ) ? $mc['iw_wikiid'] : ''; |
204 | 201 | |
— | — | @@ -392,166 +389,4 @@ |
393 | 390 | $msg = wfMessage( 'interwiki-desc-' . $this->mPrefix )->inContentLanguage(); |
394 | 391 | return !$msg->exists() ? '' : $msg; |
395 | 392 | } |
396 | | - |
397 | | - |
398 | | - /** |
399 | | - * Transclude an interwiki link. |
400 | | - */ |
401 | | - public static function interwikiTransclude( $title ) { |
402 | | - |
403 | | - // If we have a wikiID, we will use it to get an access to the remote database |
404 | | - // if not, we will use the API URL to retrieve the data through a HTTP Get |
405 | | - |
406 | | - $wikiID = $title->getTransWikiID( ); |
407 | | - $transAPI = $title->getTransAPI( ); |
408 | | - |
409 | | - if ( $wikiID !== '') { |
410 | | - |
411 | | - $finalText = self::fetchTemplateFromDB( $wikiID, $title ); |
412 | | - return $finalText; |
413 | | - |
414 | | - } else if( $transAPI !== '' ) { |
415 | | - |
416 | | - $interwiki = $title->getInterwiki( ); |
417 | | - $fullTitle = $title->getSemiPrefixedText( ); |
418 | | - |
419 | | - $finalText = self::fetchTemplateFromAPI( $interwiki, $transAPI, $fullTitle ); |
420 | | - |
421 | | - return $finalText; |
422 | | - |
423 | 393 | } |
424 | | - return false; |
425 | | - } |
426 | | - |
427 | | - /** |
428 | | - * Retrieve the wikitext of a distant page accessing the foreign DB |
429 | | - */ |
430 | | - public static function fetchTemplateFromDB ( $wikiID, $title ) { |
431 | | - |
432 | | - $revision = Revision::loadFromTitleForeignWiki( $wikiID, $title ); |
433 | | - |
434 | | - if ( $revision ) { |
435 | | - $text = $revision->getText(); |
436 | | - return $text; |
437 | | - } |
438 | | - |
439 | | - return false; |
440 | | - } |
441 | | - |
442 | | - /** |
443 | | - * Retrieve the wikitext of a distant page using the API of the foreign wiki |
444 | | - */ |
445 | | - public static function fetchTemplateFromAPI( $interwiki, $transAPI, $fullTitle ) { |
446 | | - global $wgMemc, $wgTranscludeCacheExpiry; |
447 | | - |
448 | | - $key = wfMemcKey( 'iwtransclustiontext', 'textid', $interwiki, $fullTitle ); |
449 | | - $text = $wgMemc->get( $key ); |
450 | | - if( is_array ( $text ) && |
451 | | - isset ( $text['missing'] ) && |
452 | | - $text['missing'] === true ) { |
453 | | - return false; |
454 | | - } else if ( $text ) { |
455 | | - return $text; |
456 | | - } |
457 | | - |
458 | | - $url = wfAppendQuery( |
459 | | - $transAPI, |
460 | | - array( 'action' => 'query', |
461 | | - 'titles' => $fullTitle, |
462 | | - 'prop' => 'revisions', |
463 | | - 'rvprop' => 'content', |
464 | | - 'format' => 'json' |
465 | | - ) |
466 | | - ); |
467 | | - |
468 | | - $get = Http::get( $url ); |
469 | | - $content = FormatJson::decode( $get, true ); |
470 | | - |
471 | | - if ( isset ( $content['query'] ) && |
472 | | - isset ( $content['query']['pages'] ) ) { |
473 | | - $page = array_pop( $content['query']['pages'] ); |
474 | | - if ( $page && isset( $page['revisions'][0]['*'] ) ) { |
475 | | - $text = $page['revisions'][0]['*']; |
476 | | - $wgMemc->set( $key, $text, $wgTranscludeCacheExpiry ); |
477 | | - |
478 | | - // When we cache a template, we also retrieve and cache its subtemplates |
479 | | - $subtemplates = self::getSubtemplatesListFromAPI( $interwiki, $transAPI, $fullTitle ); |
480 | | - self::cacheTemplatesFromAPI( $interwiki, $transAPI, $subtemplates ); |
481 | | - |
482 | | - return $text; |
483 | | - } else { |
484 | | - $wgMemc->set( $key, array ( 'missing' => true ), $wgTranscludeCacheExpiry ); |
485 | | - } |
486 | | - } |
487 | | - return false; |
488 | | - } |
489 | | - |
490 | | - public static function getSubtemplatesListFromAPI ( $interwiki, $transAPI, $title ) { |
491 | | - $url = wfAppendQuery( $transAPI, |
492 | | - array( 'action' => 'query', |
493 | | - 'titles' => $title, |
494 | | - 'prop' => 'templates', |
495 | | - 'format' => 'json' |
496 | | - ) |
497 | | - ); |
498 | | - |
499 | | - $get = Http::get( $url ); |
500 | | - $myArray = FormatJson::decode($get, true); |
501 | | - |
502 | | - $templates = array( ); |
503 | | - if ( ! empty( $myArray['query'] )) { |
504 | | - if ( ! empty( $myArray['query']['pages'] )) { |
505 | | - $templates = array_pop( $myArray['query']['pages'] ); |
506 | | - if ( ! empty( $templates['templates'] )) { |
507 | | - $templates = $templates['templates']; |
508 | | - } |
509 | | - } |
510 | | - return $templates; |
511 | | - } |
512 | | - } |
513 | | - |
514 | | - public static function cacheTemplatesFromAPI( $interwiki, $transAPI, $titles ){ |
515 | | - global $wgMemc, $wgTranscludeCacheExpiry; |
516 | | - |
517 | | - $outdatedTitles = array( ); |
518 | | - |
519 | | - foreach( $titles as $title ){ |
520 | | - if ( isset ( $title['title'] ) ) { |
521 | | - $key = wfMemcKey( 'iwtransclustiontext', 'textid', $interwiki, $title['title'] ); |
522 | | - $text = $wgMemc->get( $key ); |
523 | | - if( !$text ){ |
524 | | - $outdatedTitles[] = $title['title']; |
525 | | - } |
526 | | - } |
527 | | - } |
528 | | - |
529 | | - $batches = array_chunk( $outdatedTitles, 50 ); |
530 | | - |
531 | | - foreach( $batches as $batch ){ |
532 | | - $url = wfAppendQuery( |
533 | | - $transAPI, |
534 | | - array( 'action' => 'query', |
535 | | - 'titles' => implode( '|', $batch ), |
536 | | - 'prop' => 'revisions', |
537 | | - 'rvprop' => 'content', |
538 | | - 'format' => 'json' |
539 | | - ) |
540 | | - ); |
541 | | - $get = Http::get( $url ); |
542 | | - $content = FormatJson::decode( $get, true ); |
543 | | - |
544 | | - if ( isset ( $content['query'] ) && |
545 | | - isset ( $content['query']['pages'] ) ) { |
546 | | - foreach( $content['query']['pages'] as $page ) { |
547 | | - $key = wfMemcKey( 'iwtransclustiontext', 'textid', $interwiki, $page['title'] ); |
548 | | - if ( isset ( $page['revisions'][0]['*'] ) ) { |
549 | | - $text = $page['revisions'][0]['*']; |
550 | | - } else { |
551 | | - $text = array ( 'missing' => true ); |
552 | | - } |
553 | | - $wgMemc->set( $key, $text, $wgTranscludeCacheExpiry ); |
554 | | - } |
555 | | - } |
556 | | - } |
557 | | - } |
558 | | -} |
Property changes on: trunk/phase3/includes/interwiki/Interwiki.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
559 | 394 | Reverse-merged /branches/iwtransclusion/phase3/includes/interwiki/Interwiki.php:r69541,69723,69730,69745-69746,69781,69783,69853,69948,70411,70575,70802 |
560 | 395 | Reverse-merged /branches/iwtransclusion/phase3v2/includes/interwiki/Interwiki.php:r87105-87107,87109 |
561 | 396 | Reverse-merged /branches/iwtransclusion/phase3v3/includes/interwiki/Interwiki.php:r92983-95395 |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -2061,8 +2061,6 @@ |
2062 | 2062 | * @param $action String: action that was denied or null if unknown |
2063 | 2063 | */ |
2064 | 2064 | public function readOnlyPage( $source = null, $protected = false, $reasons = array(), $action = null ) { |
2065 | | - global $wgEnableInterwikiTranscluding, $wgEnableInterwikiTemplatesTracking; |
2066 | | - |
2067 | 2065 | $this->setRobotPolicy( 'noindex,nofollow' ); |
2068 | 2066 | $this->setArticleRelated( false ); |
2069 | 2067 | |
— | — | @@ -2111,12 +2109,6 @@ |
2112 | 2110 | $templates |
2113 | 2111 | </div> |
2114 | 2112 | " ); |
2115 | | - if ( $wgEnableInterwikiTranscluding && $wgEnableInterwikiTemplatesTracking ) { |
2116 | | - $distantTemplates = Linker::formatDistantTemplates( $article->getUsedDistantTemplates() ); |
2117 | | - $this->addHTML( "<div class='distantTemplatesUsed'> |
2118 | | -$distantTemplates |
2119 | | -</div> |
2120 | | -" ); |
2121 | 2113 | } |
2122 | 2114 | } |
2123 | 2115 | |
Property changes on: trunk/phase3/includes/OutputPage.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
2124 | 2116 | Reverse-merged /branches/iwtransclusion/phase3/includes/OutputPage.php:r70764 |
2125 | 2117 | Reverse-merged /branches/iwtransclusion/phase3v2/includes/OutputPage.php:r87108 |
2126 | 2118 | Reverse-merged /branches/iwtransclusion/phase3v3/includes/OutputPage.php:r92983-95395 |
Index: trunk/phase3/includes/WikiPage.php |
— | — | @@ -1600,7 +1600,7 @@ |
1601 | 1601 | public function doDeleteArticle( |
1602 | 1602 | $reason, $suppress = false, $id = 0, $commit = true, &$error = '', User $user = null |
1603 | 1603 | ) { |
1604 | | - global $wgUseTrackbacks, $wgEnableInterwikiTemplatesTracking, $wgGlobalDatabase, $wgUser; |
| 1604 | + global $wgDeferredUpdateList, $wgUseTrackbacks, $wgUser; |
1605 | 1605 | $user = is_null( $user ) ? $wgUser : $user; |
1606 | 1606 | |
1607 | 1607 | wfDebug( __METHOD__ . "\n" ); |
— | — | @@ -1706,13 +1706,6 @@ |
1707 | 1707 | $dbw->delete( 'iwlinks', array( 'iwl_from' => $id ), __METHOD__ ); |
1708 | 1708 | $dbw->delete( 'redirect', array( 'rd_from' => $id ), __METHOD__ ); |
1709 | 1709 | $dbw->delete( 'page_props', array( 'pp_page' => $id ), __METHOD__ ); |
1710 | | - |
1711 | | - if ( $wgEnableInterwikiTemplatesTracking && $wgGlobalDatabase ) { |
1712 | | - $dbw2 = wfGetDB( DB_MASTER, array(), $wgGlobalDatabase ); |
1713 | | - $dbw2->delete( 'globaltemplatelinks', |
1714 | | - array( 'gtl_from_wiki' => wfGetID(), |
1715 | | - 'gtl_from_page' => $id ) |
1716 | | - ); |
1717 | 1710 | } |
1718 | 1711 | } |
1719 | 1712 | |
— | — | @@ -2234,9 +2227,7 @@ |
2235 | 2228 | $title->touchLinks(); |
2236 | 2229 | $title->purgeSquid(); |
2237 | 2230 | $title->deleteTitleProtection(); |
2238 | | - |
2239 | | - # Invalidate caches of distant articles which transclude this page |
2240 | | - DeferredUpdates::addHTMLCacheUpdate( $title, 'globaltemplatelinks' ); |
| 2231 | + $wgDeferredUpdateList[] = new HTMLCacheUpdate( $title, 'globaltemplatelinks' ); |
2241 | 2232 | } |
2242 | 2233 | |
2243 | 2234 | /** |
— | — | @@ -2280,9 +2271,7 @@ |
2281 | 2272 | |
2282 | 2273 | # Image redirects |
2283 | 2274 | RepoGroup::singleton()->getLocalRepo()->invalidateImageRedirect( $title ); |
2284 | | - |
2285 | | - # Invalidate caches of distant articles which transclude this page |
2286 | | - DeferredUpdates::addHTMLCacheUpdate( $title, 'globaltemplatelinks' ); |
| 2275 | + $wgDeferredUpdateList[] = new HTMLCacheUpdate( $title, 'globaltemplatelinks' ); |
2287 | 2276 | } |
2288 | 2277 | |
2289 | 2278 | /** |
— | — | @@ -2295,8 +2284,6 @@ |
2296 | 2285 | // Invalidate caches of articles which include this page |
2297 | 2286 | DeferredUpdates::addHTMLCacheUpdate( $title, 'templatelinks' ); |
2298 | 2287 | |
2299 | | - // Invalidate caches of distant articles which transclude this page |
2300 | | - DeferredUpdates::addHTMLCacheUpdate( $title, 'globaltemplatelinks' ); |
2301 | 2288 | |
2302 | 2289 | // Invalidate the caches of all pages which redirect here |
2303 | 2290 | DeferredUpdates::addHTMLCacheUpdate( $title, 'redirect' ); |
— | — | @@ -2340,40 +2327,6 @@ |
2341 | 2328 | } |
2342 | 2329 | |
2343 | 2330 | /** |
2344 | | - * Return a list of distant templates used by this article. |
2345 | | - * Uses the globaltemplatelinks table |
2346 | | - * |
2347 | | - * @return Array of Title objects |
2348 | | - */ |
2349 | | - public function getUsedDistantTemplates() { |
2350 | | - global $wgGlobalDatabase; |
2351 | | - |
2352 | | - $result = array(); |
2353 | | - |
2354 | | - if ( $wgGlobalDatabase ) { |
2355 | | - $id = $this->mTitle->getArticleID(); |
2356 | | - |
2357 | | - if ( $id == 0 ) { |
2358 | | - return array(); |
2359 | | - } |
2360 | | - |
2361 | | - $dbr = wfGetDB( DB_SLAVE, array(), $wgGlobalDatabase ); |
2362 | | - $res = $dbr->select( 'globaltemplatelinks', |
2363 | | - array( 'gtl_to_prefix', 'gtl_to_namespace', 'gtl_to_title' ), |
2364 | | - array( 'gtl_from_wiki' => wfWikiID( ), 'gtl_from_page' => $id ), |
2365 | | - __METHOD__ ); |
2366 | | - |
2367 | | - if ( $res !== false ) { |
2368 | | - foreach ( $res as $row ) { |
2369 | | - $result[] = Title::makeTitle( $row->gtl_to_namespace, $row->gtl_to_title, null, $row->gtl_to_prefix ); |
2370 | | - } |
2371 | | - } |
2372 | | - } |
2373 | | - |
2374 | | - return $result; |
2375 | | - } |
2376 | | - |
2377 | | - /** |
2378 | 2331 | * Returns a list of hidden categories this page is a member of. |
2379 | 2332 | * Uses the page_props and categorylinks tables. |
2380 | 2333 | * |
Index: trunk/phase3/includes/BacklinkCache.php |
— | — | @@ -177,25 +177,6 @@ |
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
181 | | - * Get the distant backtemplatelinks for the table globaltemplatelinks. Cached in process memory only. |
182 | | - * @return ResultWrapper list of distant pages that use the local title |
183 | | - */ |
184 | | - public function getDistantTemplateLinks( ) { |
185 | | - global $wgGlobalDatabase, $wgLocalInterwiki; |
186 | | - |
187 | | - $dbr = wfGetDB( DB_SLAVE, array(), $wgGlobalDatabase ); |
188 | | - $res = $dbr->select( |
189 | | - array( 'globaltemplatelinks', 'globalinterwiki' ), |
190 | | - array( 'gtl_from_wiki', 'gtl_from_page', 'gtl_from_title', 'giw_prefix' ), |
191 | | - array( 'gtl_to_prefix' => $wgLocalInterwiki, 'gtl_to_title' => $this->title->getDBkey( ) ), |
192 | | - __METHOD__, |
193 | | - null, |
194 | | - array( 'gtl_from_wiki = giw_wikiid' ) |
195 | | - ); |
196 | | - return $res; |
197 | | - } |
198 | | - |
199 | | - /** |
200 | 181 | * Get the field name prefix for a given table |
201 | 182 | * @param $table String |
202 | 183 | */ |
— | — | @@ -206,7 +187,6 @@ |
207 | 188 | 'categorylinks' => 'cl', |
208 | 189 | 'templatelinks' => 'tl', |
209 | 190 | 'redirect' => 'rd', |
210 | | - 'globaltemplatelinks' => 'gtl', |
211 | 191 | ); |
212 | 192 | |
213 | 193 | if ( isset( $prefixes[$table] ) ) { |
— | — | @@ -305,7 +285,7 @@ |
306 | 286 | */ |
307 | 287 | public function partition( $table, $batchSize ) { |
308 | 288 | |
309 | | - // 1) try partition cache ... |
| 289 | + // 1) try partition cache ... |
310 | 290 | |
311 | 291 | if ( isset( $this->partitionCache[$table][$batchSize] ) ) { |
312 | 292 | wfDebug( __METHOD__ . ": got from partition cache\n" ); |
— | — | @@ -360,7 +340,7 @@ |
361 | 341 | * Partition a DB result with backlinks in it into batches |
362 | 342 | * @param $res ResultWrapper database result |
363 | 343 | * @param $batchSize integer |
364 | | - * @return array @see |
| 344 | + * @return array @see |
365 | 345 | */ |
366 | 346 | protected function partitionResult( $res, $batchSize ) { |
367 | 347 | $batches = array(); |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -47,7 +47,6 @@ |
48 | 48 | */ |
49 | 49 | const GAID_FOR_UPDATE = 1; |
50 | 50 | |
51 | | - |
52 | 51 | /** |
53 | 52 | * @name Private member variables |
54 | 53 | * Please use the accessor functions instead. |
— | — | @@ -766,19 +765,6 @@ |
767 | 766 | } |
768 | 767 | |
769 | 768 | /** |
770 | | - * Return the prefixed title with spaces _without_ the interwiki prefix |
771 | | - * |
772 | | - * @return \type{\string} the title, prefixed by the namespace but not by the interwiki prefix, with spaces |
773 | | - */ |
774 | | - public function getSemiPrefixedText() { |
775 | | - if ( !isset( $this->mSemiPrefixedText ) ){ |
776 | | - $s = ( $this->mNamespace === NS_MAIN ? '' : $this->getNsText() . ':' ) . $this->mTextform; |
777 | | - $s = str_replace( '_', ' ', $s ); |
778 | | - $this->mSemiPrefixedText = $s; |
779 | | - } |
780 | | - return $this->mSemiPrefixedText; |
781 | | - } |
782 | | - |
783 | 769 | /** |
784 | 770 | * Get the prefixed title with spaces, plus any fragment |
785 | 771 | * (part beginning with '#') |
— | — | @@ -857,6 +843,8 @@ |
858 | 844 | * @return String the URL |
859 | 845 | */ |
860 | 846 | public function getFullURL( $query = '', $variant = false ) { |
| 847 | + global $wgServer, $wgRequest; |
| 848 | + |
861 | 849 | # Hand off all the decisions on urls to getLocalURL |
862 | 850 | $url = $this->getLocalURL( $query, $variant ); |
863 | 851 | |
— | — | @@ -1029,12 +1017,8 @@ |
1030 | 1018 | * @return String the URL |
1031 | 1019 | */ |
1032 | 1020 | public function getInternalURL( $query = '', $variant = false ) { |
1033 | | - if ( $this->isExternal( ) ) { |
1034 | | - $server = ''; |
1035 | | - } else { |
1036 | | - global $wgInternalServer, $wgServer; |
1037 | | - $server = $wgInternalServer !== false ? $wgInternalServer : $wgServer; |
1038 | | - } |
| 1021 | + global $wgInternalServer, $wgServer; |
| 1022 | + $server = $wgInternalServer !== false ? $wgInternalServer : $wgServer; |
1039 | 1023 | $url = wfExpandUrl( $server . $this->getLocalURL( $query, $variant ), PROTO_HTTP ); |
1040 | 1024 | wfRunHooks( 'GetInternalURL', array( &$this, &$url, $query, $variant ) ); |
1041 | 1025 | return $url; |
— | — | @@ -2853,10 +2837,6 @@ |
2854 | 2838 | $this->mFragment = str_replace( '_', ' ', substr( $fragment, 1 ) ); |
2855 | 2839 | } |
2856 | 2840 | |
2857 | | - public function setInterwiki( $interwiki ) { |
2858 | | - $this->mInterwiki = $interwiki; |
2859 | | - } |
2860 | | - |
2861 | 2841 | /** |
2862 | 2842 | * Get a Title object associated with the talk page of this article |
2863 | 2843 | * |
— | — | @@ -3168,8 +3148,6 @@ |
3169 | 3149 | * @return Mixed true on success, getUserPermissionsErrors()-like array on failure |
3170 | 3150 | */ |
3171 | 3151 | public function moveTo( &$nt, $auth = true, $reason = '', $createRedirect = true ) { |
3172 | | - global $wgEnableInterwikiTemplatesTracking, $wgGlobalDatabase; |
3173 | | - |
3174 | 3152 | $err = $this->isValidMoveOperation( $nt, $auth, $reason ); |
3175 | 3153 | if ( is_array( $err ) ) { |
3176 | 3154 | return $err; |
— | — | @@ -3197,7 +3175,7 @@ |
3198 | 3176 | $pageCountChange = ( $createRedirect ? 1 : 0 ) - ( $nt->exists() ? 1 : 0 ); |
3199 | 3177 | |
3200 | 3178 | // Do the actual move |
3201 | | - $err = $this->moveOverExistingRedirect( $nt, $reason, $createRedirect ); |
| 3179 | + $err = $this->moveToInternal( $nt, $reason, $createRedirect ); |
3202 | 3180 | if ( is_array( $err ) ) { |
3203 | 3181 | # @todo FIXME: What about the File we have already moved? |
3204 | 3182 | $dbw->rollback(); |
— | — | @@ -3229,15 +3207,6 @@ |
3230 | 3208 | ); |
3231 | 3209 | } |
3232 | 3210 | |
3233 | | - if ( $wgEnableInterwikiTemplatesTracking && $wgGlobalDatabase ) { |
3234 | | - $dbw2 = wfGetDB( DB_MASTER, array(), $wgGlobalDatabase ); |
3235 | | - $dbw2->update( 'globaltemplatelinks', |
3236 | | - array( 'gtl_from_namespace' => $nt->getNamespace(), |
3237 | | - 'gtl_from_title' => $nt->getText() ), |
3238 | | - array ( 'gtl_from_page' => $pageid ), |
3239 | | - __METHOD__ ); |
3240 | | - } |
3241 | | - |
3242 | 3211 | if ( $protected ) { |
3243 | 3212 | # Protect the redirect title as the title used to be... |
3244 | 3213 | $dbw->insertSelect( 'page_restrictions', 'page_restrictions', |
— | — | @@ -3331,8 +3300,8 @@ |
3332 | 3301 | * @param $createRedirect Bool Whether to leave a redirect at the old title. Ignored |
3333 | 3302 | * if the user doesn't have the suppressredirect right |
3334 | 3303 | */ |
3335 | | - private function moveOverExistingRedirect( &$nt, $reason = '', $createRedirect = true ) { |
3336 | | - global $wgUser, $wgContLang, $wgEnableInterwikiTemplatesTracking, $wgGlobalDatabase; |
| 3304 | + private function moveToInternal( &$nt, $reason = '', $createRedirect = true ) { |
| 3305 | + global $wgUser, $wgContLang; |
3337 | 3306 | |
3338 | 3307 | if ( $nt->exists() ) { |
3339 | 3308 | $moveOverRedirect = true; |
— | — | @@ -3399,14 +3368,7 @@ |
3400 | 3369 | array( 'rc_timestamp' => $rcts, 'rc_namespace' => $newns, 'rc_title' => $newdbk, 'rc_new' => 1 ), |
3401 | 3370 | __METHOD__ |
3402 | 3371 | ); |
3403 | | - |
3404 | | - if ( $wgEnableInterwikiTemplatesTracking && $wgGlobalDatabase ) { |
3405 | | - $dbw2 = wfGetDB( DB_MASTER, array(), $wgGlobalDatabase ); |
3406 | | - $dbw2->delete( 'globaltemplatelinks', |
3407 | | - array( 'gtl_from_wiki' => wfGetID(), |
3408 | | - 'gtl_from_page' => $newid ), |
3409 | 3372 | __METHOD__ ); |
3410 | | - } |
3411 | 3373 | } |
3412 | 3374 | |
3413 | 3375 | # Save a null revision in the page's history notifying of the move |
— | — | @@ -4406,4 +4368,4 @@ |
4407 | 4369 | wfRunHooks( 'PageContentLanguage', array( $this, &$pageLang, $wgLang ) ); |
4408 | 4370 | return wfGetLangObj( $pageLang ); |
4409 | 4371 | } |
4410 | | -} |
| 4372 | +} |
\ No newline at end of file |
Property changes on: trunk/phase3/includes/Title.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
4411 | 4373 | Reverse-merged /branches/iwtransclusion/phase3v2/includes/Title.php:r87106-87107,87111,87115 |
4412 | 4374 | Reverse-merged /branches/iwtransclusion/phase3v3/includes/Title.php:r92983-95395 |
4413 | 4375 | Reverse-merged /branches/iwtransclusion/phase3/includes/Title.php:r69745-69746,69781,69783,69853,69948,70411,70575-70576,70966,71049,76200 |