r104822 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104821‎ | r104822 | r104823 >
Date:01:17, 1 December 2011
Author:aaron
Status:deferred
Tags:
Comment:
* Fixed bogus vars in FileOp and FSFileBackend
* Fixed SVN merge fail in wfMkDirParents()
* Updated calls of File::getPropsFromPath and File::sha1Base36 (avoids deprecated notices)
* Unbroke file deletion/restoring
Modified paths:
  • /branches/FileBackend/phase3/includes/Setup.php (modified) (history)
  • /branches/FileBackend/phase3/includes/filerepo/FileRepo.php (modified) (history)
  • /branches/FileBackend/phase3/includes/filerepo/backend/FSFileBackend.php (modified) (history)

Diff [purge]

Index: branches/FileBackend/phase3/includes/Setup.php
@@ -230,6 +230,10 @@
231231 $backendName = $info['name'] . '-backend';
232232 // Update repo config to use this backend
233233 $info['backend'] = $backendName;
 234+ // Disable "deleted" zone in repo config if deleted dir not set
 235+ if ( $deletedDir !== false ) {
 236+ $info['zones']['deleted'] = array( 'container' => 'deleted', 'directory' => '' );
 237+ }
234238 // Get the FS backend configuration
235239 return array(
236240 'name' => $backendName,
Index: branches/FileBackend/phase3/includes/filerepo/backend/FSFileBackend.php
@@ -57,7 +57,7 @@
5858 }
5959 } else {
6060 if ( !wfMkdirParents( dirname( $dest ) ) ) {
61 - $status->fatal( 'directorycreateerror', $param['dst'] );
 61+ $status->fatal( 'directorycreateerror', $params['dst'] );
6262 return $status;
6363 }
6464 }
@@ -124,7 +124,7 @@
125125 }
126126 } else {
127127 if ( !wfMkdirParents( dirname( $dest ) ) ) {
128 - $status->fatal( 'directorycreateerror', $param['dst'] );
 128+ $status->fatal( 'directorycreateerror', $params['dst'] );
129129 return $status;
130130 }
131131 }
@@ -242,7 +242,7 @@
243243 } else {
244244 // Make sure destination directory exists
245245 if ( !wfMkdirParents( dirname( $dest ) ) ) {
246 - $status->fatal( 'directorycreateerror', $param['dst'] );
 246+ $status->fatal( 'directorycreateerror', $params['dst'] );
247247 return $status;
248248 }
249249 }
@@ -276,7 +276,7 @@
277277 $ok = unlink( $dest );
278278 wfRestoreWarnings();
279279 if ( !$ok ) {
280 - $status->fatal( 'backend-fail-delete', $param['dst'] );
 280+ $status->fatal( 'backend-fail-delete', $params['dst'] );
281281 return $status;
282282 }
283283 } else {
@@ -285,7 +285,7 @@
286286 }
287287 } else {
288288 if ( !wfMkdirParents( dirname( $dest ) ) ) {
289 - $status->fatal( 'directorycreateerror', $param['dst'] );
 289+ $status->fatal( 'directorycreateerror', $params['dst'] );
290290 return $status;
291291 }
292292 }
@@ -311,13 +311,13 @@
312312 return $status; // invalid storage path
313313 }
314314 if ( !wfMkdirParents( $dir ) ) {
315 - $status->fatal( 'directorycreateerror', $param['dir'] );
 315+ $status->fatal( 'directorycreateerror', $params['dir'] );
316316 return $status;
317317 } elseif ( !is_writable( $dir ) ) {
318 - $status->fatal( 'directoryreadonlyerror', $param['dir'] );
 318+ $status->fatal( 'directoryreadonlyerror', $params['dir'] );
319319 return $status;
320320 } elseif ( !is_readable( $dir ) ) {
321 - $status->fatal( 'directorynotreadableerror', $param['dir'] );
 321+ $status->fatal( 'directorynotreadableerror', $params['dir'] );
322322 return $status;
323323 }
324324 return $status;
@@ -331,7 +331,7 @@
332332 return $status; // invalid storage path
333333 }
334334 if ( !wfMkdirParents( $dir ) ) {
335 - $status->fatal( 'directorycreateerror', $param['dir'] );
 335+ $status->fatal( 'directorycreateerror', $params['dir'] );
336336 return $status;
337337 }
338338 // Add a .htaccess file to the root of the deleted zone
@@ -350,7 +350,7 @@
351351 $ok = file_put_contents( "{$dir}/index.html", '' );
352352 wfRestoreWarnings();
353353 if ( !$ok ) {
354 - $status->fatal( 'backend-fail-create', $params['dst'] . '/index.html' );
 354+ $status->fatal( 'backend-fail-create', $params['dir'] . '/index.html' );
355355 return $status;
356356 }
357357 }
Index: branches/FileBackend/phase3/includes/filerepo/FileRepo.php
@@ -1005,7 +1005,7 @@
10061006 public function deleteBatch( $sourceDestPairs ) {
10071007 $backend = $this->backend; // convenience
10081008
1009 - if ( !isset( $this->zones['deleted'] ) ) {
 1009+ if ( !isset( $this->zones['deleted']['container'] ) ) {
10101010 throw new MWException( __METHOD__.': no valid deletion archive directory' );
10111011 }
10121012

Status & tagging log