[Rt-commit] rt branch, psgi, updated. rt-3.9.4-189-g34f0f2f

Chia-liang Kao clkao at bestpractical.com
Tue Oct 19 08:39:46 EDT 2010


The branch, psgi has been updated
       via  34f0f2f349fa86d44e9172bf51dbbc1a9a4f13d1 (commit)
      from  33e165aaef5f24e3e93f2665f7289cafa785f827 (commit)

Summary of changes:
 etc/RT_Config.pm.in                        |   51 ------------
 lib/RT/Interface/Web/Standalone.pm         |  117 ----------------------------
 lib/RT/Interface/Web/Standalone/PreFork.pm |  103 ------------------------
 lib/RT/Test.pm                             |   32 +-------
 sbin/rt-server.in                          |   11 ++-
 sbin/rt-test-dependencies.in               |   12 ---
 6 files changed, 7 insertions(+), 319 deletions(-)
 delete mode 100755 lib/RT/Interface/Web/Standalone.pm
 delete mode 100644 lib/RT/Interface/Web/Standalone/PreFork.pm

- Log -----------------------------------------------------------------
commit 34f0f2f349fa86d44e9172bf51dbbc1a9a4f13d1
Author: Chia-liang Kao <clkao at bestpractical.com>
Date:   Tue Oct 19 21:38:59 2010 +0900

    remove standalone and net::server deps

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index bf8ca2a..e35a750 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1658,57 +1658,6 @@ Set( $AllowUserAutocompleteForUnprivileged, 0 );
 
 =back
 
-=head1 L<Net::Server> (rt-server) Configuration
-
-=over 4
-
-=item C<$StandaloneMinServers>, C<$StandaloneMaxServers>
-
-The absolute minimum and maximum number of servers that will be created to
-handle requests. Having multiple servers means that serving a slow page will
-affect other users less.
-
-=cut
-
-Set($StandaloneMinServers, 1);
-Set($StandaloneMaxServers, 1);
-
-=item C<$StandaloneMinSpareServers>, C<$StandaloneMaxSpareServers>
-
-These next two options can be used to scale up and down the number of servers
-to adjust to load. These two options will respect the C<$StandaloneMinServers
-> and C<$StandaloneMaxServers options>.
-
-=cut
-
-Set($StandaloneMinSpareServers, 0);
-Set($StandaloneMaxSpareServers, 0);
-
-=item C<$StandaloneMaxRequests>
-
-This sets the absolute maximum number of requests a single server will serve.
-Setting this would be useful if, for example, memory usage slowly crawls up
-every hit.
-
-=cut
-
-#Set($StandaloneMaxRequests, 50);
-
-=item C<%NetServerOptions>
-
-C<%NetServerOptions> is a hash of additional options to use for
-L<Net::Server/DEFAULT ARGUMENTS>. For example, you could set
-reverse_lookups to get the hostnames for all users with:
-
-C<Set(%NetServerOptions, (reverse_lookups => 1));>
-
-=cut
-
-Set(%NetServerOptions, ());
-
-=back
-
-
 =head1 UTF-8 Configuration
 
 =over 4
diff --git a/lib/RT/Interface/Web/Standalone.pm b/lib/RT/Interface/Web/Standalone.pm
deleted file mode 100755
index 57158b4..0000000
--- a/lib/RT/Interface/Web/Standalone.pm
+++ /dev/null
@@ -1,117 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2010 Best Practical Solutions, LLC
-#                                          <jesse at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-
-use strict;
-use warnings;
-package RT::Interface::Web::Standalone;
-
-use base 'HTTP::Server::Simple::Mason';
-use RT::Interface::Web::Handler;
-use RT::Interface::Web;
-use URI;
-
-sub handler_class { "RT::Interface::Web::Handler" }
-
-sub setup_escapes {
-    my $self = shift;
-    my $handler = shift;
-
-    # Override HTTP::Server::Simple::Mason's version of this method to do
-    # nothing.  (RT::Interface::Web::Handler does this already for us in
-    # NewHandler.)
-} 
-
-sub default_mason_config {
-    return RT->Config->Get('MasonParameters');
-} 
-
-sub handle_request {
-    my $self = shift;
-    my $cgi = shift;
-
-    Module::Refresh->refresh if RT->Config->Get('DevelMode');
-    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 {
-    my $self = shift;
-    $self->{rt_net_server} = shift if @_;
-    return $self->{rt_net_server};
-}
-
-
-=head2  print_banner
-
-This routine prints a banner before the server request-handling loop
-starts.
-
-Methods below this point are probably not terribly useful to define
-yourself in subclasses.
-
-=cut
-
-sub print_banner {
-    my $self = shift;
-    
-    my $url = URI->new(           RT->Config->Get('WebBaseURL'));
-    $url->host('127.0.0.1') if ($url->host() eq 'localhost');
-    $url->port($self->port);
-    print(   
-            "You can connect to your server at "
-            . $url->canonical
-            . "\n" );
-
-}
-
-
-1;
diff --git a/lib/RT/Interface/Web/Standalone/PreFork.pm b/lib/RT/Interface/Web/Standalone/PreFork.pm
deleted file mode 100644
index 1987558..0000000
--- a/lib/RT/Interface/Web/Standalone/PreFork.pm
+++ /dev/null
@@ -1,103 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2010 Best Practical Solutions, LLC
-#                                          <jesse at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-
-use warnings;
-use strict;
-
-package RT::Interface::Web::Standalone::PreFork;
-use base qw/Net::Server::PreFork/;
-
-my %option_map = (
-    min_servers       => 'StandaloneMinServers',
-    max_servers       => 'StandaloneMaxServers',
-    min_spare_servers => 'StandaloneMinSpareServers',
-    max_spare_servers => 'StandaloneMaxSpareServers',
-    max_requests      => 'StandaloneMaxRequests',
-);
-
-=head2 default_values
-
-Produces the default values for L<Net::Server> configuration from RT's config
-files.
-
-=cut
-
-sub default_values {
-    my %forking = (
-        map  { $_ => RT->Config->Get( $option_map{$_} ) }
-        grep { defined( RT->Config->Get( $option_map{$_} ) ) }
-        keys %option_map,
-    );
-
-    return {
-        %forking,
-        log_level => 1,
-        RT->Config->Get('NetServerOptions')
-    };
-}
-
-=head2 post_bind_hook
-
-After binding to the specified ports, let the user know that the server is
-prepared to handle connections.
-
-=cut
-
-sub post_bind_hook {
-    my $self = shift;
-    my @ports = @{ $self->{server}->{port} };
-
-    print $0
-        . ": You can connect to your server at "
-        . (join ' , ', map { "http://localhost:$_/" } @ports)
-        . "\n";
-
-    $self->SUPER::post_bind_hook(@_);
-}
-
-1;
diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index fa94b1c..bdb04da 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -1100,7 +1100,7 @@ sub started_ok {
 
     $ENV{'RT_TEST_WEB_HANDLER'} = undef
         if $rttest_opt{actual_server} && ($ENV{'RT_TEST_WEB_HANDLER'}||'') eq 'inline';
-    my $which = $ENV{'RT_TEST_WEB_HANDLER'} || 'standalone';
+    my $which = $ENV{'RT_TEST_WEB_HANDLER'} || 'plack';
     my ($server, $variant) = split /\+/, $which, 2;
 
     my $function = 'start_'. $server .'_server';
@@ -1177,36 +1177,6 @@ sub start_inline_server {
     return ("http://localhost:$port", RT::Test::Web->new);
 }
 
-sub start_standalone_server {
-    my $self = shift;
-
-
-    require RT::Interface::Web::Standalone;
-
-    # this may happen if we start two servers in the same test process
-    unless (RT::Interface::Web::Standalone->can('test_warning_path')) {
-        require Test::HTTP::Server::Simple::StashWarnings;
-        unshift @RT::Interface::Web::Standalone::ISA,
-            'Test::HTTP::Server::Simple::StashWarnings';
-        *RT::Interface::Web::Standalone::test_warning_path = sub {
-            "/__test_warnings";
-        };
-    }
-
-    my $s = RT::Interface::Web::Standalone->new($port);
-
-    my $ret = $s->started_ok;
-    push @SERVERS, $s->pids;
-
-    $RT::Handle = RT::Handle->new;
-    $RT::Handle->dbh( undef );
-    RT->ConnectToDatabase;
-
-    # the attribute cache holds on to a stale dbh
-    delete $RT::System->{attributes};
-    return ($ret, RT::Test::Web->new);
-}
-
 sub start_apache_server {
     my $self = shift;
     my $variant = shift || 'mod_perl';
diff --git a/sbin/rt-server.in b/sbin/rt-server.in
index 87510cf..3000822 100755
--- a/sbin/rt-server.in
+++ b/sbin/rt-server.in
@@ -177,14 +177,15 @@ __END__
 
 =head1 NAME
 
-standalone_httpd - RT standalone server
+rt-server - RT standalone server
 
 =head1 SYNOPSIS
 
+    # runs prefork server listening on port 8080, requires Starlet
+    rt-server --port 8080
+
     # runs server listening on port 8080
+    rt-server -s Standalone --port 8080
+    # or
     standalone_httpd --port 8080
 
-=head1 DESCRIPTION
-
-This script runs an RT server using C<RT::Interface::Web::Standalone>
-
diff --git a/sbin/rt-test-dependencies.in b/sbin/rt-test-dependencies.in
index 5ff2055..4bf26c5 100755
--- a/sbin/rt-test-dependencies.in
+++ b/sbin/rt-test-dependencies.in
@@ -63,7 +63,6 @@ GetOptions(
     'with-ORACLE',                        'with-FASTCGI', 'with-FASTCGI-SERVER',
     'with-SPEEDYCGI',                     'with-MODPERL1',
     'with-MODPERL2',                      'with-DEV',
-    'with-STANDALONE',
 
     'with-GPG',
     'with-ICAL',
@@ -93,7 +92,6 @@ my %default = (
     'with-CLI' => 1,
     'with-MAILGATE' => 1, 
     'with-DEV' => @RT_DEVEL_MODE@, 
-    'with-STANDALONE' => 1,
     'with-GPG' => @RT_GPG@,
     'with-ICAL' => 1,
     'with-SMTP' => 1,
@@ -238,12 +236,6 @@ CGI::Emulate::PSGI
 Plack::Middleware::Test::StashWarnings
 .
 
-$deps{'STANDALONE'} = [ text_to_hash( << '.') ];
-HTTP::Server::Simple 0.34
-HTTP::Server::Simple::Mason 0.14
-Net::Server
-.
-
 $deps{'MAILGATE'} = [ text_to_hash( << '.') ];
 HTML::TreeBuilder
 HTML::FormatText
@@ -643,10 +635,6 @@ list the status of all dependencies, rather than just the missing ones.
 
     database interface and driver for sqlite (unsupported)
 
-=item  with-standalone
-
-    libraries needed to support the standalone simple pure perl server
-
 =item with-fastcgi-server
 
     libraries needed to support the external fastcgi server

-----------------------------------------------------------------------


More information about the Rt-commit mailing list