Merge "Proper namespace handling for WikiImporter"
[lhc/web/wiklou.git] / includes / filebackend / FSFileBackend.php
index e7c1f6f..c00fb81 100644 (file)
@@ -213,7 +213,7 @@ class FSFileBackend extends FileBackendStore {
                                wfEscapeShellArg( $this->cleanPathSlashes( $tempFile->getPath() ) ),
                                wfEscapeShellArg( $this->cleanPathSlashes( $dest ) )
                        ) );
-                       $handler = function( $errors, Status $status, array $params, $cmd ) {
+                       $handler = function ( $errors, Status $status, array $params, $cmd ) {
                                if ( $errors !== '' && !( wfIsWindows() && $errors[0] === " " ) ) {
                                        $status->fatal( 'backend-fail-create', $params['dst'] );
                                        trigger_error( "$cmd\n$errors", E_USER_WARNING ); // command output
@@ -252,7 +252,7 @@ class FSFileBackend extends FileBackendStore {
                                wfEscapeShellArg( $this->cleanPathSlashes( $params['src'] ) ),
                                wfEscapeShellArg( $this->cleanPathSlashes( $dest ) )
                        ) );
-                       $handler = function( $errors, Status $status, array $params, $cmd ) {
+                       $handler = function ( $errors, Status $status, array $params, $cmd ) {
                                if ( $errors !== '' && !( wfIsWindows() && $errors[0] === " " ) ) {
                                        $status->fatal( 'backend-fail-store', $params['src'], $params['dst'] );
                                        trigger_error( "$cmd\n$errors", E_USER_WARNING ); // command output
@@ -310,7 +310,7 @@ class FSFileBackend extends FileBackendStore {
                                wfEscapeShellArg( $this->cleanPathSlashes( $source ) ),
                                wfEscapeShellArg( $this->cleanPathSlashes( $dest ) )
                        ) );
-                       $handler = function( $errors, Status $status, array $params, $cmd ) {
+                       $handler = function ( $errors, Status $status, array $params, $cmd ) {
                                if ( $errors !== '' && !( wfIsWindows() && $errors[0] === " " ) ) {
                                        $status->fatal( 'backend-fail-copy', $params['src'], $params['dst'] );
                                        trigger_error( "$cmd\n$errors", E_USER_WARNING ); // command output
@@ -370,7 +370,7 @@ class FSFileBackend extends FileBackendStore {
                                wfEscapeShellArg( $this->cleanPathSlashes( $source ) ),
                                wfEscapeShellArg( $this->cleanPathSlashes( $dest ) )
                        ) );
-                       $handler = function( $errors, Status $status, array $params, $cmd ) {
+                       $handler = function ( $errors, Status $status, array $params, $cmd ) {
                                if ( $errors !== '' && !( wfIsWindows() && $errors[0] === " " ) ) {
                                        $status->fatal( 'backend-fail-move', $params['src'], $params['dst'] );
                                        trigger_error( "$cmd\n$errors", E_USER_WARNING ); // command output
@@ -415,7 +415,7 @@ class FSFileBackend extends FileBackendStore {
                                wfIsWindows() ? 'DEL' : 'unlink',
                                wfEscapeShellArg( $this->cleanPathSlashes( $source ) )
                        ) );
-                       $handler = function( $errors, Status $status, array $params, $cmd ) {
+                       $handler = function ( $errors, Status $status, array $params, $cmd ) {
                                if ( $errors !== '' && !( wfIsWindows() && $errors[0] === " " ) ) {
                                        $status->fatal( 'backend-fail-delete', $params['src'] );
                                        trigger_error( "$cmd\n$errors", E_USER_WARNING ); // command output
@@ -451,10 +451,13 @@ class FSFileBackend extends FileBackendStore {
                // Create the directory and its parents as needed...
                $this->trapWarnings();
                if ( !wfMkdirParents( $dir ) ) {
+                       wfDebugLog( 'FSFileBackend', __METHOD__ . ": cannot create directory $dir" );
                        $status->fatal( 'directorycreateerror', $params['dir'] ); // fails on races
                } elseif ( !is_writable( $dir ) ) {
+                       wfDebugLog( 'FSFileBackend', __METHOD__ . ": directory $dir is read-only" );
                        $status->fatal( 'directoryreadonlyerror', $params['dir'] );
                } elseif ( !is_readable( $dir ) ) {
+                       wfDebugLog( 'FSFileBackend', __METHOD__ . ": directory $dir is not readable" );
                        $status->fatal( 'directorynotreadableerror', $params['dir'] );
                }
                $this->untrapWarnings();
@@ -828,7 +831,7 @@ abstract class FSFileBackendList implements Iterator {
        protected $params = array();
 
        /**
-        * @param string $dir file system directory
+        * @param string $dir File system directory
         * @param array $params
         */
        public function __construct( $dir, array $params ) {
@@ -849,7 +852,7 @@ abstract class FSFileBackendList implements Iterator {
        /**
         * Return an appropriate iterator object to wrap
         *
-        * @param string $dir file system directory
+        * @param string $dir File system directory
         * @return Iterator
         */
        protected function initIterator( $dir ) {