From 6fb6c74abf36536e6d5621d93caa1c1556e28afb Mon Sep 17 00:00:00 2001 From: William Heimbigner Date: Mon, 18 Mar 2013 20:49:32 +0000 Subject: Don't use disk-caching of XML; fixed some stuff in the writeXML sub --- modules/xml.pl | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'modules/xml.pl') diff --git a/modules/xml.pl b/modules/xml.pl index e9b96aa..e18e4c4 100644 --- a/modules/xml.pl +++ b/modules/xml.pl @@ -5,12 +5,14 @@ use strict; use XML::Simple qw(:strict); use IO::All; -$::xs1 = XML::Simple->new( KeyAttr => ['id'], Cache => [ qw/storable memcopy/ ]); +$::xs1 = XML::Simple->new( KeyAttr => ['id'], Cache => [ qw/memcopy/ ]); sub readXML { my ( $p ) = $::cset; my @fchan = ( 'event', keys %::RISKS ); - $::settings = $::xs1->XMLin( "$p/settings.xml", ForceArray => ['host'], 'GroupTags' => { altnicks => 'altnick', server => 'host', autojoins => 'autojoin' }); + $::settings = $::xs1->XMLin( "$p/settings.xml", ForceArray => ['host'], + 'GroupTags' => { altnicks => 'altnick', server => 'host', + autojoins => 'autojoin' }); $::channels = $::xs1->XMLin( "$p/channels.xml", ForceArray => \@fchan ); $::users = $::xs1->XMLin( "$p/users.xml", ForceArray => 'person'); $::commands = $::xs1->XMLin( "$p/commands.xml", ForceArray => [qw/command/]); @@ -21,16 +23,11 @@ sub readXML { } sub writeXML { - $::xs1->XMLout($::settings, RootName => 'settings', KeyAttr => ['id'], - GroupTags => { altnicks => 'altnick', server => 'host', autojoins => 'autojoin' }, - ValueAttr => { debug => 'content', nick => 'content', port => 'content', - realname => 'content', username => 'content', dir => 'content', - zone => 'content', filefmt => 'content', timefmt => 'content', - masterchan => 'content', debugchan => 'content'}) > io("$::cset/settings.xml"); + writeSettings(); writeChannels(); writeUsers(); writeRestrictions(); - $::xs1->XMLout($::commands, RootName => 'commands', KeyAttr => ['id']) > io("$::cset/commands.xml"); +# $::xs1->XMLout($::commands, RootName => 'commands', KeyAttr => ['id']) > io("$::cset/commands.xml"); } sub writeChannels { -- cgit v1.2.3