r45637 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45636‎ | r45637 | r45638 >
Date:14:58, 10 January 2009
Author:ialex
Status:deferred
Tags:
Comment:
* (bug 16953) Fixed error on Special:Configure and Special:ViewConfig
* Added $wgImplicitGroups to the default list of editable settings
* Enabled extension are no more resetted when after an edit on Special:Configure
* Whitespaces fixes
Modified paths:
  • /trunk/extensions/Configure/CHANGELOG (modified) (history)
  • /trunk/extensions/Configure/Configure.ext.php (modified) (history)
  • /trunk/extensions/Configure/Configure.func.php (modified) (history)
  • /trunk/extensions/Configure/Configure.handler-db.php (modified) (history)
  • /trunk/extensions/Configure/Configure.handler-files.php (modified) (history)
  • /trunk/extensions/Configure/Configure.handler.php (modified) (history)
  • /trunk/extensions/Configure/Configure.obj.php (modified) (history)
  • /trunk/extensions/Configure/Configure.page.php (modified) (history)
  • /trunk/extensions/Configure/Configure.pager-files.php (modified) (history)
  • /trunk/extensions/Configure/Configure.php (modified) (history)
  • /trunk/extensions/Configure/Configure.settings-core.php (modified) (history)
  • /trunk/extensions/Configure/SpecialConfigure.php (modified) (history)
  • /trunk/extensions/Configure/SpecialExtensions.php (modified) (history)
  • /trunk/extensions/Configure/SpecialViewConfig.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Configure/Configure.obj.php
@@ -43,7 +43,7 @@
4444 $this->mOldSettings = $this->settings;
4545 else
4646 $this->settings = $this->mOldSettings;
47 -
 47+
4848 # We'll need to invert the order of keys as SiteConfiguration uses
4949 # $settings[$setting][$wiki] and the extension uses $settings[$wiki][$setting]
5050 foreach ( $this->mConf as $site => $settings ) {
@@ -74,8 +74,10 @@
7575 }
7676 }
7777 }
78 -
 78+
7979 public function snapshotDefaults( /* options */ ) {
 80+ // FIXME: don't hardcode all this stuff here
 81+ static $alwaysSnapshot = array( 'wgGroupPermissions', 'wgImplicitGroups', 'wgAutopromote' );
8082 $options = func_get_args();
8183 $noOverride = in_array( 'no_override', $options );
8284 if( !is_array( $this->mDefaults ) || in_array( 'allow_empty', $options ) ) {
@@ -83,8 +85,9 @@
8486 $this->mDefaults = array();
8587 }
8688 $allSettings = ConfigurationSettings::singleton( CONF_SETTINGS_BOTH )->getEditableSettings();
 89+ $allSettings += array_flip( $alwaysSnapshot );
8790 foreach( $allSettings as $setting => $type ) {
88 - if( array_key_exists( $setting, $GLOBALS ) &&
 91+ if( array_key_exists( $setting, $GLOBALS ) &&
8992 !( $noOverride && array_key_exists( $setting, $this->mDefaults ) ) )
9093 {
9194 $this->mDefaults[$setting] = $GLOBALS[$setting];
@@ -100,7 +103,7 @@
101104 // Include files before so that customized settings won't be overridden
102105 // by the default ones
103106 $this->includeFiles();
104 -
 107+
105108 $this->snapshotDefaults( 'allow_empty', 'no_override' );
106109
107110 list( $site, $lang ) = $this->siteFromDB( $this->mWiki );
@@ -108,9 +111,11 @@
109112 $this->extractAllGlobals( $this->mWiki, $site, $rewrites );
110113 }
111114
112 - public function getIncludedFiles() {
113 - if ( isset( $this->mConf[$this->mWiki]['__includes'] ) )
114 - return $this->mConf[$this->mWiki]['__includes'];
 115+ public function getIncludedFiles( $wiki = null ) {
 116+ if ( is_null( $wiki ) )
 117+ $wiki = $this->mWiki;
 118+ if ( isset( $this->mConf[$wiki]['__includes'] ) )
 119+ return $this->mConf[$wiki]['__includes'];
115120 else
116121 return array();
117122 }
@@ -185,13 +190,13 @@
186191 public function getWikisInVersion( $ts ) {
187192 return $this->getHandler()->getWikisInVersion( $ts );
188193 }
189 -
 194+
190195 /** Recursive doohicky for normalising variables so we can compare them. */
191196 public static function filterVar( $var ) {
192197 if ( empty( $var ) && !$var ) {
193198 return null;
194199 }
195 -
 200+
196201 if ( is_array( $var ) ) {
197202 return array_filter( array_map( array( __CLASS__, 'filterVar' ), $var ) );
198203 }
@@ -237,7 +242,7 @@
238243 $this->initialise( false );
239244 }
240245 }
241 -
 246+
242247 // Hmm, a better solution would be nice!
243248 $savedSettings = $this->settings;
244249 $this->settings = $this->mOldSettings;
Index: trunk/extensions/Configure/Configure.page.php
@@ -124,12 +124,12 @@
125125 */
126126 protected function getSettingValue( $setting ) {
127127 static $defaults;
128 -
 128+
129129 if (!$defaults) {
130130 global $wgConf;
131131 $defaults = $wgConf->getDefaultsForWiki( $this->mWiki );
132132 }
133 -
 133+
134134 if ( isset( $this->conf[$setting] ) ) {
135135 return $this->conf[$setting];
136136 } else {
@@ -312,7 +312,7 @@
313313 if ( $version = $wgRequest->getVal( 'version' ) ) {
314314 if ( $version == 'default' || $wgConf->versionExists( $version ) ) {
315315 $conf = $wgConf->getOldSettings( $version );
316 -
 316+
317317 if ( $version == 'default' ) { ## Hacky special case.
318318 $conf[$this->mWiki] = $conf['default'];
319319 }
@@ -573,20 +573,20 @@
574574 }
575575 }
576576 }
577 -
 577+
578578 break;
579579 case 'rate-limits':
580580 $all = array();
581581 ## TODO put this stuff in a central place.
582582 $validActions = array( 'edit', 'move', 'mailpassword', 'emailuser', 'rollback' );
583583 $validGroups = array( 'anon', 'user', 'newbie', 'ip', 'subnet' );
584 -
 584+
585585 foreach( $validActions as $action ) {
586586 $all[$action] = array();
587587 foreach( $validGroups as $group ) {
588588 $count = $wgRequest->getIntOrNull( "wp$name-key-$action-$group-count" );
589589 $period = $wgRequest->getIntOrNull( "wp$name-key-$action-$group-period" );
590 -
 590+
591591 if ($count && $period) {
592592 $all[$action][$group] = array( $count, $period );
593593 } else {
@@ -594,7 +594,7 @@
595595 }
596596 }
597597 }
598 -
 598+
599599 $settings[$name] = $all;
600600 break;
601601 case 'promotion-conds':
@@ -619,7 +619,7 @@
620620 if ( empty( $op ) ) {
621621 $op = 'and';
622622 }
623 -
 623+
624624 if( !isset( $options[$op] ) )
625625 throw new MWException( "'{$op}' for group '{$group}' is not a valid operator for 'promotion-conds' type" );
626626 $op = $options[$op];
@@ -651,7 +651,7 @@
652652 foreach( $val as $reqGroup )
653653 if( $reqGroup )
654654 $reqGroups[] = $reqGroup;
655 -
 655+
656656 if( count( $reqGroups ) )
657657 $condsVal[] = array_merge( array( $condName ), $reqGroups );
658658 }
@@ -668,14 +668,14 @@
669669 case 'lang':
670670 case 'image-url':
671671 $setting = $wgRequest->getVal( 'wp' . $name );
672 -
 672+
673673 if ( $file = wfFindFile( $setting ) ) {
674674 ## It's actually a local file.
675675 $setting = $file->getUrl();
676676 }
677 -
 677+
678678 $settings[$name] = $setting;
679 -
 679+
680680 break;
681681 case 'int':
682682 $settings[$name] = $wgRequest->getInt( 'wp' . $name );
@@ -719,7 +719,7 @@
720720 if (!empty($val) || $val) {
721721 return $val;
722722 }
723 -
 723+
724724 static $list = null;
725725 if ( $list === null )
726726 $list = $this->mConfSettings->getEmptyValues();
@@ -727,7 +727,7 @@
728728 static $defaults = null;
729729 if ($defaults === null)
730730 $defaults = $wgConf->getDefaultsForWiki( $this->mWiki );
731 -
 731+
732732 if ( array_key_exists( $name, $list ) ) {
733733 return $list[$name];
734734 } elseif ( !array_key_exists( $name, $defaults ) ) {
@@ -817,7 +817,7 @@
818818 global $wgOut, $wgUser, $wgRequest;
819819
820820 $action = $this->getTitle()->escapeLocalURL();
821 -
 821+
822822 $reason = $wgRequest->getText( 'wpReason' );
823823
824824 $wgOut->addHTML(
@@ -853,7 +853,7 @@
854854 );
855855 $this->injectScriptsAndStyles();
856856 }
857 -
 857+
858858 /** Show a hidden-by-default search form */
859859 protected function buildSearchForm() {
860860 $form = wfMsgExt( 'configure-js-search-prompt', 'parseinline' ) . ' ' . Xml::element( 'input', array( 'id' => 'configure-search-input', 'size' => 45 ) );
@@ -883,7 +883,7 @@
884884 $biglist_hide = Xml::encodeJsVar( wfMsg( 'configure-js-biglist-hide' ) );
885885 $summary_none = Xml::encodeJsVar( wfMsg( 'configure-js-summary-none' ) );
886886 $throttle_summary = Xml::encodeJsVar( wfMsg( 'configure-throttle-summary' ) );
887 -
 887+
888888 $ajax = isset( $wgUseAjax ) && $wgUseAjax ? 'true' : 'false';
889889 $script = array(
890890 "<script type=\"$wgJsMimeType\">/*<![CDATA[*/",
@@ -1087,32 +1087,33 @@
10881088 if ( $type == 'rate-limits' ) { ## Some of this is stolen from assoc, since it's an assoc with an assoc.
10891089 $keydesc = wfMsgExt( "configure-setting-$conf-key", 'parseinline' );
10901090 $valdesc = wfMsgExt( "configure-setting-$conf-value", 'parseinline' );
1091 -
 1091+
10921092 if ( wfEmptyMsg( "configure-setting-$conf-key", $keydesc ) )
10931093 $keydesc = wfMsgHtml( 'configure-desc-key' );
10941094 if ( wfEmptyMsg( "configure-setting-$conf-value", $valdesc ) )
10951095 $valdesc = wfMsgHtml( 'configure-desc-val' );
1096 -
 1096+
10971097 $classes = array( 'configure-array-table', 'configure-rate-limits' );
10981098
10991099 if ( !$allowed )
11001100 $classes[] = 'disabled';
1101 -
 1101+
11021102 $rows = Xml::tags( 'tr', null, Xml::tags( 'th', null, $keydesc ) . " " . Xml::tags( 'th', null, $valdesc ) )."\n";
1103 -
 1103+
11041104 # TODO put this stuff in one place.
11051105 $validActions = array( 'edit', 'move', 'mailpassword', 'emailuser', 'rollback' );
11061106 $validGroups = array( 'anon', 'user', 'newbie', 'ip', 'subnet' );
1107 -
 1107+
11081108 foreach( $validActions as $action ) {
11091109 $val = array();
11101110 if ( isset( $default[$action] ) )
11111111 $val = $default[$action];
1112 -
 1112+
11131113 $key = Xml::tags( 'td', null, wfMsgExt( "configure-throttle-action-$action", 'parseinline' ) );
1114 -
 1114+
11151115 ## Build YET ANOTHER ASSOC TABLE ARGH!
1116 - $innerRows = Xml::tags( 'tr', null, Xml::tags( 'th', null, wfMsgExt( 'configure-throttle-group', 'parseinline' ) ) . ' ' . Xml::tags( 'th', null, wfMsgExt( 'configure-throttle-limit', 'parseinline' ) ) )."\n";
 1116+ $innerRows = Xml::tags( 'tr', null, Xml::tags( 'th', null, wfMsgExt( 'configure-throttle-group', 'parseinline' ) ) . ' ' .
 1117+ Xml::tags( 'th', null, wfMsgExt( 'configure-throttle-limit', 'parseinline' ) ) )."\n";
11171118 foreach( $validGroups as $type ) {
11181119 $limits = null;
11191120 if ( isset( $default[$action][$type] ) )
@@ -1121,10 +1122,10 @@
11221123 list( $count, $period ) = $limits;
11231124 else
11241125 $count = $period = 0;
1125 -
 1126+
11261127 $id = 'wp'.$conf.'-key-'.$action.'-'.$type;
11271128 $left_col = Xml::tags( 'td', null, wfMsgExt( "configure-throttle-group-$type", 'parseinline' ) );
1128 -
 1129+
11291130 if ( $allowed ) {
11301131 $right_col = Xml::inputLabel( wfMsg( 'configure-throttle-count' ), "$id-count", "$id-count", 15, $count ) . ' <br /> ' .
11311132 Xml::inputLabel( wfMsg( 'configure-throttle-period' ), "$id-period", "$id-period", 15, $period );
@@ -1134,14 +1135,14 @@
11351136 $right_col .= "\n" . Xml::hidden( "$id-count", $count, array( 'id' => "$id-count" ) ) . Xml::hidden( "$id-period", $period, array( 'id' => "$id-period" ) );
11361137 }
11371138 $right_col = Xml::tags( 'td', null, $right_col );
1138 -
 1139+
11391140 $innerRows .= Xml::tags( 'tr', array( 'id' => $id ), $left_col . $right_col ) . "\n";
11401141 }
1141 -
 1142+
11421143 $value = Xml::tags( 'td', null, Xml::tags( 'table', array( 'class' => 'configure-biglist configure-rate-limits-action' ), Xml::tags( 'tbody', null, $innerRows ) ) );
11431144 $rows .= Xml::tags( 'tr', null, $key.$value )."\n";
11441145 }
1145 -
 1146+
11461147 return Xml::tags( 'table', array( 'class' => implode( ' ', $classes ) ), Xml::tags( 'tbody', null, $rows ) );
11471148 }
11481149 if ( $type == 'simple-dual' ) {
@@ -1319,24 +1320,24 @@
13201321 static $options = array( 'or' => '|', 'and' => '&', 'xor' => '^', 'not' => '!' );
13211322 static $conds = array( APCOND_EDITCOUNT => 'int', APCOND_AGE => 'int', APCOND_EMAILCONFIRMED => 'bool',
13221323 APCOND_INGROUPS => 'array', APCOND_ISIP => 'text', APCOND_IPINRANGE => 'text' );
1323 -
 1324+
13241325 $row = '<div class="configure-biglist promotion-conds-element">';
13251326 $row .= wfMsgHtml( 'configure-condition-operator' ) . ' ';
13261327 $encConf = htmlspecialchars( $conf );
13271328 $encGroup = htmlspecialchars( $group );
13281329 $encId = 'wp'.$encConf.'-'.$encGroup;
13291330 $curOpt = is_array( $groupConds ) ? array_shift( $groupConds ) : '&';
1330 -
 1331+
13311332 if ( empty($curOpt) )
13321333 $curOpt = '&';
1333 -
 1334+
13341335 $extra = $allowed ? array() : array( 'disabled' => 'disabled' );
13351336 foreach ( $options as $desc => $opt ) {
13361337 $row .= Xml::radioLabel( wfMsg( 'configure-condition-operator-'.$desc ), $encId.'-opt', $desc,
13371338 $encId.'-opt-'.$desc, $curOpt == $opt, $extra ) . "\n";
13381339 }
13391340 $row .= "<br />\n";
1340 -
 1341+
13411342 if ( !is_array( $groupConds ) )
13421343 $groupConds = array( $groupConds );
13431344
@@ -1413,7 +1414,7 @@
14141415 $id = Sanitizer::escapeId( 'wp' . $conf . '-' . $group . '-' . $right );
14151416 if( $type == 'group-bool' )
14161417 $desc = User::getRightDescription( $right ) . " (" .Xml::element( 'tt', array( 'class' => 'configure-right-id' ), $right ) . ")";
1417 - else
 1418+ else
14181419 $desc = User::getGroupName( $right );
14191420 $row .= '<li>' . Xml::check( $id, $checked, $attr + array( 'id' => $id ) ) . '&nbsp;' . Xml::tags( 'label', array( 'for' => $id ), $desc ) . "</li>\n";
14201421 }
@@ -1430,9 +1431,9 @@
14311432 */
14321433 protected function buildTableRow( $conf, $params ) {
14331434 global $wgContLang;
1434 -
 1435+
14351436 $rowClasses = array();
1436 -
 1437+
14371438 if ( $params['customised'] )
14381439 $rowClasses[] = 'configure-customised';
14391440
@@ -1455,15 +1456,15 @@
14561457 $msgVal = $link;
14571458 else
14581459 $msgVal = "$msgVal ($link)";
1459 -
 1460+
14601461 if ( $params['customised'] )
14611462 $msgVal = Xml::tags( 'p', null, $msgVal ).wfMsgExt( 'configure-customised', 'parse' );
14621463 $attribs['class'] = 'configure-left-column';
14631464 $td1 = Xml::tags( 'td', $attribs, $msgVal );
1464 -
 1465+
14651466 ## Only the class is customised per-cell, so we'll just redefine that.
14661467 $attribs['class'] = 'configure-right-column';
1467 -
 1468+
14681469 $td2 = Xml::tags( 'td', $attribs, $this->buildInput( $conf, $params ) );
14691470
14701471 return Xml::tags( 'tr', array( 'class' => implode( ' ', $rowClasses ) ), $td1 . $td2 ) . "\n";
@@ -1478,7 +1479,7 @@
14791480 */
14801481 protected function buildSettings( $settings, $param = array() ) {
14811482 wfLoadExtensionMessages( 'ConfigureSettings' );
1482 -
 1483+
14831484 global $wgConf;
14841485 $defaults = $wgConf->getDefaultsForWiki( $this->mWiki );
14851486
@@ -1540,9 +1541,9 @@
15411542
15421543 $customised = !array_key_exists( $setting, $defaults );
15431544 $customised = $customised || ( WebConfiguration::filterVar( $defaults[$setting] ) != WebConfiguration::filterVar( $params['value'] ) );
1544 -
 1545+
15451546 $params['customised'] = $customised;
1546 -
 1547+
15471548 $show = $this->mCanEdit ?
15481549 ( isset( $params['edit'] ) ? $params['edit'] : $this->userCanEdit( $setting ) ) :
15491550 ( isset( $params['read'] ) ? $params['read'] : $this->userCanRead( $setting ) );
Index: trunk/extensions/Configure/Configure.handler-files.php
@@ -58,10 +58,10 @@
5959 if ( !is_array( $settings ) )
6060 # Weird, should not happen too
6161 return array();
62 -
 62+
6363 if ( isset( $settings['__metadata'] ) )
6464 unset( $settings['__metadata'] );
65 -
 65+
6666 return $settings;
6767 }
6868
@@ -94,17 +94,17 @@
9595 */
9696 public function saveNewSettings( $settings, $wiki, $ts = false, $reason = '' ) {
9797 global $wgUser;
98 -
 98+
9999 $arch = $this->getArchiveFileName();
100100 $cur = $this->getFileName();
101 -
 101+
102102 ## Add meta-data
103103 $settings['__metadata'] = array(
104104 'user_wiki' => wfWikiID(),
105105 'user_name' => $wgUser->getName(),
106106 'reason' => $reason
107107 );
108 -
 108+
109109 $cont = '<?php $settings = '.var_export( $settings, true ).";";
110110 @file_put_contents( $arch, $cont );
111111 return ( @file_put_contents( $cur, $cont ) !== false );
@@ -118,19 +118,19 @@
119119 if ( !$dir = opendir( $this->mDir ) )
120120 return array();
121121 $files = array();
122 -
 122+
123123 while ( ( $file = readdir( $dir ) ) !== false ) {
124124 if ( preg_match( '/^conf-(\d{14})\.php$/', $file, $m ) ) {
125125 ## Read the data.
126126 require( $this->mDir."/$file" );
127 -
 127+
128128 if( isset( $options['wiki'] ) && !isset( $settings[$options['wiki']] ) )
129129 continue;
130 -
 130+
131131 if ( isset( $settings['__metadata'] ) ) {
132132 $metadata = $settings['__metadata'];
133 -
134 - $files[$m[1]] = array( 'username' => $metadata['user_name'],
 133+
 134+ $files[$m[1]] = array( 'username' => $metadata['user_name'],
135135 'userwiki' => $metadata['user_wiki'], 'reason' => $metadata['reason'], 'timestamp' => $m[1] );
136136 } else {
137137 $files[$m[1]] = array( 'username' => false, 'userwiki' => false, 'reason' => false, 'timestamp' => $m[1] );
@@ -205,17 +205,17 @@
206206 */
207207 public function getArchiveFileName( $ts = null ) {
208208 $ts_orig = $ts;
209 -
 209+
210210 if ( $ts === null )
211211 $ts = wfTimestampNow();
212212
213213 $file = "{$this->mDir}conf-$ts.php";
214 -
 214+
215215 ## Hack hack hack
216216 ## Basically, if the file already exists, pretend that the setting change was made in a second's time.
217217 if ( $ts_orig === null && file_exists( $file ) )
218218 return $this->getArchiveFileName( $ts+1 );
219 -
 219+
220220 return $file;
221221 }
222222
Index: trunk/extensions/Configure/SpecialViewConfig.php
@@ -32,11 +32,11 @@
3333 $versions = $wgConf->listArchiveVersions();
3434 if ( in_array( $version, $versions ) || $version == 'default' ) {
3535 $conf = $wgConf->getOldSettings( $version );
36 -
 36+
3737 if ($version == 'default') { ## Yucky special case.
3838 $conf[$this->mWiki] = $conf['default'];
3939 }
40 -
 40+
4141 if ( $this->isUserAllowedAll() ) {
4242 $wiki = $wgRequest->getVal( 'wiki', $wgConf->getWiki() );
4343 } else {
@@ -176,7 +176,7 @@
177177
178178 extract( $this->formatConf );
179179 $time = $wgLang->timeAndDate( $ts );
180 -
 180+
181181 ## Make user link...
182182 $userLink = '';
183183 if (!$arr['user_wiki'] && !$arr['user_name'] ) {
@@ -254,14 +254,14 @@
255255 Xml::element( 'input', array_merge(
256256 array( 'type' => 'radio', 'name' => 'version', 'value' => $ts ),
257257 $versionCheck ) );
258 -
 258+
259259 $actions[] = $skin->link( $this->getTitle(), wfMsgHtml( 'configure-viewconfig-default-diff' ), array(), array( 'version' => $ts, 'diff' => 'default' ) );
260260 } else {
261261 $buttons = '';
262262 }
263 -
 263+
264264 $comment = $arr['reason'] ? $skin->commentBlock( $arr['reason'] ) : '';
265 -
 265+
266266 $action = implode( ', ', $actions );
267267 return Xml::tags( 'li', null, wfMsgExt( 'configure-viewconfig-line', array( 'parseinline', 'replaceafter' ), array( $buttons, $time, $userLink, $action, $comment ) ) )."\n";
268268 }
@@ -281,7 +281,7 @@
282282 $form .= Xml::radioLabel( wfMsg( 'configure-select-wiki-view-all' ), 'view', 'all', 'wiki-all', $all );
283283 $form .= "<br />\n";
284284 $form .= Xml::radioLabel( wfMsg( 'configure-select-wiki-view-specific' ), 'view', 'specific', 'wiki-specific', !$all ) . ' ';
285 -
 285+
286286 if ( is_array( $wgConfigureWikis ) ) {
287287 $selector = new XmlSelect( 'wiki', 'wiki', $this->mWiki );
288288 foreach( $wgConfigureWikis as $wiki ) {
@@ -291,7 +291,7 @@
292292 } else {
293293 $form .= Xml::input( 'wiki', false, $this->mWiki )."<br/>";
294294 }
295 -
 295+
296296 $form .= Xml::submitButton( wfMsg( 'configure-select-wiki-submit' ) );
297297 $form .= '</form></fieldset>';
298298 return $form;
Index: trunk/extensions/Configure/CHANGELOG
@@ -5,6 +5,10 @@
66 * Added support for Redirect
77 * Fixed Special:Extensions: was sometimes throwing an error when saving the
88 configuration
 9+ * (bug 16953) Fixed error on Special:Configure and Special:ViewConfig
 10+ * Added $wgImplicitGroups to the default list of editable settings
 11+ * Enabled extension are no more resetted when after an edit on
 12+ Special:Configure
913
1014 0.11.6 - 7 January 2009
1115 * Added support for OpenID, NewUserMessage and ReplaceText extensions.
Index: trunk/extensions/Configure/Configure.ext.php
@@ -187,12 +187,12 @@
188188 }
189189
190190 /**
191 - * Whether this extension
 191+ * Whether this extension
192192 */
193193 public function useVariable(){
194194 return !is_null( $this->mExtVar );
195195 }
196 -
 196+
197197 /**
198198 * Get the variable for this extension
199199 */
Index: trunk/extensions/Configure/Configure.handler-db.php
@@ -207,15 +207,15 @@
208208 */
209209 protected function saveSettingsForWiki( $settings, $wiki, $ts, $reason = '' ) {
210210 global $wgUser;
211 -
 211+
212212 $dbw = $this->getMasterDB();
213213 if ( !$ts )
214214 $ts = wfTimestampNow();
215 -
 215+
216216 ## Look for dupes
217217 if ($this->versionExists( $ts ))
218218 $this->saveSettingsForWiki( $settings, $wiki, $ts+1, $reason );
219 -
 219+
220220 $dbw->begin();
221221 $dbw->insert( 'config_version',
222222 array(
Index: trunk/extensions/Configure/Configure.php
@@ -129,10 +129,10 @@
130130 'wgSitename', 'wgLogo', 'wgContentNamespaces', 'wgMetaNamespace', 'wgMetaNamespaceTalk',
131131 'wgNamespaceAliases', 'wgNamespaceProtection', 'wgNamespaceRobotPolicies', 'wgNamespacesToBeSearchedDefault',
132132 'wgNamespacesToBeSearchedProject', 'wgNamespacesWithSubpages', 'wgNoFollowNsExceptions', 'wgNonincludableNamespaces',
133 - 'wgSitemapNamespaces', 'wgAutopromote', 'wgGroupPermissions', 'wgAddGroups', 'wgRemoveGroups', 'wgGroupsAddToSelf',
134 - 'wgGroupsRemoveFromSelf', 'wgArticleRobotPolicies', 'wgCapitalLinks', 'wgDefaultLanguageVariant', 'wgExtraSubtitle',
135 - 'wgImportSources', 'wgRateLimits', 'wgAutoConfirmAge', 'wgAutoConfirmCount', 'wgMaxSigChars', 'wgExtraNamespaces',
136 - 'wgLocaltimezone', 'wgExemptFromUserRobotsControl',
 133+ 'wgSitemapNamespaces', 'wgAutopromote', 'wgGroupPermissions', 'wgImplicitGroups', 'wgAddGroups', 'wgRemoveGroups',
 134+ 'wgGroupsAddToSelf', 'wgGroupsRemoveFromSelf', 'wgArticleRobotPolicies', 'wgCapitalLinks', 'wgDefaultLanguageVariant',
 135+ 'wgExtraSubtitle', 'wgImportSources', 'wgRateLimits', 'wgAutoConfirmAge', 'wgAutoConfirmCount', 'wgMaxSigChars',
 136+ 'wgExtraNamespaces', 'wgLocaltimezone', 'wgExemptFromUserRobotsControl',
137137 );
138138
139139 /**
Index: trunk/extensions/Configure/Configure.handler.php
@@ -69,7 +69,7 @@
7070 * @return Array of versions
7171 */
7272 public function listArchiveVersions( $options = array() );
73 -
 73+
7474 /**
7575 * Return a bool whether the version exists
7676 *
Index: trunk/extensions/Configure/SpecialExtensions.php
@@ -31,7 +31,7 @@
3232 $new = $this->removeDefaults( $new );
3333 $new['__includes'] = $this->getRequiredFiles();
3434 $ok = $wgConf->saveNewSettings( $new, $this->mWiki, $reason );
35 -
 35+
3636 $result = $ok ? 'success' : 'failure';
3737
3838 $url = $this->getTitle()->getLocalURL( "result=$result" );
@@ -100,7 +100,7 @@
101101 if ( !$globalDone ) {
102102 extract( $GLOBALS, EXTR_REFS );
103103 global $wgHooks;
104 -
 104+
105105 $oldHooks = $wgHooks;
106106 $globalDone = true;
107107 }
Index: trunk/extensions/Configure/Configure.settings-core.php
@@ -883,7 +883,7 @@
884884 'wgSearchForwardUrl' => null,
885885 'wgExemptFromUserRobotsControl' => null,
886886 'wgArticlePath' => false,
887 -
 887+
888888 );
889889
890890 /**
Index: trunk/extensions/Configure/Configure.func.php
@@ -70,9 +70,9 @@
7171 $wgConf->settings = $oldConf->settings;
7272 $wgConf->localVHosts = $oldConf->localVHosts;
7373 $wgConf->siteParamsCallback = $oldConf->siteParamsCallback;
74 -
 74+
7575 $wgConf->snapshotDefaults();
76 -
 76+
7777 global $wgConfigureHandler;
7878 if ( $wgConfigureHandler == 'db' ) {
7979 // Defer to after caches and database are set up.
Index: trunk/extensions/Configure/Configure.pager-files.php
@@ -21,7 +21,7 @@
2222 $ret = array();
2323 if( $this->mWiki )
2424 $ret['wiki'] = $this->mWiki;
25 - return $ret;
 25+ return $ret;
2626 }
2727
2828 function getBody() {
Index: trunk/extensions/Configure/SpecialConfigure.php
@@ -29,6 +29,8 @@
3030 if( isset( $current[$name] ) )
3131 $settings[$name] = $current[$name];
3232 }
 33+ ## Also save activated extensions :)
 34+ $settings['__includes'] = $wgConf->getIncludedFiles( $this->mWiki );
3335
3436 $settings = $this->removeDefaults( $settings );
3537 if ( $wgConfigureUpdateCacheEpoch )

Follow-up revisions

RevisionCommit summaryAuthorDate
r45638backport r45637ialex15:04, 10 January 2009

Status & tagging log