Nile::Config - Configuration file manager.
# get the app config object $config = $self->app->config; # get a new config object $config = $self->app->config->new; # 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);
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.
This project is available on github at https://github.com/mewsoft/Nile.
Please visit the project's homepage at https://metacpan.org/release/Nile.
Source repository is at https://github.com/mewsoft/Nile.
See Nile for details about the complete framework.
Ahmed Amin Elsheshtawy, احمد امين الششتاوى <mewsoft@cpan.org> Website: http://www.mewsoft.com
Copyright (C) 2014-2015 by Dr. Ahmed Amin Elsheshtawy احمد امين الششتاوى mewsoft@cpan.org, support@mewsoft.com, https://github.com/mewsoft/Nile, http://www.mewsoft.com
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Nile, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Nile
CPAN shell
perl -MCPAN -e shell install Nile
For more information on module installation, please visit the detailed CPAN module installation guide.