blob: c4db4823198f1bfa6e9732b74b1106d5e9db866c (
plain)
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
|
package Echolot::Globals;
# (c) 2002 Peter Palfrader <peter@palfrader.org>
# $Id: Globals.pm,v 1.4 2002/07/16 02:48:57 weasel Exp $
#
=pod
=head1 Name
Echolot::Globals - echolot global variables
=head1 DESCRIPTION
=cut
use strict;
use Carp;
my $GLOBALS;
sub init(%) {
my (%args) = @_;
my $hostname = `hostname`;
$hostname =~ /^([a-zA-Z0-9_-]*)$/;
$hostname = $1 || 'unknown';
$GLOBALS->{'hostname'} = $hostname;
$GLOBALS->{'internalcounter'} = 1;
$GLOBALS->{'version'} = $args{'version'};
};
sub initStorage {
$GLOBALS->{'storage'} = new Echolot::Storage::File ( datadir => Echolot::Config::get()->{'storage'}->{'File'}->{'basedir'} );
};
sub get() {
return $GLOBALS;
};
1;
# vim: set ts=4 shiftwidth=4:
|