[Codestriker-commits] CVS update: codestriker/lib/Codestriker/DB Database.pm PostgreSQL.pm
Brought to you by:
sits
|
From: <si...@us...> - 2005-07-10 02:29:21
|
Created Codestriker topic at: http://codestriker.sourceforge.net/cgi-bin/codestriker.pl?topic=1574939&action=view User: sits Date: 05/07/09 19:28:59 Modified: . CHANGELOG codestriker.conf bin install.pl lib Codestriker.pm lib/Codestriker/DB Database.pm PostgreSQL.pm Log: Provide support for using the PgPP PosrgreSQL driver, which is required for Win32 systems. Also make install.pl a bit nicer when constructing the codestriker.pl file on Win32 systems, so that the correct perl.exe path is present on the #! line. Index: CHANGELOG =================================================================== RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v retrieving revision 1.173 retrieving revision 1.174 diff -u -r1.173 -r1.174 --- CHANGELOG 19 Jun 2005 22:54:10 -0000 1.173 +++ CHANGELOG 10 Jul 2005 02:28:56 -0000 1.174 @@ -1,4 +1,4 @@ -*** When upgrading, don't forget to: "cd bin ; ./checksetup.pl" *** +*** When upgrading, don't forget to: "cd bin ; ./install.pl" *** *** Also, it is _highly_ advisable to backup your data before upgrading *** Version 1.9.0 Index: codestriker.conf =================================================================== RCS file: /cvsroot/codestriker/codestriker/codestriker.conf,v retrieving revision 1.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- codestriker.conf 9 Jun 2005 07:22:03 -0000 1.73 +++ codestriker.conf 10 Jul 2005 02:28:56 -0000 1.74 @@ -5,10 +5,21 @@ # Oracle, SQL Server, PostgreSQL and MySQL. Refer to the # documentation on how to create the Codestriker database. +# Example of an oracle database URL. #$db = 'DBI:Oracle:host=127.0.0.1;sid=local'; + +# Example of an SQL Server ODBC database URL. #$db = 'DBI:ODBC:Codestriker'; -#$db = 'DBI:Pg:dbname=codestrikerdb'; -$db = 'DBI:mysql:dbname=codestrikerdb'; + +# Example of a PostgreSQL database URL using the native Pg driver. +$db = 'DBI:Pg:dbname=codestrikerdb'; + +# Example of a PostgreSQL database URL using the PgPP driver (required for +# Win32 systems at the time of release). +#$db = 'DBI:PgPP:dbname=codestrikerdb'; + +# Example of a MySQL database URL. +#$db = 'DBI:mysql:dbname=codestrikerdb'; # Database user. #$dbuser = 'system'; Index: install.pl =================================================================== RCS file: /cvsroot/codestriker/codestriker/bin/install.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- install.pl 22 May 2005 10:46:30 -0000 1.1 +++ install.pl 10 Jul 2005 02:28:57 -0000 1.2 @@ -1003,9 +1003,12 @@ my $template_vars = {}; # For Win32, don't enable tainting mode. There are weird issues with -# ActivePerl, and sometimes with IIS as well. +# ActivePerl, and sometimes with IIS as well. Make sure the Windows Perl +# path is set correctly, as its location could be anywhere. if ($windows) { - $template_vars->{hash_ex_line} = '#!perl.exe -w'; + my $perl = $^X; + $perl =~ s/\\/\//g; + $template_vars->{hash_ex_line} = '#!' . $perl . ' -w'; } else { $template_vars->{hash_ex_line} = '#!/usr/bin/perl -wT'; } Index: Codestriker.pm =================================================================== RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker.pm,v retrieving revision 1.77 retrieving revision 1.78 diff -u -r1.77 -r1.78 --- Codestriker.pm 1 Jul 2005 02:06:20 -0000 1.77 +++ Codestriker.pm 10 Jul 2005 02:28:58 -0000 1.78 @@ -27,7 +27,7 @@ ); # Version of Codestriker. -$Codestriker::VERSION = "1.9.0.beta3"; +$Codestriker::VERSION = "1.9.0"; # Default title to display on each Codestriker screen. $Codestriker::title = "Codestriker $Codestriker::VERSION"; Index: Database.pm =================================================================== RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/DB/Database.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- Database.pm 17 Aug 2004 22:28:51 -0000 1.7 +++ Database.pm 10 Jul 2005 02:28:58 -0000 1.8 @@ -36,7 +36,7 @@ if ($Codestriker::db =~ /^DBI:mysql/i) { return Codestriker::DB::MySQL->new(); } elsif ($Codestriker::db =~ /^DBI:Pg/i) { - return Codestriker::DB::PostgreSQL->new(); + return Codestriker::DB::PostgreSQL->new($Codestriker::db); } elsif ($Codestriker::db =~ /^DBI:Odbc/i) { return Codestriker::DB::ODBC->new(); } elsif ($Codestriker::db =~ /^DBI:Oracle/i) { Index: PostgreSQL.pm =================================================================== RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/DB/PostgreSQL.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- PostgreSQL.pm 28 Mar 2004 02:41:20 -0000 1.5 +++ PostgreSQL.pm 10 Jul 2005 02:28:58 -0000 1.6 @@ -30,16 +30,23 @@ # Create a new PostgreSQL database object. sub new { my $type = shift; + my $url = shift; # Database is parent class. my $self = Codestriker::DB::Database->new(); $self->{sequence_created} = 0; + + # Determine which PostgreSQL driver to use. + $url =~ /^DBI:(Pg\w*):/; + $self->{driver} = $1; + return bless $self, $type; } # Return the DBD module this is dependent on. sub get_module_dependencies { - return { name => 'DBD::Pg', version => '0' }; + my $self = shift; + return { name => 'DBD::' . $self->{driver}, version => '0' }; } sub getDBDModuleVer { |