OpusVL::SysParams - Module to handle system wide parameters
Perl Perl 6
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib/OpusVL
mig
t
.gitignore
Changes
Jenkinsfile
MANIFEST.SKIP
README
cpanfile
dist.ini
ignore.txt

README

OpusVL::SysParams - Module to handle system wide parameters

The idea is to allow the storage and retrieval of system wide parameters.  The OpusVL::SysParams is the 
main interface onto this storage and provides simple get/set methods.  This uses a DBIx::Class::Schema
to store the data.  

If you want to integrate this into an existing DBIx::Class Schema you can use a Role to apply to your
schema to inject the necessary tables and a schema level sys_params object.

    # in your schema class.
    with 'OpusVL::SysParams::RolesFor::Schema';
    OpusVL::SysParams::RolesFor::Schema->setup_sysparams(__PACKAGE__);

    # now anywhere that has access to the schema can access the 
    # sys_params object.
    $schema->sys_params->get('param.name'); 

To use it stand alone you can use a regular Catalyst style config file to initialise the schema. 
If the constructor is called without a schema specified it will attempt to load up a schema based
on a config file in the catalyst style for the name 'OpusVL::SysParams'.  This config file should
have a Model::SysParams section containing the config.

    <Model::SysParams>
        connect_info dbi:Pg:dbname=test1
        connect_info user
        connect_info password
    </Model::SysParams>

Note that you must specify at least 2 connect_info parameters even if you are using SQLite otherwise
the code will crash.

Set the environment variable OPUSVL_SYSPARAMS_CONFIG if you want to make sure you know where it will 
pull it's config from.

    $ENV{OPUSVL_SYSPARAMS_CONFIG} = $filename;


INSTALLATION

To install this module, run the following commands:

	perl Makefile.PL
	make
	make test
	make install

LICENSE AND COPYRIGHT

Copyright (C) 2011 OpusVL

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

If you require assistance, support, or further development of this software, please contact OpusVL using the details below:

    Telephone: +44 (0)1788 298 410
    Email: community@opusvl.com
    Web: http://opusvl.com