summaryrefslogtreecommitdiff
path: root/Echolot/Globals.pm
blob: 0a1dabb7426e11df90a0871b479ec9c3cd47ea5e (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
43
package Echolot::Globals;

# (c) 2002 Peter Palfrader <peter@palfrader.org>
# $Id: Globals.pm,v 1.3 2002/07/16 00:53:33 weasel Exp $
#

=pod

=head1 Name

Echolot::Globals - echolot global variables

=head1 DESCRIPTION

=cut

use strict;
use warnings;
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: