Andrew Maltsev
and 1 contributors


XAO::DO::FS::Config - embeddable configuration object for XAO::FS


 use XAO::Projects;
 use XAO::Objects;

 my $config=XAO::Objects->new(objname => 'Config',
                              sitename => 'test');

 XAO::Projects::create_project(name => 'test',
                               object => $config,
                               set_current => 1);

 my $fsconfig=XAO::Objects->new(objname => 'FS::Config',
                                odb_args => {
                                    dsn => 'OS:MySQL_DBI:test_os'
                                    user => 'test',
                                    password => 'TeSt',

 $config->embed(fs => $fsconfig);

 my $odb=$config->odb();


The XAO::DO::FS::Config is normally used in larger projects configurations that are persistent in memory. See XAO::DO::Config for more information on how embeddable configuration objects work.


cleanup ()

Calls reset() method on the odb to clean up the handler and prepare it for the next session.

disable_special_access ()

Disables use of odb() method to set a new value (this is the default state).

embeddable_methods ()

Used internally by global Config object, returns an array with embeddable method names. Currently there is only one embeddable method -- odb().

enable_special_access ()

Enables use of odb() method to set a new value. Normally you do not need this method.


new ($$)

Creates a new empty configuration object. If odb_args is given then it will connect to a database using these arguments.


 my $fsconfig=XAO::Objects->new(objname => 'FS::Config',
                                odb_args => {
                                    dsn => 'OS:MySQL_DBI:test_os'
                                    user => 'test',
                                    password => 'TeSt',
odb (;$)

Returns current database handler. If called with an argument and speciall access is enabled then replaces database handler.


Copyright (c) 2005 Andrew Maltsev

Copyright (c) 2001-2004 Andrew Maltsev, XAO Inc.

<> --


Recommended reading: XAO::Web, XAO::DO::Config.