summaryrefslogtreecommitdiff
path: root/Echolot/Globals.pm
blob: 398c9dd0ffab36dc9e46b81371bf2869c9cd34be (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.5 2003/01/02 19:02:10 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: