… | |
… | |
1029 | } |
1029 | } |
1030 | |
1030 | |
1031 | ############################################################################# |
1031 | ############################################################################# |
1032 | # the server's main() |
1032 | # the server's main() |
1033 | |
1033 | |
1034 | sub load_cfg { |
1034 | sub cfg_load { |
1035 | open my $fh, "<:utf8", cf::confdir . "/config" |
1035 | open my $fh, "<:utf8", cf::confdir . "/config" |
1036 | or return; |
1036 | or return; |
1037 | |
1037 | |
1038 | local $/; |
1038 | local $/; |
1039 | *CFG = YAML::Syck::Load <$fh>; |
1039 | *CFG = YAML::Syck::Load <$fh>; |
1040 | |
1040 | |
1041 | use Data::Dumper; warn Dumper \%CFG; |
1041 | use Data::Dumper; warn Dumper \%CFG; |
1042 | } |
1042 | } |
1043 | |
1043 | |
1044 | sub main { |
1044 | sub main { |
1045 | load_cfg; |
1045 | cfg_load; |
1046 | db_load; |
1046 | db_load; |
1047 | load_extensions; |
1047 | load_extensions; |
1048 | Event::loop; |
1048 | Event::loop; |
1049 | } |
1049 | } |
1050 | |
1050 | |
… | |
… | |
1102 | |
1102 | |
1103 | # reload cf.pm |
1103 | # reload cf.pm |
1104 | $msg->("reloading cf.pm"); |
1104 | $msg->("reloading cf.pm"); |
1105 | require cf; |
1105 | require cf; |
1106 | |
1106 | |
1107 | # load database again |
1107 | # load config and database again |
|
|
1108 | cf::cfg_load; |
1108 | cf::db_load; |
1109 | cf::db_load; |
1109 | |
1110 | |
1110 | # load extensions |
1111 | # load extensions |
1111 | $msg->("load extensions"); |
1112 | $msg->("load extensions"); |
1112 | cf::load_extensions; |
1113 | cf::load_extensions; |