Kernel::System::SysConfig::XML - Manage system configuration settings in XML.
Create an object. Do not use it directly, instead use:
use Kernel::System::ObjectManager; local $Kernel::OM = Kernel::System::ObjectManager->new(); my $SysConfigXMLObject = $Kernel::OM->Get('Kernel::System::SysConfig::XML');
Parses XML files into a list of perl structures and meta data.
my $PerlStructure = $SysConfigXMLObject->SettingListParse( XMLInput => ' <?xml version="1.0" encoding="utf-8"?> <otrs_config version="2.0" init="Application"> <Setting Name="Test1" Required="1" Valid="1"> <Description Translatable="1">Test 1.</Description> <Navigation>Core::Ticket</Navigation> <Value> <Item ValueType="String" ValueRegex=".*">123</Item> </Value> </Setting> <Setting Name="Test2" Required="1" Valid="1"> <Description Translatable="1">Test 2.</Description> <Navigation>Core::Ticket</Navigation> <Value> <Item ValueType="File">/usr/bin/gpg</Item> </Value> </Setting> </otrs_config> ', XMLFilename => 'Test.xml' );
Returns:
[ { XMLContentParsed => { Description => [ { Content => 'Test.', Translatable => '1', }, ], Name => 'Test', Required => '1', Value => [ { Item => [ { ValueRegex => '.*', ValueType => 'String', Content => '123', }, ], }, ], Navigation => [ { Content => 'Core::Ticket', }, ], Valid => '1', }, XMLContentRaw => '<Setting Name="Test1" Required="1" Valid="1"> <Description Translatable="1">Test 1.</Description> <Navigation>Core::Ticket</Navigation> <Value> <Item ValueType="String" ValueRegex=".*">123</Item> </Value> </Setting>', XMLFilename => 'Test.xml' }, ]
This software is part of the OTRS project (https://otrs.org/).
This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (GPL). If you did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.