IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 11, 2006, 2:06:27 PM (20 years ago)
Author:
jhoblitt
Message:

make Nebulous::Server::Config no longer a singleton

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/lib/Nebulous/Server/Config.pm

    r4874 r10628  
    11# Copyright (C) 2005  Joshua Hoblitt
    22#
    3 # $Id: Config.pm,v 1.1 2005-08-25 01:44:32 jhoblitt Exp $
     3# $Id: Config.pm,v 1.2 2006-12-12 00:06:27 jhoblitt Exp $
    44
    55package Nebulous::Server::Config;
     
    88use warnings FATAL => qw( all );
    99
    10 our $VERSION = 0.01;
     10our $VERSION = 0.02;
    1111
    1212use base qw( Class::Accessor::Fast );
     
    1414use Nebulous::Util qw( %LEVELS );
    1515use Params::Validate qw( validate SCALAR );
    16 
    17 my $_instance;
    1816
    1917my $new_validate = {
     
    4745    bless $self, $class || ref $class;
    4846
    49     $_instance = $self;
    50 
    5147    return $self;
    52 }
    53 
    54 # orginaly lifted from Class::Singleton and modified to return undef unless the
    55 # singleton has been initialized.
    56 
    57 sub instance {
    58     my $class = shift;
    59 
    60     die "not configured" unless defined $_instance;
    61 
    62 #return defined $_instance ? $_instance : undef;
    63     return $_instance;
    6448}
    6549
Note: See TracChangeset for help on using the changeset viewer.