[Rt-commit] r11854 - in rt/branches/3.8-TESTING: bin lib/RT/Interface/Web

jesse at bestpractical.com jesse at bestpractical.com
Wed Apr 23 17:30:42 EDT 2008


Author: jesse
Date: Wed Apr 23 17:30:41 2008
New Revision: 11854

Modified:
   rt/branches/3.8-TESTING/   (props changed)
   rt/branches/3.8-TESTING/bin/standalone_httpd.in
   rt/branches/3.8-TESTING/lib/RT/Interface/Web/Standalone.pm

Log:
 r30022 at 31b:  jesse | 2008-04-23 16:16:44 -0400
  Switch the "are we in InstallMode" accessor to RT.pm 


Modified: rt/branches/3.8-TESTING/bin/standalone_httpd.in
==============================================================================
--- rt/branches/3.8-TESTING/bin/standalone_httpd.in	(original)
+++ rt/branches/3.8-TESTING/bin/standalone_httpd.in	Wed Apr 23 17:30:41 2008
@@ -52,33 +52,43 @@
 use lib( "@LOCAL_LIB_PATH@", "@RT_LIB_PATH@");
 use RT;
 RT::LoadConfig();
+RT->InitLogging();
 if (RT->Config->Get('DevelMode')) { require Module::Refresh; }
 
 RT::CheckPerlRequirements();
 
 my $port = shift @ARGV || RT->Config->Get('WebPort') || '8080';
 
-my $install_mode = 0;
 
 require RT::Handle;
 my ($integrity, $state, $msg) = RT::Handle->CheckIntegrity;
 
 unless ( $integrity ) {
-    print STDERR "We couldn't connect to DB defined in your config.\n";
-    print STDERR "We think it's a new installtion, here is error:\n\n";
-    print STDERR "$msg\n\n";
-    $install_mode = 1;
+    print STDERR <<EOF;
+    
+RT couldn't connect to the database where tickets are stored.
+If this is a new installation of RT, you should visit the URL below
+to configure RT and initialize your database.
+
+If this is an existing RT installation, this may indicate a database
+connectivity problem.
+
+The error RT got back when trying to connect to your database was:
+
+$msg
+
+EOF
+
+    RT->InstallMode(1);
 } else {
-    RT::ConnectToDatabase();
-    RT::InitSystemObjects();
-    RT::InitClasses();
-    RT::InitLogging();
-    RT::InitPlugins();
+    RT->ConnectToDatabase();
+    RT->InitSystemObjects();
+    RT->InitClasses();
+    RT->InitPlugins();
 }
 
 require RT::Interface::Web::Standalone;
 my $server = RT::Interface::Web::Standalone->new;
 $server->port($port);
-$server->install_mode( $install_mode );
 $server->run();
 

Modified: rt/branches/3.8-TESTING/lib/RT/Interface/Web/Standalone.pm
==============================================================================
--- rt/branches/3.8-TESTING/lib/RT/Interface/Web/Standalone.pm	(original)
+++ rt/branches/3.8-TESTING/lib/RT/Interface/Web/Standalone.pm	Wed Apr 23 17:30:41 2008
@@ -45,9 +45,12 @@
 # those contributions and any derivatives thereof.
 # 
 # END BPS TAGGED BLOCK }}}
-package RT::Interface::Web::Standalone;
+
 
 use strict;
+use warnings;
+package RT::Interface::Web::Standalone;
+
 use base 'HTTP::Server::Simple::Mason';
 use RT::Interface::Web::Handler;
 use RT::Interface::Web;
@@ -67,27 +70,24 @@
     return RT->Config->Get('MasonParameters');
 } 
 
-sub install_mode {
-    my $self = shift;
-    $self->{'rt_install_mode'} = shift if @_;
-    return $self->{'rt_install_mode'};
-}
-
 sub handle_request {
 
     my $self = shift;
     my $cgi = shift;
 
     Module::Refresh->refresh if RT->Config->Get('DevelMode');
-
-    RT::ConnectToDatabase() unless $self->install_mode;
-
+    RT::ConnectToDatabase() unless RT->InstallMode;
     $self->SUPER::handle_request($cgi);
     $RT::Logger->crit($@) if $@ && $RT::Logger;
     warn $@ if $@ && !$RT::Logger;
-
     RT::Interface::Web::Handler->CleanupRequest();
-
 }
 
+#sub net_server { 
+# use RT::Interface::Web::Standalone::PreFork;
+# 'RT::Interface::Web::Standalone::PreFork'
+#}
+
+
+
 1;


More information about the Rt-commit mailing list