diff options
Diffstat (limited to 'fml/lib/IO/Adapter')
| -rw-r--r-- | fml/lib/IO/Adapter/DBI.pm | 6 | ||||
| -rw-r--r-- | fml/lib/IO/Adapter/MySQL.pm | 8 | ||||
| -rw-r--r-- | fml/lib/IO/Adapter/SQL/toymodel.pm | 10 |
3 files changed, 15 insertions, 9 deletions
diff --git a/fml/lib/IO/Adapter/DBI.pm b/fml/lib/IO/Adapter/DBI.pm index 9b789c34..94b1e154 100644 --- a/fml/lib/IO/Adapter/DBI.pm +++ b/fml/lib/IO/Adapter/DBI.pm @@ -3,7 +3,7 @@ # Copyright (C) 2000,2001,2002 Ken'ichi Fukamachi # All rights reserved. # -# $FML: DBI.pm,v 1.12 2002/01/27 09:25:24 fukachan Exp $ +# $FML: DBI.pm,v 1.13 2002/01/27 13:11:58 fukachan Exp $ # package IO::Adapter::DBI; @@ -13,6 +13,8 @@ use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); use Carp; use IO::Adapter::ErrorStatus qw(error_set error error_clear); +my $debug = 0; + =head1 NAME IO::Adapter::DBI - DBI @@ -73,7 +75,7 @@ sub execute my $dbh = $self->{ _dbh }; my $query = $args->{ query }; - print STDERR "execute query={$query}\n" if $ENV{'debug'}; + print STDERR "execute query={$query}\n" if $debug; undef $self->{ _res }; diff --git a/fml/lib/IO/Adapter/MySQL.pm b/fml/lib/IO/Adapter/MySQL.pm index e48395e6..44d9b0b7 100644 --- a/fml/lib/IO/Adapter/MySQL.pm +++ b/fml/lib/IO/Adapter/MySQL.pm @@ -3,7 +3,7 @@ # Copyright (C) 2000,2001,2002 Ken'ichi Fukamachi # All rights reserved. # -# $FML: MySQL.pm,v 1.18 2001/12/24 07:40:57 fukachan Exp $ +# $FML: MySQL.pm,v 1.19 2002/01/27 13:11:58 fukachan Exp $ # @@ -13,6 +13,8 @@ use strict; use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); use Carp; +my $debug = 0; + use IO::Adapter::DBI; @ISA = qw(IO::Adapter::DBI); @@ -100,12 +102,12 @@ sub configure # $self->{ _driver } is the $config->{ driver } object. unless ($@) { - printf STDERR "%-20s %s\n", "loading", $pkg if $ENV{'debug'}; + printf STDERR "%-20s %s\n", "loading", $pkg if $debug; @ISA = ($pkg, @ISA); $me->{ _model_specific_driver } = $pkg; - printf STDERR "%-20s %s\n", "MySQL::ISA:", "@ISA" if $ENV{'debug'}; + printf STDERR "%-20s %s\n", "MySQL::ISA:", "@ISA" if $debug; } else { error_set($self, $@); diff --git a/fml/lib/IO/Adapter/SQL/toymodel.pm b/fml/lib/IO/Adapter/SQL/toymodel.pm index b918eab4..facc26c0 100644 --- a/fml/lib/IO/Adapter/SQL/toymodel.pm +++ b/fml/lib/IO/Adapter/SQL/toymodel.pm @@ -3,7 +3,7 @@ # Copyright (C) 2000,2001 Ken'ichi Fukamachi # All rights reserved. # -# $FML: toymodel.pm,v 1.6 2001/12/24 07:40:57 fukachan Exp $ +# $FML: toymodel.pm,v 1.7 2001/12/24 07:44:35 fukachan Exp $ # @@ -13,6 +13,8 @@ use strict; use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); use Carp; +my $debug = 0; + =head1 NAME IO::Adapter::SQL::toymodel - SQL statement dependent on toymodel @@ -41,7 +43,7 @@ sub add { my ($self, $addr) = @_; - print STDERR "add( $addr )\n" if $ENV{'debug'}; + print STDERR "add( $addr )\n" if $debug; my $query = $self->_build_sql_query({ query => 'add', @@ -60,7 +62,7 @@ sub delete { my ($self, $addr) = @_; - print STDERR "delete( $addr )\n" if $ENV{'debug'}; + print STDERR "delete( $addr )\n" if $debug; my $query = $self->_build_sql_query({ query => 'delete', @@ -160,7 +162,7 @@ sub _build_sql_query my $file = $self->{ _params }->{ file }; my $table = $self->{ _table }; - print STDERR "_build_sql_query( query=$query )\n" if $ENV{'debug'}; + print STDERR "_build_sql_query( query=$query )\n" if $debug; if ($query eq 'add') { "insert into $table values ('$ml_name', '$file', '$address', 0, 0)"; |
