Index: branches/FileBackend/phase3/includes/Setup.php |
— | — | @@ -230,6 +230,10 @@ |
231 | 231 | $backendName = $info['name'] . '-backend'; |
232 | 232 | // Update repo config to use this backend |
233 | 233 | $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 | + } |
234 | 238 | // Get the FS backend configuration |
235 | 239 | return array( |
236 | 240 | 'name' => $backendName, |
Index: branches/FileBackend/phase3/includes/filerepo/backend/FSFileBackend.php |
— | — | @@ -57,7 +57,7 @@ |
58 | 58 | } |
59 | 59 | } else { |
60 | 60 | if ( !wfMkdirParents( dirname( $dest ) ) ) { |
61 | | - $status->fatal( 'directorycreateerror', $param['dst'] ); |
| 61 | + $status->fatal( 'directorycreateerror', $params['dst'] ); |
62 | 62 | return $status; |
63 | 63 | } |
64 | 64 | } |
— | — | @@ -124,7 +124,7 @@ |
125 | 125 | } |
126 | 126 | } else { |
127 | 127 | if ( !wfMkdirParents( dirname( $dest ) ) ) { |
128 | | - $status->fatal( 'directorycreateerror', $param['dst'] ); |
| 128 | + $status->fatal( 'directorycreateerror', $params['dst'] ); |
129 | 129 | return $status; |
130 | 130 | } |
131 | 131 | } |
— | — | @@ -242,7 +242,7 @@ |
243 | 243 | } else { |
244 | 244 | // Make sure destination directory exists |
245 | 245 | if ( !wfMkdirParents( dirname( $dest ) ) ) { |
246 | | - $status->fatal( 'directorycreateerror', $param['dst'] ); |
| 246 | + $status->fatal( 'directorycreateerror', $params['dst'] ); |
247 | 247 | return $status; |
248 | 248 | } |
249 | 249 | } |
— | — | @@ -276,7 +276,7 @@ |
277 | 277 | $ok = unlink( $dest ); |
278 | 278 | wfRestoreWarnings(); |
279 | 279 | if ( !$ok ) { |
280 | | - $status->fatal( 'backend-fail-delete', $param['dst'] ); |
| 280 | + $status->fatal( 'backend-fail-delete', $params['dst'] ); |
281 | 281 | return $status; |
282 | 282 | } |
283 | 283 | } else { |
— | — | @@ -285,7 +285,7 @@ |
286 | 286 | } |
287 | 287 | } else { |
288 | 288 | if ( !wfMkdirParents( dirname( $dest ) ) ) { |
289 | | - $status->fatal( 'directorycreateerror', $param['dst'] ); |
| 289 | + $status->fatal( 'directorycreateerror', $params['dst'] ); |
290 | 290 | return $status; |
291 | 291 | } |
292 | 292 | } |
— | — | @@ -311,13 +311,13 @@ |
312 | 312 | return $status; // invalid storage path |
313 | 313 | } |
314 | 314 | if ( !wfMkdirParents( $dir ) ) { |
315 | | - $status->fatal( 'directorycreateerror', $param['dir'] ); |
| 315 | + $status->fatal( 'directorycreateerror', $params['dir'] ); |
316 | 316 | return $status; |
317 | 317 | } elseif ( !is_writable( $dir ) ) { |
318 | | - $status->fatal( 'directoryreadonlyerror', $param['dir'] ); |
| 318 | + $status->fatal( 'directoryreadonlyerror', $params['dir'] ); |
319 | 319 | return $status; |
320 | 320 | } elseif ( !is_readable( $dir ) ) { |
321 | | - $status->fatal( 'directorynotreadableerror', $param['dir'] ); |
| 321 | + $status->fatal( 'directorynotreadableerror', $params['dir'] ); |
322 | 322 | return $status; |
323 | 323 | } |
324 | 324 | return $status; |
— | — | @@ -331,7 +331,7 @@ |
332 | 332 | return $status; // invalid storage path |
333 | 333 | } |
334 | 334 | if ( !wfMkdirParents( $dir ) ) { |
335 | | - $status->fatal( 'directorycreateerror', $param['dir'] ); |
| 335 | + $status->fatal( 'directorycreateerror', $params['dir'] ); |
336 | 336 | return $status; |
337 | 337 | } |
338 | 338 | // Add a .htaccess file to the root of the deleted zone |
— | — | @@ -350,7 +350,7 @@ |
351 | 351 | $ok = file_put_contents( "{$dir}/index.html", '' ); |
352 | 352 | wfRestoreWarnings(); |
353 | 353 | if ( !$ok ) { |
354 | | - $status->fatal( 'backend-fail-create', $params['dst'] . '/index.html' ); |
| 354 | + $status->fatal( 'backend-fail-create', $params['dir'] . '/index.html' ); |
355 | 355 | return $status; |
356 | 356 | } |
357 | 357 | } |
Index: branches/FileBackend/phase3/includes/filerepo/FileRepo.php |
— | — | @@ -1005,7 +1005,7 @@ |
1006 | 1006 | public function deleteBatch( $sourceDestPairs ) { |
1007 | 1007 | $backend = $this->backend; // convenience |
1008 | 1008 | |
1009 | | - if ( !isset( $this->zones['deleted'] ) ) { |
| 1009 | + if ( !isset( $this->zones['deleted']['container'] ) ) { |
1010 | 1010 | throw new MWException( __METHOD__.': no valid deletion archive directory' ); |
1011 | 1011 | } |
1012 | 1012 | |