Some shared upload fixes
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Wed, 13 Jul 2005 15:35:22 +0000 (15:35 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Wed, 13 Jul 2005 15:35:22 +0000 (15:35 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/Image.php
includes/ImagePage.php

index fda0cec..b08f27b 100644 (file)
@@ -569,6 +569,7 @@ of MediaWiki:Newpagetext) to &action=edit, if page is new.
 * Optional parameters for [[Special:Listusers]]
 * (bug 2832) [[Special:Listadmins]] redirects to [[Special:Listusers/sysop]]
 * (bug 785) Parser did not get out of <pre> with list elements
+* Some shared upload fixes
 
 === Caveats ===
 
index 9f4971e..520f8a4 100644 (file)
@@ -259,6 +259,8 @@ $wgFetchCommonsDescriptions = false;
 $wgSharedUploadDirectory = "/var/www/wiki3/images";
 /** DB name with metadata about shared directory. Set this to false if the uploads do not come from a wiki. */
 $wgSharedUploadDBname = false;
+/** Optional table prefix used in database. */
+$wgSharedUploadDBprefix = '';
 /** Cache shared metadata in memcached. Don't do this if the commons wiki is in a different memcached domain */
 $wgCacheSharedUploads = true;
 
index 2812f47..75d8590 100644 (file)
@@ -306,7 +306,7 @@ class Image
         * Load image metadata from the DB
         */
        function loadFromDB() {
-               global $wgUseSharedUploads, $wgSharedUploadDBname, $wgLang;
+               global $wgUseSharedUploads, $wgSharedUploadDBname, $wgSharedUploadDBprefix, $wgLang;
                $fname = 'Image::loadFromDB';
                wfProfileIn( $fname );
                
@@ -333,7 +333,7 @@ class Image
                        # looking it up in the shared repository.
                        $name = $wgLang->ucfirst($this->name);
 
-                       $row = $dbr->selectRow( "`$wgSharedUploadDBname`.image", 
+                       $row = $dbr->selectRow( "`$wgSharedUploadDBname`.{$wgSharedUploadDBprefix}image",
                                array( 
                                        'img_size', 'img_width', 'img_height', 'img_bits', 
                                        'img_media_type', 'img_major_mime', 'img_minor_mime', 'img_metadata' ),
index d8c0b8c..5808580 100644 (file)
@@ -258,6 +258,7 @@ class ImagePage extends Article {
                $wgOut->addWikiText($sharedtext);
 
                if ($wgRepositoryBaseUrl && $wgFetchCommonsDescriptions) {
+                       require_once("HttpFunctions.php");
                        $ur = ini_set('allow_url_fopen', true);
                        $text = wfGetHTTP($url . '?action=render');
                        ini_set('allow_url_fopen', $ur);