Changeset 4874
- Timestamp:
- Aug 24, 2005, 3:44:32 PM (21 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 2 edited
-
Nebulous-Server/lib/Nebulous/Server.pm (modified) (4 diffs)
-
Nebulous-Server/lib/Nebulous/Server/Config.pm (added)
-
Nebulous/lib/Nebulous/Server.pm (modified) (4 diffs)
-
Nebulous/lib/Nebulous/Server/Config.pm (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/lib/Nebulous/Server.pm
r4440 r4874 1 1 # Copyright (c) 2004 Joshua Hoblitt 2 2 # 3 # $Id: Server.pm,v 1. 9 2005-06-30 02:35:06jhoblitt Exp $3 # $Id: Server.pm,v 1.10 2005-08-25 01:44:32 jhoblitt Exp $ 4 4 5 5 package Nebulous::Server; … … 12 12 use DBI; 13 13 use Nebulous::Util qw( :standard ); 14 use Nebulous::Server::Config; 14 15 use Nebulous::Server::Log; 15 16 use Nebulous::Server::SQL; … … 25 26 my $db; 26 27 27 sub setup { 28 my $self = shift; 29 30 my ( $dsn, $user, $passwd ) = validate_pos( @_, 31 { 32 type => SCALAR, 33 }, 34 { 35 type => SCALAR, 36 }, 37 { 38 type => SCALAR, 39 }, 40 ); 28 sub init { 29 my $self = shift; 30 31 # let Nebulous::Server::Config validate our params 32 my $config = Nebulous::Server::Config->init( @_ ); 33 34 # log4perl is not avaliable until we call init() 35 Nebulous::Server::Log->init; 41 36 42 37 $log = Log::Log4perl::get_logger( "Nebulous::Server" ); … … 47 42 eval { 48 43 $db = DBI->connect( 49 $ dsn,50 $ user,51 $ passwd,44 $config->dsn, 45 $config->dbuser, 46 $config->dbpasswd, 52 47 { 53 48 RaiseError => 1, -
trunk/Nebulous/lib/Nebulous/Server.pm
r4440 r4874 1 1 # Copyright (c) 2004 Joshua Hoblitt 2 2 # 3 # $Id: Server.pm,v 1. 9 2005-06-30 02:35:06jhoblitt Exp $3 # $Id: Server.pm,v 1.10 2005-08-25 01:44:32 jhoblitt Exp $ 4 4 5 5 package Nebulous::Server; … … 12 12 use DBI; 13 13 use Nebulous::Util qw( :standard ); 14 use Nebulous::Server::Config; 14 15 use Nebulous::Server::Log; 15 16 use Nebulous::Server::SQL; … … 25 26 my $db; 26 27 27 sub setup { 28 my $self = shift; 29 30 my ( $dsn, $user, $passwd ) = validate_pos( @_, 31 { 32 type => SCALAR, 33 }, 34 { 35 type => SCALAR, 36 }, 37 { 38 type => SCALAR, 39 }, 40 ); 28 sub init { 29 my $self = shift; 30 31 # let Nebulous::Server::Config validate our params 32 my $config = Nebulous::Server::Config->init( @_ ); 33 34 # log4perl is not avaliable until we call init() 35 Nebulous::Server::Log->init; 41 36 42 37 $log = Log::Log4perl::get_logger( "Nebulous::Server" ); … … 47 42 eval { 48 43 $db = DBI->connect( 49 $ dsn,50 $ user,51 $ passwd,44 $config->dsn, 45 $config->dbuser, 46 $config->dbpasswd, 52 47 { 53 48 RaiseError => 1,
Note:
See TracChangeset
for help on using the changeset viewer.
