diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-05-01 15:48:46 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-05-01 15:48:46 +0000 |
commit | 0491488554883009dac479a3eb653fc135b08ed4 (patch) | |
tree | e11127e759b6c9b596811f9e8ba92c1dacaf2559 /public/dispatch.fcgi.example | |
parent | 785825900a37ee026bc0257d00fe3977d1b30848 (diff) | |
download | redmine-0491488554883009dac479a3eb653fc135b08ed4.tar.gz redmine-0491488554883009dac479a3eb653fc135b08ed4.zip |
Updates dispatch.fcgi.example to work with Rails3 and removes CGI handlers.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9604 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'public/dispatch.fcgi.example')
-rwxr-xr-x | public/dispatch.fcgi.example | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/public/dispatch.fcgi.example b/public/dispatch.fcgi.example index 664dbbbee..85184c446 100755 --- a/public/dispatch.fcgi.example +++ b/public/dispatch.fcgi.example @@ -1,24 +1,20 @@ #!/usr/bin/env ruby -# -# You may specify the path to the FastCGI crash log (a log of unhandled -# exceptions which forced the FastCGI instance to exit, great for debugging) -# and the number of requests to process before running garbage collection. -# -# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log -# and the GC period is nil (turned off). A reasonable number of requests -# could range from 10-100 depending on the memory footprint of your app. -# -# Example: -# # Default log path, normal GC behavior. -# RailsFCGIHandler.process! -# -# # Default log path, 50 requests between GC. -# RailsFCGIHandler.process! nil, 50 -# -# # Custom log path, normal GC behavior. -# RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log' -# -require File.dirname(__FILE__) + "/../config/environment" -require 'fcgi_handler' -RailsFCGIHandler.process! +require File.dirname(__FILE__) + '/../config/boot' +require File.dirname(__FILE__) + '/../config/environment' + +class Rack::PathInfoRewriter + def initialize(app) + @app = app + end + + def call(env) + env.delete('SCRIPT_NAME') + parts = env['REQUEST_URI'].split('?') + env['PATH_INFO'] = parts[0] + env['QUERY_STRING'] = parts[1].to_s + @app.call(env) + end +end + +Rack::Handler::FastCGI.run Rack::PathInfoRewriter.new(RedmineApp::Application) |