rev 1935 - in trunk/buscador/lib: . Buscador

[prev] [thread] [next] [lurker] [Date index for 2005/02/22]

From: richardc
Subject: rev 1935 - in trunk/buscador/lib: . Buscador
Date: 00:36 on 22 Feb 2005
Author: richardc
Date: 2005-02-22 00:36:49 +0000 (Tue, 22 Feb 2005)
New Revision: 1935

Modified:
   trunk/buscador/lib/Buscador.pm
   trunk/buscador/lib/Buscador/Config.pm
Log:
allow for db_user and db_pass (pg likes 'em)

Modified: trunk/buscador/lib/Buscador/Config.pm
===================================================================
--- trunk/buscador/lib/Buscador/Config.pm	2005-02-22 00:10:35 UTC (rev 1934)
+++ trunk/buscador/lib/Buscador/Config.pm	2005-02-22 00:36:49 UTC (rev 1935)
@@ -1,18 +1,20 @@
 package Buscador::Config;
 use strict;
-use vars qw(%config);
-
+use warnings;
 use Apache;
 use Carp qw(croak);
 use Cwd;
+our %config;
 
+BEGIN {
+    my $home;
 
+    %config = (
+        db_user => '',
+        db_pass => '',
+    );
 
 
-BEGIN {
-
-    my $home;
-
     # h-h-h-ack!
     eval {
         my $r = Apache->request;
@@ -53,7 +55,8 @@
    $tag =~s/.*:://;
 
    my $joined = join ",", keys %config;
-   croak "No such method $tag try one of $joined" unless $config{$tag};
+   croak "No such method $tag try one of $joined"
+     unless exists $config{$tag};
 
    *$AUTOLOAD = sub {
         my $self = shift;

Modified: trunk/buscador/lib/Buscador.pm
===================================================================
--- trunk/buscador/lib/Buscador.pm	2005-02-22 00:10:35 UTC (rev 1934)
+++ trunk/buscador/lib/Buscador.pm	2005-02-22 00:36:49 UTC (rev 1935)
@@ -17,9 +17,11 @@
 BEGIN {
     require Email::Store;
 
-    Email::Store->import({ verbose => 1 }, Buscador::Config->dsn, '', '',
+    Email::Store->import({ verbose => 1 },
+                         Buscador::Config->dsn,
+                         Buscador::Config->db_user,
+                         Buscador::Config->db_pass,
                          { RaiseError => 1, AutoCommit => 1 });
-    die Email::Store::DBI->db_Main->{AutoCommit} ;
 
     use Module::Pluggable           search_path => [ "Email::Store" ], sub_name => 'stores', require => 1;
     use Module::Pluggable::Ordered  search_path => [ "Buscador" ];

Generated at 09:00 on 22 Feb 2005 by mariachi 0.52