Index: trunk/extensions/Configure/Configure.handler-files.php
===================================================================
--- trunk/extensions/Configure/Configure.handler-files.php (revision 44110)
+++ trunk/extensions/Configure/Configure.handler-files.php (revision 44111)
@@ -33,15 +33,11 @@
# maybe the first time the user use this extensions, do not override
# anything
return array();
- $cont = @file_get_contents( $file );
- if ( empty( $cont ) )
- # Weird, should not happen
- return array();
- $arr = unserialize( $cont );
- if ( !is_array( $arr ) )
+ require($file);
+ if ( !is_array( $settings ) )
# Weird, should not happen too
return array();
- return $arr;
+ return $settings;
}
/**
@@ -57,15 +53,11 @@
# maybe the time the user use this extensions, do not override
# anything
return array();
- $cont = @file_get_contents( $file );
- if ( empty( $cont ) )
- # Weird, should not happen
- return array();
- $arr = unserialize( $cont );
- if ( !is_array( $arr ) )
+ require($file);
+ if ( !is_array( $settings ) )
# Weird, should not happen too
return array();
- return $arr;
+ return $settings;
}
/**
@@ -107,13 +99,13 @@
'reason' => $reason
);
- $cont = serialize( $settings );
+ $cont = '<?php $settings = '.var_export( $settings, true ).";";
@file_put_contents( $arch, $cont );
return ( @file_put_contents( $cur, $cont ) !== false );
}
/**
- * List all archived files that are like conf-{$ts}.ser
+ * List all archived files that are like conf-{$ts}.php
* @return array of timestamps
*/
public function getArchiveVersions() {
@@ -122,9 +114,9 @@
$files = array();
while ( ( $file = readdir( $dir ) ) !== false ) {
- if ( preg_match( '/^conf-(\d{14})\.ser$/', $file, $m ) ) {
+ if ( preg_match( '/^conf-(\d{14})\.php$/', $file, $m ) ) {
## Read the data.
- $settings = unserialize( file_get_contents( $this->mDir."/$file" ) );
+ require( $this->mDir."/$file" );
if (isset( $settings['__metadata'] )) {
$metadata = $settings['__metadata'];
@@ -168,7 +160,7 @@
* @return String full path to the file
*/
protected function getFileName() {
- return "{$this->mDir}conf-now.ser";
+ return "{$this->mDir}conf-now.php";
}
/**
@@ -181,7 +173,7 @@
if ( $ts === null )
$ts = wfTimestampNow();
- $file = "{$this->mDir}conf-$ts.ser";
+ $file = "{$this->mDir}conf-$ts.php";
return $file;
}