NAME
XAO::DO::FS::Config - embeddable configuration object for XAO::FS
SYNOPSIS
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();
DESCRIPTION
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.
METHODS
- 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.
Example:
$config->enable_special_access(); $config->odb($odb); $config->disable_special_access();
- new ($$)
-
Creates a new empty configuration object. If odb_args is given then it will connect to a database using these arguments.
Example:
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.
AUTHOR
Copyright (c) 1999-2001 XAO Inc.
The author is Andrew Maltsev <am@xao.com>.
SEE ALSO
Recommended reading: XAO::Web, XAO::DO::Config.