[Bps-public-commit] r20282 - RT-Authen-ExternalAuth/trunk/lib/RT/Authen/ExternalAuth

sunnavy at bestpractical.com sunnavy at bestpractical.com
Wed Feb 23 05:32:39 EST 2011


Author: sunnavy
Date: Wed Feb 23 05:32:38 2011
New Revision: 20282

Modified:
   RT-Authen-ExternalAuth/trunk/lib/RT/Authen/ExternalAuth/DBI.pm

Log:
support sqlite too

Modified: RT-Authen-ExternalAuth/trunk/lib/RT/Authen/ExternalAuth/DBI.pm
==============================================================================
--- RT-Authen-ExternalAuth/trunk/lib/RT/Authen/ExternalAuth/DBI.pm	(original)
+++ RT-Authen-ExternalAuth/trunk/lib/RT/Authen/ExternalAuth/DBI.pm	Wed Feb 23 05:32:38 2011
@@ -434,7 +434,13 @@
     my $dbi_driver    = $config->{'dbi_driver'};
 
     # Use config to create a DSN line for the DBI connection
-    my $dsn = "dbi:$dbi_driver:database=$db_database;host=$db_server;port=$db_port";
+    my $dsn;
+    if ( $dbi_driver eq 'SQLite' ) {
+        $dsn = "dbi:$dbi_driver:$db_database";
+    }
+    else {
+        $dsn = "dbi:$dbi_driver:database=$db_database;host=$db_server;port=$db_port";
+    }
 
     # Now let's get connected
     my $dbh = DBI->connect($dsn, $db_user, $db_pass,{RaiseError => 1, AutoCommit => 0 })



More information about the Bps-public-commit mailing list