summaryrefslogtreecommitdiffstats
path: root/modules/xml.pl
diff options
context:
space:
mode:
authorLibravatarJanik Kleinhoff <janik@kleinhoff.de>2015-09-24 01:32:11 +0000
committerLibravatarJanik Kleinhoff <janik@kleinhoff.de>2015-09-24 01:32:11 +0000
commit9b472795d26cd93d1bb58488ef60a062f5237295 (patch)
tree8572778595d145176e720a1b7168c73adbd64ed4 /modules/xml.pl
parentb93c3a24f14e0f64bc46b4945a65ae1bba62dc12 (diff)
Rework module paths
Diffstat (limited to 'modules/xml.pl')
-rw-r--r--modules/xml.pl69
1 files changed, 0 insertions, 69 deletions
diff --git a/modules/xml.pl b/modules/xml.pl
deleted file mode 100644
index 1128dda..0000000
--- a/modules/xml.pl
+++ /dev/null
@@ -1,69 +0,0 @@
-package ASM::XML;
-use warnings;
-use strict;
-
-use XML::Simple qw(:strict);
-use IO::All;
-
-$::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' });
- $::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/]);
- $::mysql = $::xs1->XMLin( "$p/mysql.xml", ForceArray => ['ident', 'geco'],
- 'GroupTags' => { ignoredidents => 'ident', ignoredgecos => 'geco' });
- $::dnsbl = $::xs1->XMLin( "$p/dnsbl.xml", ForceArray => []);
- $::rules = $::xs1->XMLin( "$p/rules.xml", ForceArray => []);
- $::restrictions = $::xs1->XMLin( "$p/restrictions.xml", ForceArray => ['host', 'nick', 'account']);
- $::blacklist = $::xs1->XMLin( "$p/blacklist.xml", ForceArray => 'string');
-}
-
-sub writeXML {
- writeSettings();
- writeChannels();
- writeUsers();
- writeRestrictions();
- writeBlacklist();
- writeMysql();
-# $::xs1->XMLout($::commands, RootName => 'commands', KeyAttr => ['id']) > io("$::cset/commands.xml");
-}
-
-sub writeMysql {
- $::settingschanged=1;
- $::xs1->XMLout($::mysql, RootName => 'mysql', KeyAttr => ['id']) > io("$::cset/mysql.xml");
-}
-
-sub writeChannels {
- $::settingschanged=1;
- $::xs1->XMLout($::channels, RootName => 'channels', KeyAttr => ['id'], NumericEscape => 2) > io("$::cset/channels.xml");
-}
-
-sub writeUsers {
- $::settingschanged=1;
- $::xs1->XMLout($::users, RootName => 'people', KeyAttr => ['id']) > io("$::cset/users.xml");
-}
-
-sub writeSettings {
- $::settingschanged=1;
- $::xs1->XMLout($::settings, RootName => 'settings',
- GroupTags => { altnicks => 'altnick', server => 'host', autojoins => 'autojoin' }, NoAttr => 1) > io("$::cset/settings.xml");
-}
-
-sub writeRestrictions {
- $::settingschanged=1;
- $::xs1->XMLout($::restrictions, RootName => 'restrictions', KeyAttr => ['id'],
- GroupTags => { hosts => "host", nicks => "nick", accounts => "account"}) > io("$::cset/restrictions.xml");
-}
-
-sub writeBlacklist {
- $::settingschanged=1;
- $::xs1->XMLout($::blacklist, RootName => 'blacklist', KeyAttr => ['id'], NumericEscape => 2) > io("$::cset/blacklist.xml");
-}
-
-return 1;