r62738 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62737‎ | r62738 | r62739 >
Date:13:39, 20 February 2010
Author:ialex
Status:deferred
Tags:
Comment:
* Added 'settings-file' option to $wgConfigureAdditionalExtensions (only used in scripts/findSettings.php)
Modified paths:
  • /trunk/extensions/Configure/CHANGELOG (modified) (history)
  • /trunk/extensions/Configure/Configure.php (modified) (history)
  • /trunk/extensions/Configure/scripts/findSettings.php (modified) (history)
  • /trunk/extensions/Configure/settings/Settings-ext.txt (modified) (history)
  • /trunk/extensions/Configure/settings/WebExtension.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Configure/CHANGELOG
@@ -1,6 +1,9 @@
22 This file lists changes on this extension.
33 Localisation updates are done on betawiki and aren't listed here.
44
 5+0.15.12 - 20 February 2010
 6+ Added 'settings-file' option to $wgConfigureAdditionalExtensions.
 7+
58 0.15.11 - 19 February 2010
69 * Added $wgFixArabicUnicode, $wgFixMalayalamUnicode, $wgDebugPrintHttpHeaders,
710 $wgDebugTimestamps, $wgMemCachedTimeout, $wgBlockDisablesLogin,
Index: trunk/extensions/Configure/scripts/findSettings.php
@@ -98,7 +98,7 @@
9999 );
100100 foreach ( $exts as $ext ) {
101101 if( !$ext->isInstalled() ) continue; // must exist
102 - $file = file_get_contents( $ext->getFile() );
 102+ $file = file_get_contents( $ext->getSettingsFile() );
103103 $name = $ext->getName();
104104 $m = array();
105105 preg_match_all( '/\$((wg|eg|edg|sdg|sfg|smwg|srfg|abc|ce[^n]|ub|whoiswatching|wminc)[A-Za-z0-9_]+)\s*\=/', $file, $m );
Index: trunk/extensions/Configure/settings/WebExtension.php
@@ -19,6 +19,7 @@
2020 protected $mInputCallback = null;
2121 protected $mDir;
2222 protected $mFile;
 23+ protected $mSettingsFile;
2324 protected $mDoc;
2425 protected $mExtVar = null;
2526 protected $mObj = null;
@@ -37,6 +38,7 @@
3839 $this->mDbChange = isset( $conf['schema'] ) && $conf['schema'];
3940 $this->mDir = isset( $conf['dir'] ) ? $conf['dir'] : $conf['name'];
4041 $this->mFile = isset( $conf['file'] ) ? $conf['file'] : $conf['name'] . '.php';
 42+ $this->mSettingsFile = isset( $conf['settings-file'] ) ? $conf['settings-file'] : null;
4143 $this->mArrays = isset( $conf['array'] ) ? $conf['array'] : array();
4244 $this->mEmptyValues = isset( $conf['empty'] ) ? $conf['empty'] : array();
4345 $this->mViewRestricted = isset( $conf['view-restricted'] ) ? $conf['view-restricted'] : array();
@@ -161,6 +163,18 @@
162164 }
163165
164166 /**
 167+ * Get the file that contains settings definitions
 168+ *
 169+ * @return String
 170+ */
 171+ public function getSettingsFile() {
 172+ global $wgConfigureExtDir;
 173+
 174+ $file = $this->mSettingsFile !== null ? $this->mSettingsFile : $this->mFile;
 175+ return $wgConfigureExtDir . $this->mDir . '/' . $file;
 176+ }
 177+
 178+ /**
165179 * Prettify boolean settings to be correctly displayed
166180 *
167181 * @return String
Index: trunk/extensions/Configure/settings/Settings-ext.txt
@@ -1017,6 +1017,7 @@
10181018 url = http://www.mediawiki.org/wiki/Extension:WikiAtHome
10191019
10201020 Wikilog
 1021+settings-file = WikilogDefaultSettings.php
10211022 settings[] = wgTaggingEntity: text
10221023 settings[] = wgWikilogStylePath: text
10231024 settings[] = wgWikilogExpensiveLimit: int
Index: trunk/extensions/Configure/Configure.php
@@ -18,7 +18,7 @@
1919 'url' => 'http://www.mediawiki.org/wiki/Extension:Configure',
2020 'description' => 'Allow authorised users to configure the wiki via a web-based interface',
2121 'descriptionmsg' => 'configure-desc',
22 - 'version' => '0.15.11',
 22+ 'version' => '0.15.12',
2323 );
2424
2525 # Configuration part
@@ -81,7 +81,9 @@
8282 * Each value of this array should be an array with the following keys:
8383 * - name: name of the extension (required)
8484 * - dir: dir name of the extension, if different than extension's name
85 - * - file: main file name, if different that name.php
 85+ * - file: main file name, if different than name.php
 86+ * - settings-file: file containing settings definitions, if different than
 87+ * the main file
8688 * - settings: array of settings mapping setting's name to its type
8789 * - array: array type for settings
8890 * - empty: array of overrides for settings values when they match empty()

Status & tagging log