line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Eidolon::Core::Config; |
2
|
|
|
|
|
|
|
# ============================================================================== |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# Eidolon |
5
|
|
|
|
|
|
|
# Copyright (c) 2009, Atma 7 |
6
|
|
|
|
|
|
|
# --- |
7
|
|
|
|
|
|
|
# Eidolon/Core/Config.pm - system config |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# ============================================================================== |
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
38604
|
use FindBin; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
99
|
|
12
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
51
|
|
13
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
488
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our ($VERSION, $INSTANCE); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
$VERSION = "0.02"; # 2009-05-14 04:54:08 |
18
|
|
|
|
|
|
|
$INSTANCE = undef; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------ |
21
|
|
|
|
|
|
|
# \% new($name, $type) |
22
|
|
|
|
|
|
|
# constructor |
23
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------ |
24
|
|
|
|
|
|
|
sub new |
25
|
|
|
|
|
|
|
{ |
26
|
2
|
|
|
2
|
1
|
8922
|
my ($class, $name, $type, $self); |
27
|
|
|
|
|
|
|
|
28
|
2
|
|
|
|
|
9
|
($class, $name, $type) = @_; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# class attrubutes |
31
|
2
|
|
|
|
|
66
|
$self = |
32
|
|
|
|
|
|
|
{ |
33
|
|
|
|
|
|
|
# application settings |
34
|
|
|
|
|
|
|
"app" => |
35
|
|
|
|
|
|
|
{ |
36
|
|
|
|
|
|
|
"title" => undef, |
37
|
|
|
|
|
|
|
"name" => $name, |
38
|
|
|
|
|
|
|
"version" => $name->VERSION, |
39
|
|
|
|
|
|
|
"root" => $FindBin::Bin, |
40
|
|
|
|
|
|
|
"lib" => $FindBin::Bin."/lib", |
41
|
|
|
|
|
|
|
"type" => $type, |
42
|
|
|
|
|
|
|
"policy" => "private", |
43
|
|
|
|
|
|
|
"error" => [ "Eidolon::Error", "error" ] |
44
|
|
|
|
|
|
|
}, |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# CGI settings |
47
|
|
|
|
|
|
|
"cgi" => |
48
|
|
|
|
|
|
|
{ |
49
|
|
|
|
|
|
|
"max_post_size" => 600000, |
50
|
|
|
|
|
|
|
"tmp_dir" => "/tmp/", |
51
|
|
|
|
|
|
|
"charset" => "UTF-8", |
52
|
|
|
|
|
|
|
"content_type" => "text/html", |
53
|
|
|
|
|
|
|
"session_cookie" => "SESSIONID", |
54
|
|
|
|
|
|
|
"session_time" => 3600 |
55
|
|
|
|
|
|
|
}, |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# driver list |
58
|
|
|
|
|
|
|
"drivers" => [] |
59
|
|
|
|
|
|
|
}; |
60
|
|
|
|
|
|
|
|
61
|
2
|
|
|
|
|
10
|
bless $self, $class; |
62
|
2
|
|
|
|
|
5
|
$INSTANCE = $self; |
63
|
|
|
|
|
|
|
|
64
|
2
|
|
|
|
|
9
|
return $self; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------ |
68
|
|
|
|
|
|
|
# \% get_instance() |
69
|
|
|
|
|
|
|
# get config instance |
70
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------ |
71
|
|
|
|
|
|
|
sub get_instance |
72
|
|
|
|
|
|
|
{ |
73
|
3
|
|
|
3
|
1
|
9
|
return $INSTANCE; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
__END__ |