passenger 2.2.1 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (216) hide show
  1. data/Rakefile +66 -79
  2. data/bin/passenger-install-nginx-module +1 -1
  3. data/bin/passenger-memory-stats +1 -1
  4. data/bin/passenger-spawn-server +8 -2
  5. data/doc/Users guide Apache.html +33 -49
  6. data/doc/Users guide Apache.txt +28 -27
  7. data/doc/Users guide Nginx.html +9 -19
  8. data/doc/Users guide Nginx.txt +8 -20
  9. data/doc/cxxapi/Bucket_8h-source.html +1 -1
  10. data/doc/cxxapi/Configuration_8h-source.html +297 -300
  11. data/doc/cxxapi/DirectoryMapper_8h-source.html +1 -1
  12. data/doc/cxxapi/Hooks_8h-source.html +1 -1
  13. data/doc/cxxapi/annotated.html +1 -1
  14. data/doc/cxxapi/classHooks-members.html +1 -1
  15. data/doc/cxxapi/classHooks.html +1 -1
  16. data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +1 -1
  17. data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +1 -1
  18. data/doc/cxxapi/classes.html +1 -1
  19. data/doc/cxxapi/definitions_8h-source.html +1 -1
  20. data/doc/cxxapi/files.html +1 -1
  21. data/doc/cxxapi/functions.html +1 -1
  22. data/doc/cxxapi/functions_func.html +1 -1
  23. data/doc/cxxapi/graph_legend.html +1 -1
  24. data/doc/cxxapi/group__Configuration.html +1 -23
  25. data/doc/cxxapi/group__Core.html +1 -1
  26. data/doc/cxxapi/group__Hooks.html +1 -1
  27. data/doc/cxxapi/group__Support.html +1 -1
  28. data/doc/cxxapi/main.html +1 -1
  29. data/doc/cxxapi/modules.html +1 -1
  30. data/doc/users_guide_snippets/rackup_specifications.txt +4 -2
  31. data/ext/apache2/Configuration.h +0 -3
  32. data/ext/apache2/Hooks.cpp +5 -3
  33. data/ext/common/ApplicationPoolServer.h +1 -0
  34. data/ext/common/ApplicationPoolServerExecutable.cpp +5 -2
  35. data/ext/common/SpawnManager.h +1 -0
  36. data/ext/common/Utils.cpp +22 -23
  37. data/ext/common/Utils.h +32 -21
  38. data/ext/common/Version.h +31 -0
  39. data/ext/nginx/ContentHandler.c +61 -8
  40. data/ext/nginx/HelperServer.cpp +3 -0
  41. data/ext/nginx/HttpStatusExtractor.h +185 -0
  42. data/ext/nginx/StaticContentHandler.c +18 -3
  43. data/ext/nginx/config +2 -1
  44. data/ext/nginx/ngx_http_passenger_module.c +21 -15
  45. data/ext/oxt/backtrace.cpp +4 -2
  46. data/ext/oxt/spin_lock.hpp +3 -3
  47. data/lib/phusion_passenger/abstract_request_handler.rb +5 -3
  48. data/lib/phusion_passenger/admin_tools/control_process.rb +6 -1
  49. data/lib/phusion_passenger/constants.rb +2 -2
  50. data/lib/phusion_passenger/rack/application_spawner.rb +2 -1
  51. data/lib/phusion_passenger/rack/request_handler.rb +45 -35
  52. data/lib/phusion_passenger/templates/nginx/config_snippets.txt.erb +1 -1
  53. data/lib/phusion_passenger/utils.rb +13 -3
  54. data/misc/rake/cplusplus.rb +7 -0
  55. data/test/ApplicationPoolServer_ApplicationPoolTest.cpp +2 -0
  56. data/test/ApplicationPoolTest.cpp +39 -62
  57. data/test/CxxTestMain.cpp +6 -6
  58. data/test/HttpStatusExtractorTest.cpp +17 -0
  59. data/test/StandardApplicationPoolTest.cpp +2 -0
  60. data/test/UtilsTest.cpp +17 -28
  61. data/test/ruby/abstract_request_handler_spec.rb +3 -7
  62. data/test/ruby/utils_spec.rb +18 -13
  63. data/test/ruby/wsgi/application_spawner_spec.rb +5 -9
  64. data/test/stub/railsapp/app/controllers/{bar_controller_1.rb → bar_controller.rb} +0 -0
  65. data/test/stub/railsapp/app/controllers/bar_controller_1.txt +5 -0
  66. data/test/stub/railsapp/app/controllers/{bar_controller_2.rb → bar_controller_2.txt} +0 -0
  67. data/test/support/Support.h +20 -0
  68. data/test/support/config.rb +13 -0
  69. data/vendor/README +4 -3
  70. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/COPYING +1 -1
  71. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/KNOWN-ISSUES +0 -0
  72. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/README +54 -7
  73. data/vendor/rack-1.0.0-git/Rakefile +164 -0
  74. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack.rb +7 -3
  75. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/adapter/camping.rb +0 -0
  76. data/vendor/rack-1.0.0-git/lib/rack/auth/abstract/handler.rb +37 -0
  77. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/abstract/request.rb +0 -0
  78. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/basic.rb +0 -0
  79. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/digest/md5.rb +1 -1
  80. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/digest/nonce.rb +0 -0
  81. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/digest/params.rb +0 -0
  82. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/digest/request.rb +2 -2
  83. data/vendor/rack-1.0.0-git/lib/rack/auth/openid.rb +480 -0
  84. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/builder.rb +1 -5
  85. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/cascade.rb +0 -0
  86. data/vendor/rack-1.0.0-git/lib/rack/chunked.rb +49 -0
  87. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/commonlogger.rb +0 -0
  88. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/conditionalget.rb +4 -0
  89. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/content_length.rb +7 -3
  90. data/vendor/rack-1.0.0-git/lib/rack/content_type.rb +23 -0
  91. data/vendor/rack-1.0.0-git/lib/rack/deflater.rb +96 -0
  92. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/directory.rb +5 -2
  93. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/file.rb +4 -1
  94. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler.rb +22 -1
  95. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/cgi.rb +7 -3
  96. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/evented_mongrel.rb +0 -0
  97. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/fastcgi.rb +26 -24
  98. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/lsws.rb +7 -4
  99. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/mongrel.rb +5 -3
  100. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/scgi.rb +5 -3
  101. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/swiftiplied_mongrel.rb +0 -0
  102. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/thin.rb +3 -0
  103. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/webrick.rb +11 -5
  104. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/head.rb +0 -0
  105. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/lint.rb +138 -66
  106. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/lobster.rb +0 -0
  107. data/vendor/rack-1.0.0-git/lib/rack/lock.rb +16 -0
  108. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/methodoverride.rb +0 -0
  109. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/mime.rb +4 -4
  110. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/mock.rb +42 -5
  111. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/recursive.rb +0 -0
  112. data/vendor/rack-1.0.0-git/lib/rack/reloader.rb +106 -0
  113. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/request.rb +46 -10
  114. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/response.rb +15 -3
  115. data/vendor/rack-1.0.0-git/lib/rack/rewindable_input.rb +98 -0
  116. data/vendor/rack-1.0.0-git/lib/rack/session/abstract/id.rb +142 -0
  117. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/session/cookie.rb +2 -0
  118. data/vendor/rack-1.0.0-git/lib/rack/session/memcache.rb +109 -0
  119. data/vendor/rack-1.0.0-git/lib/rack/session/pool.rb +100 -0
  120. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/showexceptions.rb +2 -1
  121. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/showstatus.rb +1 -1
  122. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/static.rb +0 -0
  123. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/urlmap.rb +12 -5
  124. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/utils.rb +212 -65
  125. metadata +71 -170
  126. data/doc/rdoc/classes/ConditionVariable.html +0 -194
  127. data/doc/rdoc/classes/Exception.html +0 -120
  128. data/doc/rdoc/classes/GC.html +0 -113
  129. data/doc/rdoc/classes/IO.html +0 -169
  130. data/doc/rdoc/classes/PhusionPassenger.html +0 -238
  131. data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +0 -153
  132. data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +0 -506
  133. data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +0 -692
  134. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerAlreadyStarted.html +0 -97
  135. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerError.html +0 -96
  136. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerNotStarted.html +0 -97
  137. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/UnknownMessage.html +0 -96
  138. data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +0 -598
  139. data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +0 -140
  140. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess.html +0 -264
  141. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess/Instance.html +0 -138
  142. data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +0 -154
  143. data/doc/rdoc/classes/PhusionPassenger/Application.html +0 -283
  144. data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +0 -172
  145. data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +0 -145
  146. data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +0 -175
  147. data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +0 -141
  148. data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +0 -92
  149. data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +0 -489
  150. data/doc/rdoc/classes/PhusionPassenger/NativeSupport.html +0 -350
  151. data/doc/rdoc/classes/PhusionPassenger/Rack.html +0 -91
  152. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +0 -185
  153. data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +0 -184
  154. data/doc/rdoc/classes/PhusionPassenger/Railz.html +0 -95
  155. data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner.html +0 -419
  156. data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner/Error.html +0 -98
  157. data/doc/rdoc/classes/PhusionPassenger/Railz/CGIFixed.html +0 -200
  158. data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner.html +0 -443
  159. data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner/Error.html +0 -98
  160. data/doc/rdoc/classes/PhusionPassenger/Railz/RequestHandler.html +0 -154
  161. data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +0 -402
  162. data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +0 -125
  163. data/doc/rdoc/classes/PhusionPassenger/Utils.html +0 -694
  164. data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +0 -140
  165. data/doc/rdoc/classes/PhusionPassenger/WSGI.html +0 -89
  166. data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +0 -188
  167. data/doc/rdoc/classes/PlatformInfo.html +0 -831
  168. data/doc/rdoc/classes/RakeExtensions.html +0 -197
  169. data/doc/rdoc/classes/Signal.html +0 -134
  170. data/doc/rdoc/created.rid +0 -1
  171. data/doc/rdoc/files/DEVELOPERS_TXT.html +0 -240
  172. data/doc/rdoc/files/README.html +0 -157
  173. data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +0 -92
  174. data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +0 -129
  175. data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +0 -131
  176. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +0 -126
  177. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +0 -130
  178. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +0 -129
  179. data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +0 -122
  180. data/doc/rdoc/files/lib/phusion_passenger/application_rb.html +0 -127
  181. data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +0 -126
  182. data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +0 -122
  183. data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +0 -134
  184. data/doc/rdoc/files/lib/phusion_passenger/events_rb.html +0 -122
  185. data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +0 -122
  186. data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +0 -126
  187. data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +0 -122
  188. data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +0 -122
  189. data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +0 -127
  190. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +0 -133
  191. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +0 -126
  192. data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +0 -143
  193. data/doc/rdoc/files/lib/phusion_passenger/railz/cgi_fixed_rb.html +0 -126
  194. data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +0 -145
  195. data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +0 -127
  196. data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +0 -122
  197. data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +0 -161
  198. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +0 -175
  199. data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +0 -129
  200. data/doc/rdoc/files/misc/rake/extensions_rb.html +0 -130
  201. data/doc/rdoc/fr_class_index.html +0 -90
  202. data/doc/rdoc/fr_file_index.html +0 -76
  203. data/doc/rdoc/fr_method_index.html +0 -195
  204. data/doc/rdoc/index.html +0 -26
  205. data/doc/rdoc/rdoc-style.css +0 -187
  206. data/vendor/rack-0.9.1/AUTHORS +0 -8
  207. data/vendor/rack-0.9.1/ChangeLog +0 -1423
  208. data/vendor/rack-0.9.1/Rakefile +0 -188
  209. data/vendor/rack-0.9.1/SPEC +0 -129
  210. data/vendor/rack-0.9.1/lib/rack/auth/abstract/handler.rb +0 -28
  211. data/vendor/rack-0.9.1/lib/rack/auth/openid.rb +0 -438
  212. data/vendor/rack-0.9.1/lib/rack/deflater.rb +0 -87
  213. data/vendor/rack-0.9.1/lib/rack/reloader.rb +0 -64
  214. data/vendor/rack-0.9.1/lib/rack/session/abstract/id.rb +0 -153
  215. data/vendor/rack-0.9.1/lib/rack/session/memcache.rb +0 -97
  216. data/vendor/rack-0.9.1/lib/rack/session/pool.rb +0 -73
@@ -1,98 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
- <html>
6
- <head>
7
- <title>Class: PhusionPassenger::Railz::FrameworkSpawner::Error</title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
- <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
10
-
11
- <script language="JavaScript" type="text/javascript">
12
- // <![CDATA[
13
-
14
- function toggleSource( id )
15
- {
16
- var elem
17
- var link
18
-
19
- if( document.getElementById )
20
- {
21
- elem = document.getElementById( id )
22
- link = document.getElementById( "l_" + id )
23
- }
24
- else if ( document.all )
25
- {
26
- elem = eval( "document.all." + id )
27
- link = eval( "document.all.l_" + id )
28
- }
29
- else
30
- return false;
31
-
32
- if( elem.style.display == "block" )
33
- {
34
- elem.style.display = "none"
35
- link.innerHTML = "show source"
36
- }
37
- else
38
- {
39
- elem.style.display = "block"
40
- link.innerHTML = "hide source"
41
- }
42
- }
43
-
44
- function openCode( url )
45
- {
46
- window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
47
- }
48
- // ]]>
49
- </script>
50
- </head>
51
-
52
- <body>
53
- <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
54
- <td class="file-title"><span class="file-title-prefix">Class</span><br />PhusionPassenger::Railz::FrameworkSpawner::Error</td>
55
- <td align="right">
56
- <table cellspacing="0" cellpadding="2">
57
- <tr valign="top">
58
- <td>In:</td>
59
- <td>
60
- <a href="../../../../files/lib/phusion_passenger/railz/framework_spawner_rb.html">lib/phusion_passenger/railz/framework_spawner.rb</a>
61
- </td>
62
- </tr>
63
- <tr>
64
- <td>Parent:</td>
65
- <td>
66
- AbstractServer::ServerError
67
- </td>
68
- </tr>
69
- </table>
70
- </td>
71
- </tr>
72
- </table>
73
- <!-- banner header -->
74
-
75
- <div id="bodyContent">
76
- <div id="content">
77
-
78
- <div class="description"><p>
79
- This exception means that the <a
80
- href="../FrameworkSpawner.html">FrameworkSpawner</a> server process exited
81
- unexpectedly.
82
- </p>
83
- </div>
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
- </div>
94
-
95
- </div>
96
-
97
- </body>
98
- </html>
@@ -1,154 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
- <html>
6
- <head>
7
- <title>Class: PhusionPassenger::Railz::RequestHandler</title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
10
-
11
- <script language="JavaScript" type="text/javascript">
12
- // <![CDATA[
13
-
14
- function toggleSource( id )
15
- {
16
- var elem
17
- var link
18
-
19
- if( document.getElementById )
20
- {
21
- elem = document.getElementById( id )
22
- link = document.getElementById( "l_" + id )
23
- }
24
- else if ( document.all )
25
- {
26
- elem = eval( "document.all." + id )
27
- link = eval( "document.all.l_" + id )
28
- }
29
- else
30
- return false;
31
-
32
- if( elem.style.display == "block" )
33
- {
34
- elem.style.display = "none"
35
- link.innerHTML = "show source"
36
- }
37
- else
38
- {
39
- elem.style.display = "block"
40
- link.innerHTML = "hide source"
41
- }
42
- }
43
-
44
- function openCode( url )
45
- {
46
- window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
47
- }
48
- // ]]>
49
- </script>
50
- </head>
51
-
52
- <body>
53
- <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
54
- <td class="file-title"><span class="file-title-prefix">Class</span><br />PhusionPassenger::Railz::RequestHandler</td>
55
- <td align="right">
56
- <table cellspacing="0" cellpadding="2">
57
- <tr valign="top">
58
- <td>In:</td>
59
- <td>
60
- <a href="../../../files/lib/phusion_passenger/railz/request_handler_rb.html">lib/phusion_passenger/railz/request_handler.rb</a>
61
- </td>
62
- </tr>
63
- <tr>
64
- <td>Parent:</td>
65
- <td>
66
- AbstractRequestHandler
67
- </td>
68
- </tr>
69
- </table>
70
- </td>
71
- </tr>
72
- </table>
73
- <!-- banner header -->
74
-
75
- <div id="bodyContent">
76
- <div id="content">
77
-
78
- <div class="description"><p>
79
- A request handler for Ruby on Rails applications.
80
- </p>
81
- </div>
82
-
83
-
84
-
85
- <div class="sectiontitle">Methods</div>
86
- <ul>
87
- <li><a href="#M000052">new</a></li>
88
- <li><a href="#M000053">process_request</a></li>
89
- </ul>
90
-
91
-
92
-
93
-
94
- <div class="sectiontitle">Constants</div>
95
- <table border='0' cellpadding='5'>
96
- <tr valign='top'>
97
- <td class="attr-name">NINJA_PATCHING_LOCK</td>
98
- <td>=</td>
99
- <td class="attr-value">Mutex.new</td>
100
- </tr>
101
- </table>
102
-
103
-
104
- <div class="sectiontitle">Public Class methods</div>
105
- <div class="method">
106
- <div class="title">
107
- <a name="M000052"></a><b>new</b>(owner_pipe, options = {})
108
- </div>
109
- <div class="sourcecode">
110
- <p class="source-link">[ <a href="javascript:toggleSource('M000052_source')" id="l_M000052_source">show source</a> ]</p>
111
- <div id="M000052_source" class="dyn-source">
112
- <pre>
113
- <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/request_handler.rb, line 34</span>
114
- 34: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">owner_pipe</span>, <span class="ruby-identifier">options</span> = {})
115
- 35: <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">owner_pipe</span>, <span class="ruby-identifier">options</span>)
116
- 36: <span class="ruby-constant">NINJA_PATCHING_LOCK</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
117
- 37: <span class="ruby-identifier">ninja_patch_action_controller</span>
118
- 38: <span class="ruby-keyword kw">end</span>
119
- 39: <span class="ruby-keyword kw">end</span>
120
- </pre>
121
- </div>
122
- </div>
123
- </div>
124
- <div class="sectiontitle">Protected Instance methods</div>
125
- <div class="method">
126
- <div class="title">
127
- <a name="M000053"></a><b>process_request</b>(headers, input, output)
128
- </div>
129
- <div class="description">
130
- <p>
131
- Overrided method.
132
- </p>
133
- </div>
134
- <div class="sourcecode">
135
- <p class="source-link">[ <a href="javascript:toggleSource('M000053_source')" id="l_M000053_source">show source</a> ]</p>
136
- <div id="M000053_source" class="dyn-source">
137
- <pre>
138
- <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/request_handler.rb, line 43</span>
139
- 43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_request</span>(<span class="ruby-identifier">headers</span>, <span class="ruby-identifier">input</span>, <span class="ruby-identifier">output</span>)
140
- 44: <span class="ruby-identifier">cgi</span> = <span class="ruby-constant">CGIFixed</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">headers</span>, <span class="ruby-identifier">input</span>, <span class="ruby-identifier">output</span>)
141
- 45: <span class="ruby-operator">::</span><span class="ruby-constant">Dispatcher</span>.<span class="ruby-identifier">dispatch</span>(<span class="ruby-identifier">cgi</span>,
142
- 46: <span class="ruby-operator">::</span><span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">CgiRequest</span><span class="ruby-operator">::</span><span class="ruby-constant">DEFAULT_SESSION_OPTIONS</span>,
143
- 47: <span class="ruby-identifier">cgi</span>.<span class="ruby-identifier">stdoutput</span>)
144
- 48: <span class="ruby-keyword kw">end</span>
145
- </pre>
146
- </div>
147
- </div>
148
- </div>
149
- </div>
150
-
151
- </div>
152
-
153
- </body>
154
- </html>
@@ -1,402 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
- <html>
6
- <head>
7
- <title>Class: PhusionPassenger::SpawnManager</title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
10
-
11
- <script language="JavaScript" type="text/javascript">
12
- // <![CDATA[
13
-
14
- function toggleSource( id )
15
- {
16
- var elem
17
- var link
18
-
19
- if( document.getElementById )
20
- {
21
- elem = document.getElementById( id )
22
- link = document.getElementById( "l_" + id )
23
- }
24
- else if ( document.all )
25
- {
26
- elem = eval( "document.all." + id )
27
- link = eval( "document.all.l_" + id )
28
- }
29
- else
30
- return false;
31
-
32
- if( elem.style.display == "block" )
33
- {
34
- elem.style.display = "none"
35
- link.innerHTML = "show source"
36
- }
37
- else
38
- {
39
- elem.style.display = "block"
40
- link.innerHTML = "hide source"
41
- }
42
- }
43
-
44
- function openCode( url )
45
- {
46
- window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
47
- }
48
- // ]]>
49
- </script>
50
- </head>
51
-
52
- <body>
53
- <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
54
- <td class="file-title"><span class="file-title-prefix">Class</span><br />PhusionPassenger::SpawnManager</td>
55
- <td align="right">
56
- <table cellspacing="0" cellpadding="2">
57
- <tr valign="top">
58
- <td>In:</td>
59
- <td>
60
- <a href="../../files/lib/phusion_passenger/spawn_manager_rb.html">lib/phusion_passenger/spawn_manager.rb</a>
61
- </td>
62
- </tr>
63
- <tr>
64
- <td>Parent:</td>
65
- <td>
66
- <a href="AbstractServer.html">
67
- AbstractServer
68
- </a>
69
- </td>
70
- </tr>
71
- </table>
72
- </td>
73
- </tr>
74
- </table>
75
- <!-- banner header -->
76
-
77
- <div id="bodyContent">
78
- <div id="content">
79
-
80
- <div class="description"><p>
81
- The spawn manager is capable of spawning Ruby on Rails or <a
82
- href="Rack.html">Rack</a> application instances. It acts like a simple
83
- fascade for the rest of the spawn manager system.
84
- </p>
85
- <p>
86
- <b>Note</b>: <a href="SpawnManager.html">SpawnManager</a> may only be
87
- started synchronously with <a
88
- href="AbstractServer.html#M000127">AbstractServer#start_synchronously</a>.
89
- Starting asynchronously has not been tested. Don&#8216;t forget to call <a
90
- href="SpawnManager.html#M000115">cleanup</a> after the server&#8216;s main
91
- loop has finished.
92
- </p>
93
- <h2>Ruby on Rails optimizations</h2>
94
- <p>
95
- Spawning a Ruby on Rails application is usually slow. But <a
96
- href="SpawnManager.html">SpawnManager</a> will preload and cache Ruby on
97
- Rails frameworks, as well as application code, so subsequent spawns will be
98
- very fast.
99
- </p>
100
- <p>
101
- Internally, <a href="SpawnManager.html">SpawnManager</a> uses <a
102
- href="Railz/FrameworkSpawner.html">Railz::FrameworkSpawner</a> to preload
103
- and cache Ruby on Rails frameworks. <a
104
- href="Railz/FrameworkSpawner.html">Railz::FrameworkSpawner</a>, in turn,
105
- uses <a href="Railz/ApplicationSpawner.html">Railz::ApplicationSpawner</a>
106
- to preload and cache application code.
107
- </p>
108
- <p>
109
- In case you&#8216;re wondering why the namespace is &quot;<a
110
- href="Railz.html">Railz</a>&quot; and not &quot;Rails&quot;: it&#8216;s to
111
- work around an obscure bug in ActiveSupport&#8216;s Dispatcher.
112
- </p>
113
- </div>
114
-
115
-
116
-
117
- <div class="sectiontitle">Methods</div>
118
- <ul>
119
- <li><a href="#M000115">cleanup</a></li>
120
- <li><a href="#M000112">new</a></li>
121
- <li><a href="#M000114">reload</a></li>
122
- <li><a href="#M000113">spawn_application</a></li>
123
- </ul>
124
-
125
- <div class="sectiontitle">Included Modules</div>
126
- <ul>
127
- <li><a href="Utils.html">Utils</a></li>
128
- </ul>
129
-
130
-
131
-
132
-
133
-
134
- <div class="sectiontitle">Public Class methods</div>
135
- <div class="method">
136
- <div class="title">
137
- <a name="M000112"></a><b>new</b>()
138
- </div>
139
- <div class="sourcecode">
140
- <p class="source-link">[ <a href="javascript:toggleSource('M000112_source')" id="l_M000112_source">show source</a> ]</p>
141
- <div id="M000112_source" class="dyn-source">
142
- <pre>
143
- <span class="ruby-comment cmt"># File lib/phusion_passenger/spawn_manager.rb, line 60</span>
144
- 60: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
145
- 61: <span class="ruby-keyword kw">super</span>()
146
- 62: <span class="ruby-ivar">@spawners</span> = <span class="ruby-constant">AbstractServerCollection</span>.<span class="ruby-identifier">new</span>
147
- 63: <span class="ruby-identifier">define_message_handler</span>(<span class="ruby-identifier">:spawn_application</span>, <span class="ruby-identifier">:handle_spawn_application</span>)
148
- 64: <span class="ruby-identifier">define_message_handler</span>(<span class="ruby-identifier">:reload</span>, <span class="ruby-identifier">:handle_reload</span>)
149
- 65: <span class="ruby-identifier">define_signal_handler</span>(<span class="ruby-value str">'SIGHUP'</span>, <span class="ruby-identifier">:reload</span>)
150
- 66:
151
- 67: <span class="ruby-comment cmt"># Start garbage collector in order to free up some existing</span>
152
- 68: <span class="ruby-comment cmt"># heap slots. This prevents the heap from growing unnecessarily</span>
153
- 69: <span class="ruby-comment cmt"># during the startup phase.</span>
154
- 70: <span class="ruby-constant">GC</span>.<span class="ruby-identifier">start</span>
155
- 71: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">GC</span>.<span class="ruby-identifier">copy_on_write_friendly?</span>
156
- 72: <span class="ruby-comment cmt"># Preload libraries for copy-on-write semantics.</span>
157
- 73: <span class="ruby-identifier">require</span> <span class="ruby-value str">'base64'</span>
158
- 74: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/application'</span>
159
- 75: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/railz/framework_spawner'</span>
160
- 76: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/railz/application_spawner'</span>
161
- 77: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/rack/application_spawner'</span>
162
- 78: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/html_template'</span>
163
- 79: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/platform_info'</span>
164
- 80: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/exceptions'</span>
165
- 81:
166
- 82: <span class="ruby-comment cmt"># Commonly used libraries.</span>
167
- 83: [<span class="ruby-value str">'mysql'</span>, <span class="ruby-value str">'sqlite3'</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">lib</span><span class="ruby-operator">|</span>
168
- 84: <span class="ruby-keyword kw">begin</span>
169
- 85: <span class="ruby-identifier">require</span> <span class="ruby-identifier">lib</span>
170
- 86: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">LoadError</span>
171
- 87: <span class="ruby-comment cmt"># Do nothing; ignore if not present.</span>
172
- 88: <span class="ruby-keyword kw">end</span>
173
- 89: <span class="ruby-keyword kw">end</span>
174
- 90: <span class="ruby-keyword kw">end</span>
175
- 91: <span class="ruby-keyword kw">end</span>
176
- </pre>
177
- </div>
178
- </div>
179
- </div>
180
- <div class="sectiontitle">Public Instance methods</div>
181
- <div class="method">
182
- <div class="title">
183
- <a name="M000115"></a><b>cleanup</b>()
184
- </div>
185
- <div class="description">
186
- <p>
187
- Cleanup resources. Should be called when this <a
188
- href="SpawnManager.html">SpawnManager</a> is no longer needed.
189
- </p>
190
- </div>
191
- <div class="sourcecode">
192
- <p class="source-link">[ <a href="javascript:toggleSource('M000115_source')" id="l_M000115_source">show source</a> ]</p>
193
- <div id="M000115_source" class="dyn-source">
194
- <pre>
195
- <span class="ruby-comment cmt"># File lib/phusion_passenger/spawn_manager.rb, line 214</span>
196
- 214: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cleanup</span>
197
- 215: <span class="ruby-ivar">@spawners</span>.<span class="ruby-identifier">cleanup</span>
198
- 216: <span class="ruby-keyword kw">end</span>
199
- </pre>
200
- </div>
201
- </div>
202
- </div>
203
- <div class="method">
204
- <div class="title">
205
- <a name="M000114"></a><b>reload</b>(app_root = nil)
206
- </div>
207
- <div class="description">
208
- <p>
209
- Remove the cached application instances at the given application root. If
210
- nil is specified as application root, then all cached application instances
211
- will be removed, no matter the application root.
212
- </p>
213
- <p>
214
- <b>Long description:</b> <a href="Application.html">Application</a> code
215
- might be cached in memory. But once it a while, it will be necessary to <a
216
- href="SpawnManager.html#M000114">reload</a> the code for an application,
217
- such as after deploying a <a href="SpawnManager.html#M000112">new</a>
218
- version of the application. This method makes sure that any cached
219
- application code is removed, so that the next time an application instance
220
- is spawned, the application code will be freshly loaded into memory.
221
- </p>
222
- <p>
223
- Raises AbstractServer::SpawnError if something went wrong.
224
- </p>
225
- </div>
226
- <div class="sourcecode">
227
- <p class="source-link">[ <a href="javascript:toggleSource('M000114_source')" id="l_M000114_source">show source</a> ]</p>
228
- <div id="M000114_source" class="dyn-source">
229
- <pre>
230
- <span class="ruby-comment cmt"># File lib/phusion_passenger/spawn_manager.rb, line 187</span>
231
- 187: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reload</span>(<span class="ruby-identifier">app_root</span> = <span class="ruby-keyword kw">nil</span>)
232
- 188: <span class="ruby-ivar">@spawners</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
233
- 189: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">app_root</span>
234
- 190: <span class="ruby-comment cmt"># Delete associated ApplicationSpawner.</span>
235
- 191: <span class="ruby-ivar">@spawners</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-node">&quot;app:#{app_root}&quot;</span>)
236
- 192: <span class="ruby-keyword kw">else</span>
237
- 193: <span class="ruby-comment cmt"># Delete all ApplicationSpawners.</span>
238
- 194: <span class="ruby-identifier">keys_to_delete</span> = []
239
- 195: <span class="ruby-ivar">@spawners</span>.<span class="ruby-identifier">each_pair</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">spawner</span><span class="ruby-operator">|</span>
240
- 196: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">spawner</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Railz</span><span class="ruby-operator">::</span><span class="ruby-constant">ApplicationSpawner</span>)
241
- 197: <span class="ruby-identifier">keys_to_delete</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">key</span>
242
- 198: <span class="ruby-keyword kw">end</span>
243
- 199: <span class="ruby-keyword kw">end</span>
244
- 200: <span class="ruby-identifier">keys_to_delete</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
245
- 201: <span class="ruby-ivar">@spawners</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>)
246
- 202: <span class="ruby-keyword kw">end</span>
247
- 203: <span class="ruby-keyword kw">end</span>
248
- 204: <span class="ruby-ivar">@spawners</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">spawner</span><span class="ruby-operator">|</span>
249
- 205: <span class="ruby-comment cmt"># Reload all FrameworkSpawners.</span>
250
- 206: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">spawner</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:reload</span>)
251
- 207: <span class="ruby-identifier">spawner</span>.<span class="ruby-identifier">reload</span>(<span class="ruby-identifier">app_root</span>)
252
- 208: <span class="ruby-keyword kw">end</span>
253
- 209: <span class="ruby-keyword kw">end</span>
254
- 210: <span class="ruby-keyword kw">end</span>
255
- 211: <span class="ruby-keyword kw">end</span>
256
- </pre>
257
- </div>
258
- </div>
259
- </div>
260
- <div class="method">
261
- <div class="title">
262
- <a name="M000113"></a><b>spawn_application</b>(options)
263
- </div>
264
- <div class="description">
265
- <p>
266
- Spawn an application with the given spawn options. When successful, an <a
267
- href="Application.html">Application</a> object will be returned, which
268
- represents the spawned application. At least one option must be given:
269
- <tt>app_root</tt>. This is the application&#8216;s root folder.
270
- </p>
271
- <p>
272
- Other options are:
273
- </p>
274
- <dl>
275
- <dt>&#8216;lower_privilege&#8217;, &#8216;lowest_user&#8217; and &#8216;environment&#8216;</dt><dd>See Railz::ApplicationSpawner.new for an explanation of these options.
276
-
277
- </dd>
278
- <dt>&#8216;app_type&#8216;</dt><dd>What kind of application is being spawned. Either &quot;rails&quot;
279
- (default), &quot;rack&quot; or &quot;wsgi&quot;.
280
-
281
- </dd>
282
- <dt>&#8216;spawn_method&#8216;</dt><dd>May be one of &quot;smart&quot;, &quot;smart-lv2&quot; or
283
- &quot;conservative&quot;. When &quot;smart&quot; is specified, <a
284
- href="SpawnManager.html">SpawnManager</a> will internally cache the code of
285
- Rails applications, in order to speed up future spawning attempts. This
286
- implies that, if you&#8216;ve changed the application&#8216;s code, you
287
- must do one of these things:
288
-
289
- <ul>
290
- <li>Restart this <a href="SpawnManager.html">SpawnManager</a> by calling <a
291
- href="AbstractServer.html#M000128">AbstractServer#stop</a>, then <a
292
- href="AbstractServer.html#M000126">AbstractServer#start</a>.
293
-
294
- </li>
295
- <li>Reload the application by calling <a
296
- href="SpawnManager.html#M000114">reload</a> with the correct app_root
297
- argument.
298
-
299
- </li>
300
- </ul>
301
- <p>
302
- &quot;smart&quot; caches the Rails framework code in a framework spawner
303
- server, and application code in an application spawner server. Sometimes it
304
- is desirable to skip the framework spawning and going directly for the
305
- application spawner instead. The &quot;smart-lv2&quot; method allows you to
306
- do that.
307
- </p>
308
- <p>
309
- Caching however can be incompatible with some applications. The
310
- &quot;conservative&quot; spawning method does not involve any caching at
311
- all. Spawning will be slower, but is guaranteed to be compatible with all
312
- applications.
313
- </p>
314
- <p>
315
- The default spawn method is &quot;smart-lv2&quot;.
316
- </p>
317
- </dd>
318
- <dt>&#8216;framework_spawner_timeout&#8217; and &#8216;app_spawner_timeout&#8216;</dt><dd>These options allow you to specify the maximum idle timeout, in seconds, of
319
- the framework spawner servers and application spawner servers that will be
320
- started under the hood. These options are only used if <tt>app_type</tt>
321
- equals &quot;rails&quot;.
322
-
323
- <p>
324
- A timeout of 0 means that the spawner server should never idle timeout. A
325
- timeout of -1 means that the default timeout value should be used. The
326
- default value is -1.
327
- </p>
328
- </dd>
329
- </dl>
330
- <p>
331
- <b>Exceptions:</b>
332
- </p>
333
- <ul>
334
- <li><a href="InvalidPath.html">InvalidPath</a>: <tt>app_root</tt> doesn&#8216;t
335
- appear to be a valid Ruby on Rails application root.
336
-
337
- </li>
338
- <li><a href="VersionNotFound.html">VersionNotFound</a>: The Ruby on Rails
339
- framework version that the given application requires is not installed.
340
-
341
- </li>
342
- <li><a href="AbstractServer/ServerError.html">AbstractServer::ServerError</a>:
343
- One of the server processes exited unexpectedly.
344
-
345
- </li>
346
- <li><a href="FrameworkInitError.html">FrameworkInitError</a>: The Ruby on Rails
347
- framework that the application requires could not be loaded.
348
-
349
- </li>
350
- <li><a href="AppInitError.html">AppInitError</a>: The application raised an
351
- exception or called exit() during startup.
352
-
353
- </li>
354
- </ul>
355
- </div>
356
- <div class="sourcecode">
357
- <p class="source-link">[ <a href="javascript:toggleSource('M000113_source')" id="l_M000113_source">show source</a> ]</p>
358
- <div id="M000113_source" class="dyn-source">
359
- <pre>
360
- <span class="ruby-comment cmt"># File lib/phusion_passenger/spawn_manager.rb, line 141</span>
361
- 141: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">spawn_application</span>(<span class="ruby-identifier">options</span>)
362
- 142: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_root&quot;</span>]
363
- 143: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;The 'app_root' option must be given.&quot;</span>
364
- 144: <span class="ruby-keyword kw">end</span>
365
- 145: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">sanitize_spawn_options</span>(<span class="ruby-identifier">options</span>)
366
- 146:
367
- 147: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_type&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;rails&quot;</span>
368
- 148: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">defined?</span>(<span class="ruby-constant">Railz</span><span class="ruby-operator">::</span><span class="ruby-constant">FrameworkSpawner</span>)
369
- 149: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/application'</span>
370
- 150: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/railz/framework_spawner'</span>
371
- 151: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/railz/application_spawner'</span>
372
- 152: <span class="ruby-keyword kw">end</span>
373
- 153: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">spawn_rails_application</span>(<span class="ruby-identifier">options</span>)
374
- 154: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_type&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;rack&quot;</span>
375
- 155: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">defined?</span>(<span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">ApplicationSpawner</span>)
376
- 156: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/rack/application_spawner'</span>
377
- 157: <span class="ruby-keyword kw">end</span>
378
- 158: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">ApplicationSpawner</span>.<span class="ruby-identifier">spawn_application</span>(
379
- 159: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_root&quot;</span>], <span class="ruby-identifier">options</span>
380
- 160: )
381
- 161: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_type&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;wsgi&quot;</span>
382
- 162: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/wsgi/application_spawner'</span>
383
- 163: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">WSGI</span><span class="ruby-operator">::</span><span class="ruby-constant">ApplicationSpawner</span>.<span class="ruby-identifier">spawn_application</span>(
384
- 164: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_root&quot;</span>],
385
- 165: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;lower_privilege&quot;</span>],
386
- 166: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;lowest_user&quot;</span>],
387
- 167: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;environment&quot;</span>]
388
- 168: )
389
- 169: <span class="ruby-keyword kw">else</span>
390
- 170: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Unknown 'app_type' value '#{options[&quot;app_type&quot;]}'.&quot;</span>
391
- 171: <span class="ruby-keyword kw">end</span>
392
- 172: <span class="ruby-keyword kw">end</span>
393
- </pre>
394
- </div>
395
- </div>
396
- </div>
397
- </div>
398
-
399
- </div>
400
-
401
- </body>
402
- </html>