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

# (c) 2002 Peter Palfrader <peter@palfrader.org>
# $Id: Globals.pm,v 1.1 2002/06/05 04:05:40 weasel Exp $
#

=pod

=head1 Name

Echolot::Globals - echolot global variables

=head1 DESCRIPTION

=cut

use strict;
use warnings;
use Carp;

my $GLOBALS;

sub init {
	my $hostname = `hostname`;
	$hostname =~ /^([a-zA-Z0-9_-]*)$/;
	$hostname = $1 || 'unknown';
	$GLOBALS->{'hostname'} = $hostname;
	$GLOBALS->{'storage'}   = new Echolot::Storage::File ( datadir => Echolot::Config::get()->{'storage'}->{'File'}->{'basedir'} );
	$GLOBALS->{'internalcounter'} = 1;
};

sub get() {
	return $GLOBALS;
};

1;
# vim: set ts=4 shiftwidth=4: