r44124 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44123‎ | r44124 | r44125 >
Date:18:35, 1 December 2008
Author:ialex
Status:ok
Tags:
Comment:
* CHANGELOG entry and bump version
* quick script migrateFiles.php for b/c
Modified paths:
  • /trunk/extensions/Configure/CHANGELOG (modified) (history)
  • /trunk/extensions/Configure/Configure.php (modified) (history)
  • /trunk/extensions/Configure/migrateFiles.php (added) (history)

Diff [purge]

Index: trunk/extensions/Configure/CHANGELOG
@@ -1,6 +1,13 @@
22 This file lists changes on this extension.
33 Localisation updates are done on betawiki and aren't listed here.
44
 5+0.10.11 - 1 December 2008
 6+ * New reason field in Special:Configure and Special:Extension to allow users
 7+ to put a comment for each version
 8+ * File handler now uses PHP files instead of serialized files.
 9+ NOTE FOR PEOPLE USING FILES HANDLER: OLD SERIALIZED WON'T WORK ANYMORE IN
 10+ THIS VERSION, PLEASE RUN THE migrateFiles.php SCRIPT.
 11+
512 0.10.10 - 30 November 2008
613 * Editable settings are now restricted by default to some settings, if you
714 want to have all of them, set $wgConfigureEditableSettings = array(); in
Index: trunk/extensions/Configure/migrateFiles.php
@@ -0,0 +1,40 @@
 2+<?php
 3+
 4+/**
 5+ * Maintenance script that migrate configuration from serialzed file to plain
 6+ * PHP, for security
 7+ *
 8+ * @file
 9+ * @ingroup Extensions
 10+ * @author Alexandre Emsenhuber
 11+ * @license GPLv2 or higher
 12+ */
 13+
 14+$IP = getenv( 'MW_INSTALL_PATH' );
 15+if ( $IP === false )
 16+ $IP = dirname( __FILE__ ) . '/../..';
 17+
 18+require_once( "$IP/maintenance/commandLine.inc" );
 19+
 20+$handler = new ConfigureHandlerFiles();
 21+$dir = $handler->getDir();
 22+
 23+if ( !$dirObj = opendir( $dir ) ) {
 24+ fwrite( STDERR, "The directory '$dir' doesn't exist, aborting.\n" );
 25+ exit;
 26+}
 27+
 28+while ( ( $file = readdir( $dirObj ) ) !== false ) {
 29+ if ( preg_match( '/^conf-(\d{14})\.ser$/', $file, $m ) || $file == 'conf-now.ser' ) {
 30+ $old = "$dir/$file";
 31+ $new = substr( $old, 0, -3 ) . 'php';
 32+
 33+ $settings = unserialize( file_get_contents( $old ) );
 34+ $cont = '<?php $settings = '.var_export( $settings, true ).";";
 35+
 36+ file_put_contents( $new, $cont );
 37+ fwrite( STDOUT, "$file done\n" );
 38+ }
 39+}
 40+
 41+fwrite( STDOUT, "complete. Please delete all the files listed above for security.\n" );
Property changes on: trunk/extensions/Configure/migrateFiles.php
___________________________________________________________________
Added: svn:eol-style
142 + native
Index: trunk/extensions/Configure/Configure.php
@@ -17,7 +17,7 @@
1818 'url' => 'http://www.mediawiki.org/wiki/Extension:Configure',
1919 'description' => 'Allow authorised users to configure the wiki via a web-based interface',
2020 'descriptionmsg' => 'configure-desc',
21 - 'version' => '0.10.10',
 21+ 'version' => '0.10.11',
2222 );
2323
2424 # Configuration part
@@ -147,7 +147,7 @@
148148 /**
149149 * Styles versions, you shouldn't change it
150150 */
151 -$wgConfigureStyleVersion = '12';
 151+$wgConfigureStyleVersion = '13';
152152
153153 # Adding new rights...
154154 $wgAvailableRights[] = 'configure';

Status & tagging log