NAME
Nile::Config - Configuration file manager.
SYNOPSIS
$config = $self->me->config;
# keep sort order when reading and writing the xml file data. default is off.
#$config->keep_order(1);
# load config file from the configuration folder, file extension is xml.
$config->load("config");
# load and append another configuration file
$config->add_file("admins");
# get config variables
say $config->get("admin/user");
say $config->get("admin/password");
# get config variable, if not found return the optional provided default value.
$var = $config->get($name, $default);
# automatic getter support
say $config->email; # same as $config->get('email');
# get a group of config variables.
@list = $config->list(@names);
# delete config variables from memory, changes will apply when saving file.
$config->delete(@names);
# set config variables.
$config->set("admin", 'username');
$config->set(%vars);
# automatic setter support
$config->email('ahmed@mewsoft.com'); # same as $config->set('email', 'ahmed@mewsoft.com');
# save changes to file.
$config->save();
# write to another output file.
$config->save($file);
DESCRIPTION
Nile::Config - Configuration file manager.
Configuration files are xml files stored in the application config folder. You can load and manage any number of configuration files.
This class extends Nile::XML class, therefore all methods from Nile::XML is accessable to this object.
object()
# get a new config object
#my $configure = $config->object;
# load and manage a language files separately
#$configure->load("configuration");
Returns a new config object. This allows to load individual config files and work with them.