-
Notifications
You must be signed in to change notification settings - Fork 0
/
PmsConfig.pm
94 lines (77 loc) · 2.08 KB
/
PmsConfig.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/perl -w
=begin nd
Package: PmsConfig
Description:
This is the configuration file of the pms-server.
It is written and perl and is directly interpreted by the
application.
Here its possible to configure the ConnectionProviders and
the Modules
=cut
package PmsConfig;
use strict;
use utf8;
use Data::Dumper;
=begin nd
var: @connectionProviders
Description:
Contains all ConnectionProviders that are loaded at startup time.
=cut
my @connectionProviders = (
{
name => "Pms::Net::WebSocket::ConnectionProvider", #the name of the plugin
config => { #the specific config hash
port => 8888
}
}
);
=begin nd
var: %baseDBHash
Description:
The basic database hash for all modules
=cut
my %baseDBHash = (
db_host => "localhost",
db_database => "pms",
db_user => "pms",
db_pass => "secret"
);
=begin nd
var: @modules
Description:
Contains all modules that are loaded at startup time.
=cut
my @modules = (
{
name => "Pms::Modules::Backlog", #The name of the plugin
requires => undef, #which other modules are required
config => \%baseDBHash #the specific module config hash
},
{
name => "Pms::Modules::Motd",
requires => undef,
config => "----- Welcome to the P.M.S Testserver -----\n"
." Please Respect our Rules\n"
},
{
name => "Pms::Modules::Security::Module",
requires => undef,
config => \%baseDBHash
}
);
=begin nd
var: %Server
This is the main config Hash, its directly passed to the server.
It requires two elements:
connectionProviders:
This is the element that contains a array of all connectionProviders
the Server should load at startup.
modules:
This element contains all modules that are loaded at startup.
Every Module can depend on other modules and has its own config hash.
=cut
our %Server = (
connectionProviders => \@connectionProviders,
modules => \@modules
);
return 1;