From 20ec9098cb5fc91e79fc5e4c4a161dc211f91983 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sun, 13 May 2007 19:01:39 +0000 Subject: * simplified declaration of base classes via 'use base' * simplified checking for correct API-version of modules git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1072 95ad53e4-c205-0410-b2fa-d234c58c8868 --- config-db/OpenSLX/MetaDB/Base.pm | 2 +- config-db/OpenSLX/MetaDB/CSV.pm | 9 +++------ config-db/OpenSLX/MetaDB/DBI.pm | 9 ++------- config-db/OpenSLX/MetaDB/SQLite.pm | 10 +++------- config-db/OpenSLX/MetaDB/mysql.pm | 10 +++------- 5 files changed, 12 insertions(+), 28 deletions(-) (limited to 'config-db') diff --git a/config-db/OpenSLX/MetaDB/Base.pm b/config-db/OpenSLX/MetaDB/Base.pm index ac15ac52..db1f2e7e 100644 --- a/config-db/OpenSLX/MetaDB/Base.pm +++ b/config-db/OpenSLX/MetaDB/Base.pm @@ -16,7 +16,7 @@ package OpenSLX::MetaDB::Base; use strict; use vars qw($VERSION); -$VERSION = 1; # API-version +$VERSION = 1.01; # API-version . implementation-version use Carp; diff --git a/config-db/OpenSLX/MetaDB/CSV.pm b/config-db/OpenSLX/MetaDB/CSV.pm index 9d1418f4..94335d25 100644 --- a/config-db/OpenSLX/MetaDB/CSV.pm +++ b/config-db/OpenSLX/MetaDB/CSV.pm @@ -13,8 +13,9 @@ # ----------------------------------------------------------------------------- package OpenSLX::MetaDB::CSV; +use strict; use vars qw($VERSION); -$VERSION = 1; # API-version +$VERSION = 1.01; # API-version . implementation-version use base qw(OpenSLX::MetaDB::DBI); ################################################################################ @@ -28,12 +29,8 @@ use Carp; use Fcntl qw(:DEFAULT :flock); use DBD::CSV 0.22; use OpenSLX::Basics; +use OpenSLX::MetaDB::DBI 1; -my $superVersion = $OpenSLX::MetaDB::DBI::VERSION; -if ($superVersion < $VERSION) { - confess _tr("Unable to load module '%s' (Version '%s' required, but '%s' found)", - 'OpenSLX::MetaDB::DBI', $VERSION, $superVersion); -} ################################################################################ ### implementation ################################################################################ diff --git a/config-db/OpenSLX/MetaDB/DBI.pm b/config-db/OpenSLX/MetaDB/DBI.pm index 31f70350..e59c9996 100644 --- a/config-db/OpenSLX/MetaDB/DBI.pm +++ b/config-db/OpenSLX/MetaDB/DBI.pm @@ -15,18 +15,13 @@ package OpenSLX::MetaDB::DBI; use strict; use vars qw($VERSION); -$VERSION = 1; # API-version +$VERSION = 1.01; # API-version . implementation-version use base qw(OpenSLX::MetaDB::Base); use Carp; use DBI; use OpenSLX::Basics; - -my $superVersion = $OpenSLX::MetaDB::Base::VERSION; -if ($superVersion < $VERSION) { - confess _tr('Unable to load module <%s> (Version <%s> required, but <%s> found)', - 'OpenSLX::MetaDB::Base', $VERSION, $superVersion); -} +use OpenSLX::MetaDB::Base 1; ################################################################################ ### basics diff --git a/config-db/OpenSLX/MetaDB/SQLite.pm b/config-db/OpenSLX/MetaDB/SQLite.pm index 673ae1c0..147b2061 100644 --- a/config-db/OpenSLX/MetaDB/SQLite.pm +++ b/config-db/OpenSLX/MetaDB/SQLite.pm @@ -13,8 +13,9 @@ # ----------------------------------------------------------------------------- package OpenSLX::MetaDB::SQLite; +use strict; use vars qw($VERSION); -$VERSION = 1; # API-version +$VERSION = 1.01; # API-version . implementation-version use base qw(OpenSLX::MetaDB::DBI); ################################################################################ @@ -25,12 +26,7 @@ use strict; use Carp; use DBD::SQLite; use OpenSLX::Basics; - -my $superVersion = $OpenSLX::MetaDB::DBI::VERSION; -if ($superVersion < $VERSION) { - confess _tr('Unable to load module <%s> (Version <%s> required, but <%s> found)', - 'OpenSLX::MetaDB::DBI', $VERSION, $superVersion); -} +use OpenSLX::MetaDB::DBI 1; ################################################################################ ### implementation diff --git a/config-db/OpenSLX/MetaDB/mysql.pm b/config-db/OpenSLX/MetaDB/mysql.pm index 2d0c15d9..231e1bda 100644 --- a/config-db/OpenSLX/MetaDB/mysql.pm +++ b/config-db/OpenSLX/MetaDB/mysql.pm @@ -13,8 +13,9 @@ # ----------------------------------------------------------------------------- package OpenSLX::MetaDB::mysql; +use strict; use vars qw($VERSION); -$VERSION = 1; # API-version +$VERSION = 1.01; # API-version . implementation-version use base qw(OpenSLX::MetaDB::DBI); ################################################################################ @@ -25,12 +26,7 @@ use strict; use Carp; use DBD::mysql; use OpenSLX::Basics; - -my $superVersion = $OpenSLX::MetaDB::DBI::VERSION; -if ($superVersion < $VERSION) { - confess _tr('Unable to load module <%s> (Version <%s> required, but <%s> found)', - 'OpenSLX::MetaDB::DBI', $VERSION, $superVersion); -} +use OpenSLX::MetaDB::DBI 1; ################################################################################ ### implementation -- cgit v1.2.3-55-g7522