XML::Simple or YAML for read config files ?
Hi to all, I have to define a configuration file for Koha. Which perl module do we want to prefer for config files ? YAML (like system prefences) or XML::Simple (like koha-conf.xml) ? Cheers Zeno Tajoli -- Dr. Zeno Tajoli Dipartimento Gestione delle Informazioni e della Conoscenza z.tajoli@cineca.it fax +39 02 2135520 CINECA - Sede operativa di Segrate
Hi, On Sat, Sep 21, 2013 at 7:50 AM, Zeno Tajoli <z.tajoli@cineca.it> wrote:
I have to define a configuration file for Koha. Which perl module do we want to prefer for config files ? YAML (like system prefences) or XML::Simple (like koha-conf.xml) ?
Well, the choice seems to be YAML vs. XML as file formats -- there are much better XML parsers than XML::Simple available. JSON would be an option as well, though not the most friendly. Ditto for Perl-as-config-file-format. One downside of YAML is that it can be a bit too sensitive to mistakes in whitespace. The nit about XML processors aside, how complicated is the structure of the configuration data you need to express? And how frequently would a human need to look at it? If the configuration you need to express boils down to a hash map, I suggestion a simple key-value format such as a properties file or even an INI file. Also, is there anything preventing the configuration from living in the database? Regards, Galen -- Galen Charlton Manager of Implementation Equinox Software, Inc. / The Open Source Experts email: gmc@esilibrary.com direct: +1 770-709-5581 cell: +1 404-984-4366 skype: gmcharlt web: http://www.esilibrary.com/ Supporting Koha and Evergreen: http://koha-community.org & http://evergreen-ils.org
Hi to all, Il 21/09/2013 19:30, Galen Charlton ha scritto:
The nit about XML processors aside, how complicated is the structure of the configuration data you need to express? And how frequently would a human need to look at it? If the configuration you need to express boils down to a hash map, I suggestion a simple key-value format such as a properties file or even an INI file.
Also, is there anything preventing the configuration from living in the database?
the structure to express is not much complex, it is a configuration for solr, to browse indexes. The config is called every time a specific opac page is called. With this request, probably I have two options: -- Insert a specific section in koha-conf.xml -- Create a new table for config. It is impossible to use a system preference. I think that for Plack those are the option, I can't use a file on file system. Between YAML and XML I prefer XML, you need to see it, to edit it and it is connect with solr config that is done wit XML. Bye Zeno Tajoli -- Dr. Zeno Tajoli Dipartimento Gestione delle Informazioni e della Conoscenza z.tajoli@cineca.it fax +39 02 2135520 CINECA - Sede operativa di Segrate
Hi, On Mon, Sep 23, 2013 at 6:44 AM, Zeno Tajoli <z.tajoli@cineca.it> wrote:
-- Create a new table for config. It is impossible to use a system preference.
That would be my preference -- a database table with a well-designed user interface for populating it would likely be easier for an average user as opposed to directly exposing YAML or XML. Regards, Galen -- Galen Charlton Manager of Implementation Equinox Software, Inc. / The Open Source Experts email: gmc@esilibrary.com direct: +1 770-709-5581 cell: +1 404-984-4366 skype: gmcharlt web: http://www.esilibrary.com/ Supporting Koha and Evergreen: http://koha-community.org & http://evergreen-ils.org
participants (2)
-
Galen Charlton -
Zeno Tajoli