Add new global $wgUseInstantCommons for quick && easy enabling of Commons for 3rd...
authorChad Horohoe <demon@users.mediawiki.org>
Fri, 6 Nov 2009 15:38:47 +0000 (15:38 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Fri, 6 Nov 2009 15:38:47 +0000 (15:38 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/Setup.php

index 116162d..2afa482 100644 (file)
@@ -97,6 +97,8 @@ Hopefully we will remove this configuration var soon)
 * (bug 3340) $wgBlockCIDRLimit added (default: 16) to configure the low end of
   CIDR ranges for blocking
 * Added upload by default to $wgRestrictionTypes
+* $wgUseInstantCommons added for quick and easy enabling of Commons as a remote
+  file repository
 
 === New features in 1.16 ===
 
index 0b3e182..9be4b5c 100644 (file)
@@ -256,6 +256,13 @@ $wgLocalFileRepo = false;
 $wgForeignFileRepos = array();
 /**@}*/
 
+/**
+ * Use Commons as a remote file repository. Essentially a wrapper, when this
+ * is enabled $wgForeignFileRepos will point at Commons with a set of default
+ * settings
+ */
+$wgUseInstantCommons = false;
+
 /**
  * Allowed title characters -- regex character class
  * Don't change this unless you know what you're doing
index 04b9b47..67c52c4 100644 (file)
@@ -128,6 +128,18 @@ if ( $wgUseSharedUploads ) {
                );
        }
 }
+if( $wgUseInstantCommons ) {
+       $wgForeignFileRepos[] = array(
+          'class'                   => 'ForeignAPIRepo',
+          'name'                    => 'wikimediacommons',
+          'apibase'                 => 'http://commons.wikimedia.org/w/api.php',
+          'fetchDescription'        => true,
+          'descriptionCacheExpiry'  => 43200,
+          'apiThumbCacheExpiry'     => 86400,
+       );
+}
+
+
 if ( !class_exists( 'AutoLoader' ) ) {
        require_once( "$IP/includes/AutoLoader.php" );
 }