[vhffs-dev] [899] Vhffs::DB is not used anymore, probably because DBI is perfect and adding a featureless wrapper was just totally stupid |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
- To: vhffs-dev@xxxxxxxxx
- Subject: [vhffs-dev] [899] Vhffs::DB is not used anymore, probably because DBI is perfect and adding a featureless wrapper was just totally stupid
- From: subversion@xxxxxxxxxxxxx
- Date: Mon, 10 Sep 2007 06:16:46 +0200
Revision: 899
Author: gradator
Date: 2007-09-10 04:16:45 +0000 (Mon, 10 Sep 2007)
Log Message:
-----------
Vhffs::DB is not used anymore, probably because DBI is perfect and adding a featureless wrapper was just totally stupid
Modified Paths:
--------------
trunk/vhffs-api/src/Vhffs/Main.pm
trunk/vhffs-api/src/Vhffs/Makefile.am
trunk/vhffs-tests/src/Vhffs/Tests/Main.pm
Removed Paths:
-------------
trunk/vhffs-api/src/Vhffs/DB.pm
Deleted: trunk/vhffs-api/src/Vhffs/DB.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/DB.pm 2007-09-10 04:05:57 UTC (rev 898)
+++ trunk/vhffs-api/src/Vhffs/DB.pm 2007-09-10 04:16:45 UTC (rev 899)
@@ -1,125 +0,0 @@
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in
-# the documentation and/or other materials provided with the
-# distribution.
-#3. Neither the name of vhffs nor the names of its contributors
-# may be used to endorse or promote products derived from this
-# software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-package Vhffs::DB;
-
-
-use strict;
-use DBI;
-use Vhffs::Functions;
-
-
-
-sub new
-{
- my $self;
- my $this;
- my $dbh;
- my $class;
- my $config;
- my $tmp;
-
- $this = shift;
- $config = shift;
-
- #First, create the object
- $self={};
- $class = ref($this) || $this;
- bless($self , $class );
-
-
- #If the database to read is not set, we return an undefined value
- return undef if( ! defined $config->{'dbread'} );
-
-
- $tmp = Vhffs::Functions::db_connect $config->{'dbread'};
- return( undef ) if( ! ( defined( $tmp ) ) );
- $self = $tmp;
-
- #If the database to write is not defined, we use the database to read
- if( ! defined $config->{'dbwrite'} )
- {
- $self = $self;
- }
- else
- {
- $tmp = Vhffs::Functions::db_connect $config->{'dbwrite'};
- return( undef ) if( ! ( defined( $tmp ) ) );
- $self = $tmp;
- }
-
- return $self;
-}
-
-1;
-
-
-__END__
-
-=head1 NAME
-
-Vhffs::DB - handle Database connection
-
-=head1 SYNOPSIS
-
- use Vhffs::DB;
- $db = new Vhffs::DB;
-
- now:
-
- * $db is a DBI object for read database
-
- * $db is a DBI object for write database
-
- Typical use :
- use Vhffs::Main;
- $vhffs = init Vhffs::Main;
-
- $db = $vhffs->get_db_object();
-
-=head1 DESCRIPTION
-
-This class should not be used in standalone mode, you should use it
-through the Vhffs::Main class.
-
-The Vhffs::DB class has two connections to the database : one for
-read-only, one for write.
-
-=head1 METHODS
-
- new() : create datatabase connections
-
-=head1 AUTHOR
-
- Julien Delange <dieu at gunnm dot org>
-
-=head1 COPYRIGHT
-
- Copyright 2005 Julien Delange
Modified: trunk/vhffs-api/src/Vhffs/Main.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Main.pm 2007-09-10 04:05:57 UTC (rev 898)
+++ trunk/vhffs-api/src/Vhffs/Main.pm 2007-09-10 04:16:45 UTC (rev 899)
@@ -159,7 +159,7 @@
get_config() : Return a Vhffs::Conf object
-get_db_object : Return a Vhffs::DB object
+get_db_object : Return a DBI object
is_valid() : returns 1 if the object is valid (good database connection, ...), 0 otherwise
Modified: trunk/vhffs-api/src/Vhffs/Makefile.am
===================================================================
--- trunk/vhffs-api/src/Vhffs/Makefile.am 2007-09-10 04:05:57 UTC (rev 898)
+++ trunk/vhffs-api/src/Vhffs/Makefile.am 2007-09-10 04:16:45 UTC (rev 899)
@@ -7,7 +7,6 @@
Acl.pm \
Conf.pm \
Constants.pm \
- DB.pm \
Debug.pm \
Functions.pm \
Group.pm \
Modified: trunk/vhffs-tests/src/Vhffs/Tests/Main.pm
===================================================================
--- trunk/vhffs-tests/src/Vhffs/Tests/Main.pm 2007-09-10 04:05:57 UTC (rev 898)
+++ trunk/vhffs-tests/src/Vhffs/Tests/Main.pm 2007-09-10 04:16:45 UTC (rev 899)
@@ -35,7 +35,6 @@
use strict;
use DBI;
use Vhffs::Functions;
-use Vhffs::DB;
use Vhffs::Conf;
use Test::More;
@@ -151,7 +150,7 @@
get_config() : Return a Vhffs::Conf object
-get_db_object : Return a Vhffs::DB object
+get_db_object : Return a DBI object
is_valid() : returns 1 if the object is valid (good database connection, ...), 0 otherwise