Index: trunk/phase3/maintenance/archives/patch-image_reditects.sql |
— | — | @@ -1,6 +0,0 @@ |
2 | | -CREATE TABLE /*$wgDBprefix*/imageredirects ( |
3 | | - ir_from varchar(255) binary NOT NULL default '', |
4 | | - ir_to varchar(255) binary NOT NULL default '', |
5 | | - PRIMARY KEY ir_from (ir_from) |
6 | | -) /*$wgDBTableOptions*/; |
\ No newline at end of file |
Index: trunk/phase3/maintenance/updaters.inc |
— | — | @@ -23,23 +23,22 @@ |
24 | 24 | |
25 | 25 | $wgNewTables = array( |
26 | 26 | # table patch file (in maintenance/archives) |
27 | | - array( 'hitcounter', 'patch-hitcounter.sql' ), |
28 | | - array( 'querycache', 'patch-querycache.sql' ), |
29 | | - array( 'objectcache', 'patch-objectcache.sql' ), |
30 | | - array( 'categorylinks', 'patch-categorylinks.sql' ), |
31 | | - array( 'logging', 'patch-logging.sql' ), |
32 | | - array( 'user_newtalk', 'patch-usernewtalk2.sql' ), |
33 | | - array( 'transcache', 'patch-transcache.sql' ), |
34 | | - array( 'trackbacks', 'patch-trackbacks.sql' ), |
35 | | - array( 'externallinks', 'patch-externallinks.sql' ), |
36 | | - array( 'job', 'patch-job.sql' ), |
37 | | - array( 'langlinks', 'patch-langlinks.sql' ), |
38 | | - array( 'querycache_info', 'patch-querycacheinfo.sql' ), |
39 | | - array( 'filearchive', 'patch-filearchive.sql' ), |
40 | | - array( 'querycachetwo', 'patch-querycachetwo.sql' ), |
41 | | - array( 'redirect', 'patch-redirect.sql' ), |
| 27 | + array( 'hitcounter', 'patch-hitcounter.sql' ), |
| 28 | + array( 'querycache', 'patch-querycache.sql' ), |
| 29 | + array( 'objectcache', 'patch-objectcache.sql' ), |
| 30 | + array( 'categorylinks', 'patch-categorylinks.sql' ), |
| 31 | + array( 'logging', 'patch-logging.sql' ), |
| 32 | + array( 'user_newtalk', 'patch-usernewtalk2.sql' ), |
| 33 | + array( 'transcache', 'patch-transcache.sql' ), |
| 34 | + array( 'trackbacks', 'patch-trackbacks.sql' ), |
| 35 | + array( 'externallinks', 'patch-externallinks.sql' ), |
| 36 | + array( 'job', 'patch-job.sql' ), |
| 37 | + array( 'langlinks', 'patch-langlinks.sql' ), |
| 38 | + array( 'querycache_info', 'patch-querycacheinfo.sql' ), |
| 39 | + array( 'filearchive', 'patch-filearchive.sql' ), |
| 40 | + array( 'querycachetwo', 'patch-querycachetwo.sql' ), |
| 41 | + array( 'redirect', 'patch-redirect.sql' ), |
42 | 42 | array( 'protected_titles', 'patch-protected_titles.sql' ), |
43 | | - array( 'imageredirects', 'patch-image_reditects.sql' ), |
44 | 43 | ); |
45 | 44 | |
46 | 45 | $wgNewFields = array( |
Index: trunk/phase3/maintenance/tables.sql |
— | — | @@ -711,17 +711,6 @@ |
712 | 712 | ) /*$wgDBTableOptions*/; |
713 | 713 | |
714 | 714 | -- |
715 | | -CREATE TABLE /*$wgDBprefix*/imageredirects ( |
716 | | - -- Source image name |
717 | | - ir_from varchar(255) binary NOT NULL default '', |
718 | | - -- Destination image name |
719 | | - ir_to varchar(255) binary NOT NULL default '', |
720 | | - |
721 | | - PRIMARY KEY ir_from (ir_from) |
722 | | -) /*$wgDBTableOptions*/; |
723 | 715 | -- Previous revisions of uploaded files. |
724 | 716 | -- Awkwardly, image rows have to be moved into |
725 | 717 | -- this table at re-upload time. |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -1098,27 +1098,6 @@ |
1099 | 1099 | $isRedirect = !is_null($redirectTitle); |
1100 | 1100 | if ($isRedirect || is_null($lastRevIsRedirect) || $lastRevIsRedirect !== $isRedirect) { |
1101 | 1101 | |
1102 | | - $imageResult = true; //Result of imageredirects handling |
1103 | | - if( $this->mTitle->getNamespace() == NS_IMAGE ) { |
1104 | | - wfProfileIn( __METHOD__ . "-img" ); |
1105 | | - |
1106 | | - $exists = $redirectTitle ? RepoGroup::singleton()->findFile( $redirectTitle->getDBkey() ) !== false : false; |
1107 | | - if( $isRedirect && $redirectTitle->getNamespace() == NS_IMAGE && $exists ) { |
1108 | | - $set = array( |
1109 | | - 'ir_from' => $this->mTitle->getDBkey(), |
1110 | | - 'ir_to' => $redirectTitle->getDBkey(), |
1111 | | - ); |
1112 | | - $dbw->replace( 'imageredirects', array( 'ir_from' ), $set, __METHOD__ ); |
1113 | | - $imageResult = $dbw->affectedRows() != 0; |
1114 | | - } else { |
1115 | | - // Non-redirect or redirect to non-image |
1116 | | - $where = array( 'ir_from' => $this->mTitle->getDBkey() ); |
1117 | | - $dbw->delete( 'imageredirects', $where, __METHOD__ ); |
1118 | | - } |
1119 | | - |
1120 | | - wfProfileOut( __METHOD__ . "-img" ); |
1121 | | - } |
1122 | | - |
1123 | 1102 | wfProfileIn( __METHOD__ ); |
1124 | 1103 | |
1125 | 1104 | if ($isRedirect) { |
— | — | @@ -1138,7 +1117,7 @@ |
1139 | 1118 | } |
1140 | 1119 | |
1141 | 1120 | wfProfileOut( __METHOD__ ); |
1142 | | - return ( $dbw->affectedRows() != 0 ) && $imageResult; |
| 1121 | + return ( $dbw->affectedRows() != 0 ); |
1143 | 1122 | } |
1144 | 1123 | |
1145 | 1124 | return true; |
— | — | @@ -2263,7 +2242,6 @@ |
2264 | 2243 | $dbw->delete( 'externallinks', array( 'el_from' => $id ) ); |
2265 | 2244 | $dbw->delete( 'langlinks', array( 'll_from' => $id ) ); |
2266 | 2245 | $dbw->delete( 'redirect', array( 'rd_from' => $id ) ); |
2267 | | - $dbw->delete( 'imageredirects', array( 'ir_from' => $t ) ); |
2268 | 2246 | } |
2269 | 2247 | |
2270 | 2248 | # If using cleanup triggers, we can skip some manual deletes |
Index: trunk/phase3/includes/filerepo/File.php |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | /** |
48 | 48 | * The following member variables are not lazy-initialised |
49 | 49 | */ |
50 | | - var $repo, $title, $lastError, $redirected; |
| 50 | + var $repo, $title, $lastError; |
51 | 51 | |
52 | 52 | /** |
53 | 53 | * Call this constructor from child classes |
— | — | @@ -1136,9 +1136,6 @@ |
1137 | 1137 | return ''; |
1138 | 1138 | } |
1139 | 1139 | } |
1140 | | - |
1141 | | - function getRedirectedFrom() { return $this->redirected; } |
1142 | | - function setRedirectedFrom( $v ) { $this->redirected = $v; } |
1143 | 1140 | } |
1144 | 1141 | /** |
1145 | 1142 | * Aliases for backwards compatibility with 1.6 |
Index: trunk/phase3/includes/filerepo/FileRepo.php |
— | — | @@ -76,36 +76,20 @@ |
77 | 77 | * |
78 | 78 | * @param mixed $time 14-character timestamp, or false for the current version |
79 | 79 | */ |
80 | | - function findFile( $title, $time = false, $redirected = false ) { |
81 | | - if ( !($title instanceof Title) ) { |
82 | | - $title = Title::makeTitleSafe( NS_IMAGE, $title ); |
83 | | - if ( !is_object( $title ) ) { |
84 | | - return null; |
85 | | - } |
86 | | - } |
87 | | - |
| 80 | + function findFile( $title, $time = false ) { |
88 | 81 | # First try the current version of the file to see if it precedes the timestamp |
89 | 82 | $img = $this->newFile( $title ); |
90 | 83 | if ( !$img ) { |
91 | 84 | return false; |
92 | 85 | } |
93 | 86 | if ( $img->exists() && ( !$time || $img->getTimestamp() <= $time ) ) { |
94 | | - $img->setRedirectedFrom( $redirected ); |
95 | 87 | return $img; |
96 | 88 | } |
97 | 89 | # Now try an old version of the file |
98 | 90 | $img = $this->newFile( $title, $time ); |
99 | 91 | if ( $img->exists() ) { |
100 | | - $img->setRedirectedFrom( $redirected ); |
101 | 92 | return $img; |
102 | 93 | } |
103 | | - |
104 | | - #Try redirects |
105 | | - if( !$redirected ) { // Prevent redirect loops |
106 | | - $redir = $this->checkRedirects( $title->getDBkey() ); |
107 | | - if( $redir ) |
108 | | - return $this->findFile( $redir, $time, $title ); |
109 | | - } |
110 | 94 | } |
111 | 95 | |
112 | 96 | /** |
— | — | @@ -416,20 +400,5 @@ |
417 | 401 | * STUB |
418 | 402 | */ |
419 | 403 | function cleanupDeletedBatch( $storageKeys ) {} |
420 | | - |
421 | | - /** |
422 | | - * Check for redirects. |
423 | | - */ |
424 | | - function checkRedirects( $filename ) { |
425 | | - $dbr = $this->getSlaveDB(); |
426 | | - $res = $dbr->selectRow( |
427 | | - 'imageredirects', |
428 | | - array( 'ir_from', 'ir_to' ), |
429 | | - array( 'ir_from' => $filename ), |
430 | | - __METHOD__ |
431 | | - ); |
432 | | - if( !$res ) return false; |
433 | | - return $res->ir_to; |
434 | | - } |
435 | 404 | } |
436 | 405 | |
Index: trunk/phase3/includes/Wiki.php |
— | — | @@ -219,17 +219,12 @@ |
220 | 220 | } |
221 | 221 | |
222 | 222 | switch( $title->getNamespace() ) { |
223 | | - case NS_IMAGE: |
224 | | - $file = RepoGroup::singleton()->findFile( $title->getText() ); |
225 | | - if( $file && $file->getRedirectedFrom() ) { |
226 | | - return new Article( $title ); |
227 | | - } else { |
228 | | - return new ImagePage( $title ); |
229 | | - } |
230 | | - case NS_CATEGORY: |
231 | | - return new CategoryPage( $title ); |
232 | | - default: |
233 | | - return new Article( $title ); |
| 223 | + case NS_IMAGE: |
| 224 | + return new ImagePage( $title ); |
| 225 | + case NS_CATEGORY: |
| 226 | + return new CategoryPage( $title ); |
| 227 | + default: |
| 228 | + return new Article( $title ); |
234 | 229 | } |
235 | 230 | } |
236 | 231 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -112,7 +112,6 @@ |
113 | 113 | * Add HTML ID's mw-read-only-warning and mw-anon-edit-warning to warnings when |
114 | 114 | editing to allow CSS styling. |
115 | 115 | * Parser now returns list of sections |
116 | | -* Support images-redirects |
117 | 116 | |
118 | 117 | === Bug fixes in 1.12 === |
119 | 118 | |