<<

NAME

MT::ConfigMgr - Movable Type configuration manager

SYNOPSIS

    use MT::ConfigMgr;
    my $cfg = MT::ConfigMgr->instance;

    $cfg->read_config('/path/to/mt.cfg')
        or die $cfg->errstr;

DESCRIPTION

MT::ConfigMgr is a singleton class that manages the Movable Type configuration file (mt.cfg), allowing access to the config directives contained therin.

USAGE

MT::ConfigMgr->instance

Returns the singleton MT::ConfigMgr object. Note that when you want the object, you should always call instance, never new; new will construct a new MT::ConfigMgr object, and that isn't what you want. You want the object that has already been initialized with the contents of mt.cfg. This initialization is done by MT::new.

$cfg->read_config($file)

Reads the config file at the path $file and initializes the $cfg object with the directives in that file. Returns true on success, undef otherwise; if an error occurs you can obtain the error message with $cfg->errstr.

$cfg->define($directive [, %arg ])

Defines the directive $directive as a valid configuration directive; you must define new configuration directives before you read the configuration file, or else the read will fail.

$cfg->ExternalUserManagement()

Returns boolean value indicating whether the configuration is set so that external users management feature in Movable Type Enterprise is turned on.

CONFIGURATION DIRECTIVES

The following configuration directives are allowed in mt.cfg. To get the value of a directive, treat it as a method that you are calling on the $cfg object. For example:

    $cfg->CGIPath

To set the value of a directive, do the same as the above, but pass in a value to the method:

    $cfg->CGIPath('http://www.foo.com/mt/');

A list of valid configuration directives can be found in the CONFIGURATION SETTINGS section of the manual.

AUTHOR & COPYRIGHT

Please see the MT manpage for author, copyright, and license information.

<<