From 83a290eb0da7f289a0ac6fdb4c07b0fd991abcf4 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Wed, 8 Feb 2012 09:21:19 +0000 Subject: [PATCH] fix notice on construction without 'containerPaths' The comment block seems to indicate that containerPaths should only be used for backwards-compatibility, which implies it is optional. The following code generated a notice: $fsBackend = new FSFileBackend( array( 'name' => 'foo', 'lockManager' => 'fsLockManager', 'basePath' => '/tmp/foo', ); --- includes/filerepo/backend/FSFileBackend.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/filerepo/backend/FSFileBackend.php b/includes/filerepo/backend/FSFileBackend.php index 68c69d6f43..881df565b4 100644 --- a/includes/filerepo/backend/FSFileBackend.php +++ b/includes/filerepo/backend/FSFileBackend.php @@ -48,10 +48,13 @@ class FSFileBackend extends FileBackendStore { $this->basePath = null; // none; containers must have explicit paths } - $this->containerPaths = (array)$config['containerPaths']; - foreach ( $this->containerPaths as &$path ) { - rtrim( $path, '/' ); // remove trailing slash + if( isset( $config['containerPaths'] ) ) { + $this->containerPaths = (array)$config['containerPaths']; + foreach ( $this->containerPaths as &$path ) { + rtrim( $path, '/' ); // remove trailing slash + } } + $this->fileMode = isset( $config['fileMode'] ) ? $config['fileMode'] : 0644; -- 2.20.1