|
| 1 | += Purpose |
| 2 | + |
| 3 | +Rack Legacy tries to provide interaction with legacy environments like |
| 4 | +PHP and CGI while still getting the Rack portability so you don't need |
| 5 | +a full Apache stack. |
| 6 | + |
| 7 | +This software is currently BETA quality. Use at your own risk. |
| 8 | + |
| 9 | += Purpose |
| 10 | + |
| 11 | +The PRIMARY use case for this software is for development of an |
| 12 | +application where Ruby is being used but there are also some legacy |
| 13 | +PHP or CGI that is running along-side the Ruby application. This |
| 14 | +middleware allows you to do that development without the full Apache |
| 15 | +stack. |
| 16 | + |
| 17 | +When you take the application to a production environment you can either |
| 18 | +leave this middleware in or use a full Apache stack to get added |
| 19 | +performance and security. |
| 20 | + |
| 21 | += USAGE |
| 22 | + |
| 23 | +== Installation |
| 24 | + |
| 25 | + gem install rack-legacy |
| 26 | + |
| 27 | +== Generic Rack Integration |
| 28 | + |
| 29 | +Put the following in your rack stack: |
| 30 | + |
| 31 | + require 'rack-legacy' |
| 32 | + use Rack::Legacy::Php, 'public' |
| 33 | + |
| 34 | +== Rails Usage |
| 35 | + |
| 36 | +In your Gemfile |
| 37 | + |
| 38 | + gem 'rack-legacy' |
| 39 | + |
| 40 | +In your application.rb: |
| 41 | + |
| 42 | + config.middleware.insert_before \ |
| 43 | + ActionDispatch::Static, Rack::Legacy::Php, Rails.public_path |
| 44 | + |
| 45 | +Rails < 3 is not well supported. This is because Rack::Static (later |
| 46 | +turned into ActionDispatch::Static) is not in the Rails stack but |
| 47 | +instead processed in the stack that loads Rails prior to Rails running. |
| 48 | +This means you cannot insert any middleware before it. This software |
| 49 | +previously had some hacks to work around this but with the release of |
| 50 | +Rails 3 the hacks where not necessary and therefore removed. |
| 51 | + |
| 52 | +If you still need to use rack-legacy on a Rails 2 app see version 0.1.5. |
| 53 | + |
| 54 | +== Pure PHP/CGI |
| 55 | + |
| 56 | +Got a project that is nothing but PHP or CGI? Run `rack_legacy` in the |
| 57 | +website root directory and it will start serving the files. |
| 58 | + |
| 59 | += LICENSE |
| 60 | + |
| 61 | +This is free and unencumbered software released into the public domain. |
| 62 | + |
| 63 | += CREDIT |
| 64 | + |
| 65 | +This gem was developed by Eric Anderson (http://pixelwareinc.com) |
| 66 | +partially via work done under Red Tusk Studios (http://redtusk.com) and |
| 67 | +Southern Web Group (http://www.southernwebgroup.com). |
0 commit comments