Index: trunk/phase3/includes/filerepo/LocalRepo.php |
— | — | @@ -18,6 +18,11 @@ |
19 | 19 | var $fileFromRowFactory = array( 'LocalFile', 'newFromRow' ); |
20 | 20 | var $oldFileFromRowFactory = array( 'OldLocalFile', 'newFromRow' ); |
21 | 21 | |
| 22 | + /** |
| 23 | + * @throws MWException |
| 24 | + * @param $row |
| 25 | + * @return File |
| 26 | + */ |
22 | 27 | function newFileFromRow( $row ) { |
23 | 28 | if ( isset( $row->img_name ) ) { |
24 | 29 | return call_user_func( $this->fileFromRowFactory, $row, $this ); |
Index: trunk/phase3/includes/api/ApiMove.php |
— | — | @@ -135,6 +135,13 @@ |
136 | 136 | $this->getResult()->addValue( null, $this->getModuleName(), $r ); |
137 | 137 | } |
138 | 138 | |
| 139 | + /** |
| 140 | + * @param Title $fromTitle |
| 141 | + * @param Title $toTitle |
| 142 | + * @param $reason |
| 143 | + * @param $noredirect |
| 144 | + * @return array |
| 145 | + */ |
139 | 146 | public function moveSubpages( $fromTitle, $toTitle, $reason, $noredirect ) { |
140 | 147 | $retval = array(); |
141 | 148 | $success = $fromTitle->moveSubpages( $toTitle, true, $reason, !$noredirect ); |
Index: trunk/phase3/includes/api/ApiFileRevert.php |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | */ |
41 | 41 | protected $file; |
42 | 42 | protected $archiveName; |
43 | | - |
| 43 | + |
44 | 44 | protected $params; |
45 | 45 | |
46 | 46 | public function __construct( $main, $action ) { |
— | — | @@ -54,11 +54,11 @@ |
55 | 55 | |
56 | 56 | $this->params = $this->extractRequestParams(); |
57 | 57 | $this->validateParameters(); |
58 | | - |
59 | 58 | |
| 59 | + |
60 | 60 | $sourceUrl = $this->file->getArchiveVirtualUrl( $this->archiveName ); |
61 | 61 | $status = $this->file->upload( $sourceUrl, $this->params['comment'], $this->params['comment'] ); |
62 | | - |
| 62 | + |
63 | 63 | if ( $status->isGood() ) { |
64 | 64 | $result = array( 'result' => 'Success' ); |
65 | 65 | } else { |
— | — | @@ -67,7 +67,7 @@ |
68 | 68 | 'errors' => $this->getResult()->convertStatusToArray( $status ), |
69 | 69 | ); |
70 | 70 | } |
71 | | - |
| 71 | + |
72 | 72 | $this->getResult()->addValue( null, $this->getModuleName(), $result ); |
73 | 73 | |
74 | 74 | } |
— | — | @@ -88,7 +88,7 @@ |
89 | 89 | } |
90 | 90 | } |
91 | 91 | } |
92 | | - |
| 92 | + |
93 | 93 | /** |
94 | 94 | * Validate the user parameters and set $this->archiveName and $this->file. |
95 | 95 | * Throws an error if validation fails |
— | — | @@ -104,7 +104,7 @@ |
105 | 105 | if ( !$this->file->exists() ) { |
106 | 106 | $this->dieUsageMsg( array( 'notanarticle' ) ); |
107 | 107 | } |
108 | | - |
| 108 | + |
109 | 109 | // Check if the archivename is valid for this file |
110 | 110 | $this->archiveName = $this->params['archivename']; |
111 | 111 | $oldFile = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $title, $this->archiveName ); |
— | — | @@ -112,8 +112,6 @@ |
113 | 113 | $this->dieUsageMsg( array( 'filerevert-badversion' ) ); |
114 | 114 | } |
115 | 115 | } |
116 | | - |
117 | | - |
118 | 116 | |
119 | 117 | public function mustBePosted() { |
120 | 118 | return true; |