From: Antoine Musso Date: Wed, 8 Feb 2012 09:21:19 +0000 (+0000) Subject: fix notice on construction without 'containerPaths' X-Git-Tag: 1.31.0-rc.0~24874 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dcompta/operations/supprimer.php?a=commitdiff_plain;h=83a290eb0da7f289a0ac6fdb4c07b0fd991abcf4;p=lhc%2Fweb%2Fwiklou.git 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', ); --- 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;