| Eidolon documentation | view source | Contained in the Eidolon distribution. |
Eidolon::Core::Config - generic configuration of the Eidolon application.
Example application configuration (lib/Example/Config.pm):
package Example::Config;
use base qw/Eidolon::Core::Config/;
our $VERSION = "0.01";
sub new
{
my ($class, $name, $type, $self);
($class, $name, $type) = @_;
$self = $class->SUPER::new($name, $type);
$self->{"app"}->{"title"} = "Example application";
$self->{"drivers"} =
[
{
"class" => "Eidolon::Driver::Router::Basic"
}
];
return $self;
}
The Eidolon::Core::Config class holds common configuration for all Eidolon applications. Each application configuration should inherit this class and redefine generic parameters. This class should never be used directly.
Main application settings are specified in {"app"} item of configuration
hash. This item contains a hashref of application settings:
Application title. Affects nothing, but could be useful in application design.
Application class name. Determined automatically, you should not change this manually, otherwise something strange and bad can happen.
Application version. Affects nothing, but could be useful sometimes. Value is
inserted automatically, if your Application.pm has our $VERSION variable
defined.
Application root directory. Determined automatically by getting the
$FindBin::Bin value (see FindBin for more information). You can redefine
this manually, if you need. This value isn't used by the Eidolon core.
Application library path. Determined automatically by getting the
$FindBin::Bin value (see FindBin for more information). You can redefine
this manually, if you need. This value isn't used by the Eidolon core.
Application type. Is determined automatically. Do not change it manually!
Application security policy. Can have two possible values: public or private. The default is private. In public application anyone can view any page, if page isn't marked as private explicitly. In private application only authorized users can view pages, if page method isn't marked as public.
Application error handler. Is an array reference, first item of array is a class name and the second item is a subroutine name of the error handler. By default, all application errors are handled by the Eidolon::Error package. Obviously, you will want to set your own error handler, so you should change this value.
CGI settings are specified in {"cgi"} item of configuration hash. This item
contains a hashref of CGI settings:
Maximal POST request length, in bytes. The default value is 600000.
Directory path for saving temporary files and session data. The default value is /tmp/.
General application charset. The default value is UTF-8.
General application content type. The default value is text/html.
Application session cookie name. The default value is SESSIONID.
Session lifetime (in seconds). The default value is 3600 (1 hour).
Drivers configuration is specified in {"drivers"} item of a configuration
hash. This item is the reference to array of hashrefs, each hashref represents
one driver configuration. Hashref items are:
Driver class name.
Reference to array of driver initialization parameters. This parameters will be sent to a driver constructor during driver initialization.
Class constructor. Creates generic configuration for application $name of
$type type.
Returns configuration instance. Class must be instantiated first.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Anton Belousov, <abel@cpan.org>
Copyright (c) 2009, Atma 7, http://www.atma7.com
| Eidolon documentation | view source | Contained in the Eidolon distribution. |