* We no longer just give up on a missing upload base directory; it's now
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 10 Jun 2008 16:49:21 +0000 (16:49 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 10 Jun 2008 16:49:21 +0000 (16:49 +0000)
  created automatically if we have sufficient permissions!

(Note that upload_directory_missing and upload_directory_read_only still have crappy output as they show a non-obvious internal path in the output.)

RELEASE-NOTES
includes/filerepo/FSRepo.php
languages/messages/MessagesEn.php

index 8a04839..a7c596f 100644 (file)
@@ -360,6 +360,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   extension tables using uppercase letters or digits in their names.
 * (bug 12311) Fix regression with lists at start of undeletion preview
 * (bug 14496) Fix regression with parseinline on Special:Upload.
+* We no longer just give up on a missing upload base directory; it's now
+  created automatically if we have sufficient permissions!
+
 
 === API changes in 1.13 ===
 
index 68b990e..08ec151 100644 (file)
@@ -125,6 +125,9 @@ class FSRepo extends FileRepo {
         *                             same contents as the source
         */
        function storeBatch( $triplets, $flags = 0 ) {
+               if ( !wfMkdirParents( $this->directory ) ) {
+                       return $this->newFatal( 'upload_directory_missing', $this->directory );
+               }
                if ( !is_writable( $this->directory ) ) {
                        return $this->newFatal( 'upload_directory_read_only', $this->directory );
                }
@@ -255,6 +258,9 @@ class FSRepo extends FileRepo {
         */
        function publishBatch( $triplets, $flags = 0 ) {
                // Perform initial checks
+               if ( !wfMkdirParents( $this->directory ) ) {
+                       return $this->newFatal( 'upload_directory_missing', $this->directory );
+               }
                if ( !is_writable( $this->directory ) ) {
                        return $this->newFatal( 'upload_directory_read_only', $this->directory );
                }
index 0adbc09..8370143 100644 (file)
@@ -1577,6 +1577,7 @@ Pages on [[Special:Watchlist|your watchlist]] are '''bold'''.",
 'reuploaddesc'                => 'Cancel upload and return to the upload form',
 'uploadnologin'               => 'Not logged in',
 'uploadnologintext'           => 'You must be [[Special:Userlogin|logged in]] to upload files.',
+'upload_directory_missing'    => 'The upload directory ($1) is missing and could not be created by the webserver.',
 'upload_directory_read_only'  => 'The upload directory ($1) is not writable by the webserver.',
 'uploaderror'                 => 'Upload error',
 'upload-summary'              => '', # only translate this message to other languages if you have to change it