[Rt-commit] r18799 - in rt/3.999/branches/config-in-db/lib/RT: . Model Test
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Sun Mar 15 01:41:50 EDT 2009
Author: sunnavy
Date: Sun Mar 15 01:41:49 2009
New Revision: 18799
Modified:
rt/3.999/branches/config-in-db/lib/RT/Bootstrap.pm
rt/3.999/branches/config-in-db/lib/RT/Interface/Web/Session.pm
rt/3.999/branches/config-in-db/lib/RT/Model/AttachmentCollection.pm
rt/3.999/branches/config-in-db/lib/RT/Model/TicketCollection.pm
rt/3.999/branches/config-in-db/lib/RT/Test.pm
rt/3.999/branches/config-in-db/lib/RT/Test/Shredder.pm
Log:
database stuff lives in jifty's config, not in rt's any more
Modified: rt/3.999/branches/config-in-db/lib/RT/Bootstrap.pm
==============================================================================
--- rt/3.999/branches/config-in-db/lib/RT/Bootstrap.pm (original)
+++ rt/3.999/branches/config-in-db/lib/RT/Bootstrap.pm Sun Mar 15 01:41:49 2009
@@ -71,14 +71,6 @@
'custom_field_values_sources' => [],
'dashboard_address' => '',
'dashboard_subject' => '%s Dashboard: %s',
- 'database_host' => 'localhost',
- 'database_name' => 'rt3',
- 'database_password' => 'rt_pass',
- 'database_port' => '',
- 'database_require_ssl' => undef,
- 'database_rt_host' => 'localhost',
- 'database_type' => 'SQLite',
- 'database_user' => 'rt_user',
'date_day_before_month' => 1,
'date_time_format' => '%Y-%m-%d %H:%M:%S',
'default_queue' => 'General',
@@ -654,8 +646,6 @@
}
}
- my $db_type = RT->config->get('DatabaseType');
-
#print "Done setting up database content.\n";
}
Modified: rt/3.999/branches/config-in-db/lib/RT/Interface/Web/Session.pm
==============================================================================
--- rt/3.999/branches/config-in-db/lib/RT/Interface/Web/Session.pm (original)
+++ rt/3.999/branches/config-in-db/lib/RT/Interface/Web/Session.pm Sun Mar 15 01:41:49 2009
@@ -82,7 +82,7 @@
my $class
= RT->config->get('WebSessionClass')
- || $self->backends->{ RT->config->get('DatabaseType') }
+ || $self->backends->{ Jifty->config->framework('Database')->{'Driver'} }
|| 'Apache::Session::File';
eval "require $class";
die $@ if $@;
@@ -112,7 +112,7 @@
sub attributes {
- return $_[0]->backends->{ RT->config->get('DatabaseType') }
+ return $_[0]->backends->{ Jifty->config->framework('Database')->{'Driver'} }
? {
Handle => Jifty->handle->dbh,
LockHandle => Jifty->handle->dbh,
Modified: rt/3.999/branches/config-in-db/lib/RT/Model/AttachmentCollection.pm
==============================================================================
--- rt/3.999/branches/config-in-db/lib/RT/Model/AttachmentCollection.pm (original)
+++ rt/3.999/branches/config-in-db/lib/RT/Model/AttachmentCollection.pm Sun Mar 15 01:41:49 2009
@@ -164,7 +164,7 @@
);
# http://rt3.fsck.com/Ticket/Display.html?id=12483
- if ( RT->config->get('DatabaseType') ne 'Oracle' ) {
+ if ( Jifty->config->framework('Database')->{'Driver'} ne 'Oracle' ) {
$self->limit(
entry_aggregator => 'AND',
column => 'content',
Modified: rt/3.999/branches/config-in-db/lib/RT/Model/TicketCollection.pm
==============================================================================
--- rt/3.999/branches/config-in-db/lib/RT/Model/TicketCollection.pm (original)
+++ rt/3.999/branches/config-in-db/lib/RT/Model/TicketCollection.pm Sun Mar 15 01:41:49 2009
@@ -1362,7 +1362,7 @@
my $null_columns_ok;
my $fix_op = sub {
my $op = shift;
- return $op unless RT->config->get('DatabaseType') eq 'Oracle';
+ return $op unless Jifty->config->framework('Database')->{'Driver'} eq 'Oracle';
return 'MATCHES' if $op eq '=';
return 'NOT MATCHES' if $op eq '!=';
return $op;
Modified: rt/3.999/branches/config-in-db/lib/RT/Test.pm
==============================================================================
--- rt/3.999/branches/config-in-db/lib/RT/Test.pm (original)
+++ rt/3.999/branches/config-in-db/lib/RT/Test.pm Sun Mar 15 01:41:49 2009
@@ -548,7 +548,7 @@
sub db_requires_no_dba {
my $self = shift;
- my $db_type = RT->config->get('DatabaseType');
+ my $db_type = Jifty->config->framework('Database')->{'Driver'};
return 1 if $db_type eq 'SQLite';
}
Modified: rt/3.999/branches/config-in-db/lib/RT/Test/Shredder.pm
==============================================================================
--- rt/3.999/branches/config-in-db/lib/RT/Test/Shredder.pm (original)
+++ rt/3.999/branches/config-in-db/lib/RT/Test/Shredder.pm Sun Mar 15 01:41:49 2009
@@ -69,26 +69,32 @@
sub rewrite_rtconfig {
# database
- config_set( '$DatabaseType', 'SQLite' );
- config_set( '$DatabaseHost', 'localhost' );
- config_set( '$DatabaseRTHost', 'localhost' );
- config_set( '$DatabasePort', '' );
- config_set( '$DatabaseUser', 'rt_user' );
- config_set( '$Databasepassword', 'rt_pass' );
- config_set( '$DatabaseRequireSSL', undef );
+# config_set( 'DatabaseType', 'SQLite' );
+# config_set( 'DatabaseHost', 'localhost' );
+# config_set( 'DatabaseRTHost', 'localhost' );
+# config_set( 'DatabasePort', '' );
+# config_set( 'DatabaseUser', 'rt_user' );
+# config_set( 'Databasepassword', 'rt_pass' );
+# config_set( 'DatabaseRequireSSL', undef );
+#
+# # database file name
+# config_set( 'DatabaseName', db_name() );
+ Jifty->config->{'framework'}{'Database'}{'Driver'} = 'SQLite';
+ Jifty->config->{'framework'}{'Database'}{'Host'} = 'localhost';
+ Jifty->config->{'framework'}{'Database'}{'Port'} = 'SQLite';
+ Jifty->config->{'framework'}{'Database'}{'User'} = 'rt_user';
+ Jifty->config->{'framework'}{'Database'}{'Password'} = 'rt_pass';
- # database file name
- config_set( '$Databasename', db_name() );
# generic logging
- config_set( '$LogToSyslog', undef );
- config_set( '$LogToScreen', 'error' );
- config_set( '$LogStackTraces', 'crit' );
+ config_set( 'LogToSyslog', undef );
+ config_set( 'LogToScreen', 'error' );
+ config_set( 'LogStackTraces', 'crit' );
# logging to standalone file
- config_set( '$LogToFile', 'debug' );
+ config_set( 'LogToFile', 'debug' );
my $fname = File::Spec->catfile( create_tmpdir(), test_name() . ".log" );
- config_set( '$LogToFilenamed', $fname );
+ config_set( 'LogToFilenamed', $fname );
}
=head3 config_set
@@ -97,7 +103,6 @@
sub config_set {
my $opt = shift;
- $opt =~ s/^[\$\%\@]//;
RT->config->set( $opt, @_ );
}
More information about the Rt-commit
mailing list