summaryrefslogtreecommitdiff
path: root/fml/lib/IO
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-02-01 12:03:55 +0000
committerfukachan <fukachan>2002-02-01 12:03:55 +0000
commita176a2ad4ac5fd35a3a056dd3828c0dbb1da0e6d (patch)
treec06f02bd93f73f40c2cafff8c461d73731b15b6d /fml/lib/IO
parenteec3fb6d6aa9ffe509abbab89f304f450295d860 (diff)
downloadfml8-subdir-base.tar.gz
fml8-subdir-base.tar.bz2
fml8-subdir-base.zip
remove $ENV{debug} based toggle flagsubdir-base
Diffstat (limited to 'fml/lib/IO')
-rw-r--r--fml/lib/IO/Adapter.pm6
-rw-r--r--fml/lib/IO/Adapter/DBI.pm6
-rw-r--r--fml/lib/IO/Adapter/MySQL.pm8
-rw-r--r--fml/lib/IO/Adapter/SQL/toymodel.pm10
4 files changed, 19 insertions, 11 deletions
diff --git a/fml/lib/IO/Adapter.pm b/fml/lib/IO/Adapter.pm
index 58b6cde1..03b03444 100644
--- a/fml/lib/IO/Adapter.pm
+++ b/fml/lib/IO/Adapter.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Adapter.pm,v 1.13 2002/01/27 09:25:23 fukachan Exp $
+# $FML: Adapter.pm,v 1.14 2002/01/27 13:11:57 fukachan Exp $
#
package IO::Adapter;
@@ -13,6 +13,8 @@ use strict;
use Carp;
use IO::Adapter::ErrorStatus qw(error_set error error_clear);
+my $debug = 0;
+
# prepare error_set() is called
@ISA = qw(IO::Adapter::ErrorStatus);
@@ -193,7 +195,7 @@ sub new
@ORIG_ISA = @ISA unless $FirstTime++;
@ISA = ($pkg, @ORIG_ISA);
- printf STDERR "%-20s %s\n", "IO::Adapter::ISA:", "@ISA" if $ENV{'debug'};
+ printf STDERR "%-20s %s\n", "IO::Adapter::ISA:", "@ISA" if $debug;
eval qq{ require $pkg; $pkg->import();};
unless ($@) {
$pkg->configure($me, $args) if $pkg->can('configure');
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)";