passenger 3.0.2 → 3.0.3

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 (220) hide show
  1. data/NEWS +29 -0
  2. data/build/agents.rb +1 -0
  3. data/build/apache2.rb +2 -1
  4. data/build/cxx_tests.rb +7 -0
  5. data/build/rpm.rb +17 -22
  6. data/doc/cxxapi/Constants_8h_source.html +1 -1
  7. data/doc/cxxapi/Exceptions_8h_source.html +18 -4
  8. data/doc/cxxapi/Logging_8h_source.html +332 -262
  9. data/doc/cxxapi/annotated.html +1 -0
  10. data/doc/cxxapi/classes.html +4 -4
  11. data/doc/cxxapi/group__Exceptions.html +2 -0
  12. data/doc/cxxapi/hierarchy.html +1 -0
  13. data/doc/cxxapi/inherit__graph__35.map +1 -3
  14. data/doc/cxxapi/inherit__graph__35.md5 +1 -1
  15. data/doc/cxxapi/inherit__graph__35.png +0 -0
  16. data/doc/cxxapi/inherit__graph__36.map +3 -1
  17. data/doc/cxxapi/inherit__graph__36.md5 +1 -1
  18. data/doc/cxxapi/inherit__graph__36.png +0 -0
  19. data/doc/cxxapi/inherit__graph__37.map +1 -1
  20. data/doc/cxxapi/inherit__graph__37.md5 +1 -1
  21. data/doc/cxxapi/inherit__graph__37.png +0 -0
  22. data/doc/cxxapi/inherit__graph__38.map +1 -1
  23. data/doc/cxxapi/inherit__graph__38.md5 +1 -1
  24. data/doc/cxxapi/inherit__graph__38.png +0 -0
  25. data/doc/cxxapi/inherit__graph__39.map +1 -1
  26. data/doc/cxxapi/inherit__graph__39.md5 +1 -1
  27. data/doc/cxxapi/inherit__graph__39.png +0 -0
  28. data/doc/cxxapi/inherit__graph__40.map +1 -1
  29. data/doc/cxxapi/inherit__graph__40.md5 +1 -1
  30. data/doc/cxxapi/inherit__graph__40.png +0 -0
  31. data/doc/cxxapi/inherits.html +9 -6
  32. data/doc/cxxapi/namespacePassenger.html +2 -0
  33. data/doc/cxxapi/tree.html +2 -0
  34. data/doc/rdoc/classes/ConditionVariable.html +215 -0
  35. data/doc/rdoc/classes/Exception.html +120 -0
  36. data/doc/rdoc/classes/GC.html +113 -0
  37. data/doc/rdoc/classes/IO.html +221 -0
  38. data/doc/rdoc/classes/PhusionPassenger.html +397 -0
  39. data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +180 -0
  40. data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +647 -0
  41. data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +654 -0
  42. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/InvalidPassword.html +92 -0
  43. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerAlreadyStarted.html +97 -0
  44. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerError.html +96 -0
  45. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerNotStarted.html +97 -0
  46. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/UnknownMessage.html +96 -0
  47. data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +619 -0
  48. data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +142 -0
  49. data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats.html +368 -0
  50. data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats/Process.html +231 -0
  51. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance.html +588 -0
  52. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/CorruptedDirectoryError.html +92 -0
  53. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/GenerationsAbsentError.html +92 -0
  54. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Group.html +147 -0
  55. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Process.html +279 -0
  56. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/RoleDeniedError.html +92 -0
  57. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/StaleDirectoryError.html +92 -0
  58. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Stats.html +123 -0
  59. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/UnsupportedGenerationStructureVersionError.html +92 -0
  60. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger.html +368 -0
  61. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/Log.html +299 -0
  62. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/SharedData.html +206 -0
  63. data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +155 -0
  64. data/doc/rdoc/classes/PhusionPassenger/AppProcess.html +367 -0
  65. data/doc/rdoc/classes/PhusionPassenger/ClassicRails.html +95 -0
  66. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner.html +351 -0
  67. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner/Error.html +98 -0
  68. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/CGIFixed.html +200 -0
  69. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner.html +410 -0
  70. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner/Error.html +98 -0
  71. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/RequestHandler.html +156 -0
  72. data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions.html +115 -0
  73. data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions/AnalyticsLogging.html +202 -0
  74. data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +172 -0
  75. data/doc/rdoc/classes/PhusionPassenger/DebugLogging.html +273 -0
  76. data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +145 -0
  77. data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +162 -0
  78. data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +141 -0
  79. data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +92 -0
  80. data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +673 -0
  81. data/doc/rdoc/classes/PhusionPassenger/MessageChannel/InvalidHashError.html +92 -0
  82. data/doc/rdoc/classes/PhusionPassenger/MessageClient.html +415 -0
  83. data/doc/rdoc/classes/PhusionPassenger/NativeSupportLoader.html +134 -0
  84. data/doc/rdoc/classes/PhusionPassenger/Packaging.html +129 -0
  85. data/doc/rdoc/classes/PhusionPassenger/PlatformInfo.html +1972 -0
  86. data/doc/rdoc/classes/PhusionPassenger/Plugin.html +237 -0
  87. data/doc/rdoc/classes/PhusionPassenger/Rack.html +91 -0
  88. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +312 -0
  89. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner/Error.html +98 -0
  90. data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +218 -0
  91. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions.html +114 -0
  92. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging.html +259 -0
  93. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ACExtension.html +139 -0
  94. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ASBenchmarkableExtension.html +118 -0
  95. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ExceptionLogger.html +135 -0
  96. data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +378 -0
  97. data/doc/rdoc/classes/PhusionPassenger/Standalone.html +111 -0
  98. data/doc/rdoc/classes/PhusionPassenger/Standalone/AppFinder.html +252 -0
  99. data/doc/rdoc/classes/PhusionPassenger/Standalone/Command.html +161 -0
  100. data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile.html +368 -0
  101. data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile/DisallowedContextError.html +132 -0
  102. data/doc/rdoc/classes/PhusionPassenger/Standalone/HelpCommand.html +151 -0
  103. data/doc/rdoc/classes/PhusionPassenger/Standalone/Main.html +189 -0
  104. data/doc/rdoc/classes/PhusionPassenger/Standalone/PackageRuntimeCommand.html +177 -0
  105. data/doc/rdoc/classes/PhusionPassenger/Standalone/RuntimeInstaller.html +341 -0
  106. data/doc/rdoc/classes/PhusionPassenger/Standalone/StartCommand.html +203 -0
  107. data/doc/rdoc/classes/PhusionPassenger/Standalone/StatusCommand.html +156 -0
  108. data/doc/rdoc/classes/PhusionPassenger/Standalone/StopCommand.html +168 -0
  109. data/doc/rdoc/classes/PhusionPassenger/Standalone/Utils.html +86 -0
  110. data/doc/rdoc/classes/PhusionPassenger/Standalone/VersionCommand.html +135 -0
  111. data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +125 -0
  112. data/doc/rdoc/classes/PhusionPassenger/Utils.html +1543 -0
  113. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher.html +204 -0
  114. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/DirInfo.html +171 -0
  115. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/FileInfo.html +140 -0
  116. data/doc/rdoc/classes/PhusionPassenger/Utils/HostsFileParser.html +260 -0
  117. data/doc/rdoc/classes/PhusionPassenger/Utils/PseudoIO.html +194 -0
  118. data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput.html +265 -0
  119. data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput/Tempfile.html +120 -0
  120. data/doc/rdoc/classes/PhusionPassenger/Utils/UnseekableSocket.html +561 -0
  121. data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +140 -0
  122. data/doc/rdoc/classes/PhusionPassenger/WSGI.html +89 -0
  123. data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +182 -0
  124. data/doc/rdoc/classes/Process.html +115 -0
  125. data/doc/rdoc/classes/Signal.html +139 -0
  126. data/doc/rdoc/created.rid +1 -0
  127. data/doc/rdoc/files/DEVELOPERS_TXT.html +280 -0
  128. data/doc/rdoc/files/README.html +157 -0
  129. data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +130 -0
  130. data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +135 -0
  131. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +126 -0
  132. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +128 -0
  133. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/memory_stats_rb.html +126 -0
  134. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/server_instance_rb.html +132 -0
  135. data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +122 -0
  136. data/doc/rdoc/files/lib/phusion_passenger/analytics_logger_rb.html +129 -0
  137. data/doc/rdoc/files/lib/phusion_passenger/app_process_rb.html +127 -0
  138. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/application_spawner_rb.html +141 -0
  139. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/cgi_fixed_rb.html +126 -0
  140. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/framework_spawner_rb.html +146 -0
  141. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/request_handler_rb.html +125 -0
  142. data/doc/rdoc/files/lib/phusion_passenger/classic_rails_extensions/init_rb.html +132 -0
  143. data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +126 -0
  144. data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +122 -0
  145. data/doc/rdoc/files/lib/phusion_passenger/debug_logging_rb.html +122 -0
  146. data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +147 -0
  147. data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +122 -0
  148. data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +127 -0
  149. data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +120 -0
  150. data/doc/rdoc/files/lib/phusion_passenger/message_client_rb.html +127 -0
  151. data/doc/rdoc/files/lib/phusion_passenger/native_support_rb.html +132 -0
  152. data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +122 -0
  153. data/doc/rdoc/files/lib/phusion_passenger/platform_info/apache_rb.html +127 -0
  154. data/doc/rdoc/files/lib/phusion_passenger/platform_info/binary_compatibility_rb.html +129 -0
  155. data/doc/rdoc/files/lib/phusion_passenger/platform_info/compiler_rb.html +127 -0
  156. data/doc/rdoc/files/lib/phusion_passenger/platform_info/curl_rb.html +126 -0
  157. data/doc/rdoc/files/lib/phusion_passenger/platform_info/documentation_tools_rb.html +126 -0
  158. data/doc/rdoc/files/lib/phusion_passenger/platform_info/linux_rb.html +126 -0
  159. data/doc/rdoc/files/lib/phusion_passenger/platform_info/operating_system_rb.html +127 -0
  160. data/doc/rdoc/files/lib/phusion_passenger/platform_info/ruby_rb.html +128 -0
  161. data/doc/rdoc/files/lib/phusion_passenger/platform_info/zlib_rb.html +126 -0
  162. data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +122 -0
  163. data/doc/rdoc/files/lib/phusion_passenger/plugin_rb.html +127 -0
  164. data/doc/rdoc/files/lib/phusion_passenger/public_api_rb.html +127 -0
  165. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +137 -0
  166. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +125 -0
  167. data/doc/rdoc/files/lib/phusion_passenger/rails3_extensions/init_rb.html +127 -0
  168. data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +122 -0
  169. data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +160 -0
  170. data/doc/rdoc/files/lib/phusion_passenger/standalone/app_finder_rb.html +127 -0
  171. data/doc/rdoc/files/lib/phusion_passenger/standalone/command_rb.html +136 -0
  172. data/doc/rdoc/files/lib/phusion_passenger/standalone/config_file_rb.html +126 -0
  173. data/doc/rdoc/files/lib/phusion_passenger/standalone/help_command_rb.html +126 -0
  174. data/doc/rdoc/files/lib/phusion_passenger/standalone/main_rb.html +126 -0
  175. data/doc/rdoc/files/lib/phusion_passenger/standalone/package_runtime_command_rb.html +127 -0
  176. data/doc/rdoc/files/lib/phusion_passenger/standalone/runtime_installer_rb.html +133 -0
  177. data/doc/rdoc/files/lib/phusion_passenger/standalone/start_command_rb.html +136 -0
  178. data/doc/rdoc/files/lib/phusion_passenger/standalone/status_command_rb.html +126 -0
  179. data/doc/rdoc/files/lib/phusion_passenger/standalone/stop_command_rb.html +126 -0
  180. data/doc/rdoc/files/lib/phusion_passenger/standalone/utils_rb.html +126 -0
  181. data/doc/rdoc/files/lib/phusion_passenger/standalone/version_command_rb.html +127 -0
  182. data/doc/rdoc/files/lib/phusion_passenger/utils/file_system_watcher_rb.html +126 -0
  183. data/doc/rdoc/files/lib/phusion_passenger/utils/hosts_file_parser_rb.html +120 -0
  184. data/doc/rdoc/files/lib/phusion_passenger/utils/rewindable_input_rb.html +100 -0
  185. data/doc/rdoc/files/lib/phusion_passenger/utils/tmpdir_rb.html +122 -0
  186. data/doc/rdoc/files/lib/phusion_passenger/utils/unseekable_socket_rb.html +126 -0
  187. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +179 -0
  188. data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +132 -0
  189. data/doc/rdoc/fr_class_index.html +139 -0
  190. data/doc/rdoc/fr_file_index.html +108 -0
  191. data/doc/rdoc/fr_method_index.html +439 -0
  192. data/doc/rdoc/index.html +26 -0
  193. data/doc/rdoc/rdoc-style.css +187 -0
  194. data/ext/apache2/Configuration.cpp +41 -0
  195. data/ext/apache2/Configuration.hpp +19 -0
  196. data/ext/apache2/Hooks.cpp +67 -5
  197. data/ext/common/Constants.h +1 -1
  198. data/ext/common/Exceptions.h +14 -0
  199. data/ext/common/Logging.h +76 -6
  200. data/ext/common/LoggingAgent/FilterSupport.h +1317 -0
  201. data/ext/common/LoggingAgent/LoggingServer.h +93 -4
  202. data/ext/common/LoggingAgent/RemoteSender.h +5 -5
  203. data/ext/common/Utils/StrIntUtils.cpp +12 -1
  204. data/ext/common/Utils/StrIntUtils.h +2 -1
  205. data/ext/common/Utils/StringMap.h +100 -0
  206. data/ext/nginx/Configuration.c +0 -1
  207. data/ext/nginx/ContentHandler.c +33 -7
  208. data/lib/phusion_passenger.rb +2 -2
  209. data/lib/phusion_passenger/abstract_request_handler.rb +5 -0
  210. data/lib/phusion_passenger/analytics_logger.rb +77 -11
  211. data/lib/phusion_passenger/dependencies.rb +11 -1
  212. data/lib/phusion_passenger/platform_info.rb +1 -1
  213. data/lib/phusion_passenger/utils.rb +9 -1
  214. data/test/cxx/FilterSupportTest.cpp +276 -0
  215. data/test/cxx/LoggingTest.cpp +28 -0
  216. data/test/cxx/StringMapTest.cpp +70 -0
  217. data/test/integration_tests/cgi_environment_spec.rb +10 -0
  218. metadata +170 -8
  219. data/ext/common/libboost_oxt/aggregate.cpp +0 -10
  220. data/ext/common/libpassenger_common/aggregate.cpp +0 -15
@@ -0,0 +1,237 @@
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::Plugin</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::Plugin</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/plugin_rb.html">lib/phusion_passenger/plugin.rb</a>
61
+ </td>
62
+ </tr>
63
+ <tr>
64
+ <td>Parent:</td>
65
+ <td>
66
+ Object
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
+
79
+
80
+
81
+ <div class="sectiontitle">Methods</div>
82
+ <ul>
83
+ <li><a href="#M000357">call_hook</a></li>
84
+ <li><a href="#M000354">call_hook</a></li>
85
+ <li><a href="#M000352">load</a></li>
86
+ <li><a href="#M000356">new</a></li>
87
+ <li><a href="#M000355">register</a></li>
88
+ <li><a href="#M000353">register_hook</a></li>
89
+ </ul>
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <div class="sectiontitle">Public Class methods</div>
97
+ <div class="method">
98
+ <div class="title">
99
+ <a name="M000354"></a><b>call_hook</b>(name, *args, &amp;block)
100
+ </div>
101
+ <div class="sourcecode">
102
+ <p class="source-link">[ <a href="javascript:toggleSource('M000354_source')" id="l_M000354_source">show source</a> ]</p>
103
+ <div id="M000354_source" class="dyn-source">
104
+ <pre>
105
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/plugin.rb, line 56</span>
106
+ 56: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">call_hook</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
107
+ 57: <span class="ruby-identifier">last_result</span> = <span class="ruby-keyword kw">nil</span>
108
+ 58: <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">hooks_list</span> = <span class="ruby-ivar">@@hooks</span>[<span class="ruby-identifier">name</span>])
109
+ 59: <span class="ruby-identifier">hooks_list</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">callback</span><span class="ruby-operator">|</span>
110
+ 60: <span class="ruby-identifier">last_result</span> = <span class="ruby-identifier">callback</span>.<span class="ruby-identifier">call</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
111
+ 61: <span class="ruby-keyword kw">end</span>
112
+ 62: <span class="ruby-keyword kw">end</span>
113
+ 63: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">last_result</span>
114
+ 64: <span class="ruby-keyword kw">end</span>
115
+ </pre>
116
+ </div>
117
+ </div>
118
+ </div>
119
+ <div class="method">
120
+ <div class="title">
121
+ <a name="M000352"></a><b>load</b>(name, load_once = true)
122
+ </div>
123
+ <div class="sourcecode">
124
+ <p class="source-link">[ <a href="javascript:toggleSource('M000352_source')" id="l_M000352_source">show source</a> ]</p>
125
+ <div id="M000352_source" class="dyn-source">
126
+ <pre>
127
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/plugin.rb, line 33</span>
128
+ 33: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">load_once</span> = <span class="ruby-keyword kw">true</span>)
129
+ 34: <span class="ruby-constant">PLUGIN_DIRS</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">plugin_dir</span><span class="ruby-operator">|</span>
130
+ 35: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">plugin_dir</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A~/</span>
131
+ 36: <span class="ruby-comment cmt"># File.expand_path uses ENV['HOME'] which we don't want.</span>
132
+ 37: <span class="ruby-identifier">home</span> = <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getpwuid</span>(<span class="ruby-constant">Process</span>.<span class="ruby-identifier">uid</span>).<span class="ruby-identifier">dir</span>
133
+ 38: <span class="ruby-identifier">plugin_dir</span> = <span class="ruby-identifier">plugin_dir</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/\A~/</span>, <span class="ruby-identifier">home</span>)
134
+ 39: <span class="ruby-keyword kw">end</span>
135
+ 40: <span class="ruby-identifier">plugin_dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">plugin_dir</span>)
136
+ 41: <span class="ruby-constant">Dir</span>[<span class="ruby-node">&quot;#{plugin_dir}/*/#{name}.rb&quot;</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">filename</span><span class="ruby-operator">|</span>
137
+ 42: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">load_once</span>
138
+ 43: <span class="ruby-identifier">require</span>(<span class="ruby-identifier">filename</span>)
139
+ 44: <span class="ruby-keyword kw">else</span>
140
+ 45: <span class="ruby-identifier">load</span>(<span class="ruby-identifier">filename</span>)
141
+ 46: <span class="ruby-keyword kw">end</span>
142
+ 47: <span class="ruby-keyword kw">end</span>
143
+ 48: <span class="ruby-keyword kw">end</span>
144
+ 49: <span class="ruby-keyword kw">end</span>
145
+ </pre>
146
+ </div>
147
+ </div>
148
+ </div>
149
+ <div class="method">
150
+ <div class="title">
151
+ <a name="M000356"></a><b>new</b>(name, *args, &amp;block)
152
+ </div>
153
+ <div class="sourcecode">
154
+ <p class="source-link">[ <a href="javascript:toggleSource('M000356_source')" id="l_M000356_source">show source</a> ]</p>
155
+ <div id="M000356_source" class="dyn-source">
156
+ <pre>
157
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/plugin.rb, line 71</span>
158
+ 71: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
159
+ 72: <span class="ruby-constant">Plugin</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">name</span>)
160
+ 73: <span class="ruby-identifier">classes</span> = <span class="ruby-ivar">@@classes</span>[<span class="ruby-identifier">name</span>]
161
+ 74: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">classes</span>
162
+ 75: <span class="ruby-ivar">@instances</span> = <span class="ruby-identifier">classes</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">klass</span><span class="ruby-operator">|</span>
163
+ 76: <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
164
+ 77: <span class="ruby-keyword kw">end</span>
165
+ 78: <span class="ruby-keyword kw">else</span>
166
+ 79: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
167
+ 80: <span class="ruby-keyword kw">end</span>
168
+ 81: <span class="ruby-keyword kw">end</span>
169
+ </pre>
170
+ </div>
171
+ </div>
172
+ </div>
173
+ <div class="method">
174
+ <div class="title">
175
+ <a name="M000355"></a><b>register</b>(name, klass)
176
+ </div>
177
+ <div class="sourcecode">
178
+ <p class="source-link">[ <a href="javascript:toggleSource('M000355_source')" id="l_M000355_source">show source</a> ]</p>
179
+ <div id="M000355_source" class="dyn-source">
180
+ <pre>
181
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/plugin.rb, line 66</span>
182
+ 66: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">register</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">klass</span>)
183
+ 67: <span class="ruby-identifier">classes</span> = (<span class="ruby-ivar">@@classes</span>[<span class="ruby-identifier">name</span>] <span class="ruby-operator">||=</span> [])
184
+ 68: <span class="ruby-identifier">classes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">klass</span>
185
+ 69: <span class="ruby-keyword kw">end</span>
186
+ </pre>
187
+ </div>
188
+ </div>
189
+ </div>
190
+ <div class="method">
191
+ <div class="title">
192
+ <a name="M000353"></a><b>register_hook</b>(name, &amp;block)
193
+ </div>
194
+ <div class="sourcecode">
195
+ <p class="source-link">[ <a href="javascript:toggleSource('M000353_source')" id="l_M000353_source">show source</a> ]</p>
196
+ <div id="M000353_source" class="dyn-source">
197
+ <pre>
198
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/plugin.rb, line 51</span>
199
+ 51: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">register_hook</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
200
+ 52: <span class="ruby-identifier">hooks_list</span> = (<span class="ruby-ivar">@@hooks</span>[<span class="ruby-identifier">name</span>] <span class="ruby-operator">||=</span> [])
201
+ 53: <span class="ruby-identifier">hooks_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">block</span>
202
+ 54: <span class="ruby-keyword kw">end</span>
203
+ </pre>
204
+ </div>
205
+ </div>
206
+ </div>
207
+ <div class="sectiontitle">Public Instance methods</div>
208
+ <div class="method">
209
+ <div class="title">
210
+ <a name="M000357"></a><b>call_hook</b>(name, *args, &amp;block)
211
+ </div>
212
+ <div class="sourcecode">
213
+ <p class="source-link">[ <a href="javascript:toggleSource('M000357_source')" id="l_M000357_source">show source</a> ]</p>
214
+ <div id="M000357_source" class="dyn-source">
215
+ <pre>
216
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/plugin.rb, line 83</span>
217
+ 83: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call_hook</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
218
+ 84: <span class="ruby-identifier">last_result</span> = <span class="ruby-keyword kw">nil</span>
219
+ 85: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@instances</span>
220
+ 86: <span class="ruby-ivar">@instances</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">instance</span><span class="ruby-operator">|</span>
221
+ 87: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">instance</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_sym</span>)
222
+ 88: <span class="ruby-identifier">last_result</span> = <span class="ruby-identifier">instance</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_sym</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
223
+ 89: <span class="ruby-keyword kw">end</span>
224
+ 90: <span class="ruby-keyword kw">end</span>
225
+ 91: <span class="ruby-keyword kw">end</span>
226
+ 92: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">last_result</span>
227
+ 93: <span class="ruby-keyword kw">end</span>
228
+ </pre>
229
+ </div>
230
+ </div>
231
+ </div>
232
+ </div>
233
+
234
+ </div>
235
+
236
+ </body>
237
+ </html>
@@ -0,0 +1,91 @@
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>Module: PhusionPassenger::Rack</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">Module</span><br />PhusionPassenger::Rack</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/rack/application_spawner_rb.html">lib/phusion_passenger/rack/application_spawner.rb</a>
61
+ <a href="../../files/lib/phusion_passenger/rack/request_handler_rb.html">lib/phusion_passenger/rack/request_handler.rb</a>
62
+ </td>
63
+ </tr>
64
+ </table>
65
+ </td>
66
+ </tr>
67
+ </table>
68
+ <!-- banner header -->
69
+
70
+ <div id="bodyContent">
71
+ <div id="content">
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+ <div class="sectiontitle">Classes and Modules</div>
80
+ Class <a href="Rack/ApplicationSpawner.html" class="link">PhusionPassenger::Rack::ApplicationSpawner</a><br />
81
+ Class <a href="Rack/RequestHandler.html" class="link">PhusionPassenger::Rack::RequestHandler</a><br />
82
+
83
+
84
+
85
+
86
+ </div>
87
+
88
+ </div>
89
+
90
+ </body>
91
+ </html>
@@ -0,0 +1,312 @@
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::Rack::ApplicationSpawner</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::Rack::ApplicationSpawner</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/rack/application_spawner_rb.html">lib/phusion_passenger/rack/application_spawner.rb</a>
61
+ </td>
62
+ </tr>
63
+ <tr>
64
+ <td>Parent:</td>
65
+ <td>
66
+ AbstractServer
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
+ Spawning of <a href="../Rack.html">Rack</a> applications.
80
+ </p>
81
+ </div>
82
+
83
+
84
+
85
+ <div class="sectiontitle">Methods</div>
86
+ <ul>
87
+ <li><a href="#M000023">new</a></li>
88
+ <li><a href="#M000022">spawn_application</a></li>
89
+ <li><a href="#M000024">spawn_application</a></li>
90
+ <li><a href="#M000025">start</a></li>
91
+ </ul>
92
+
93
+ <div class="sectiontitle">Included Modules</div>
94
+ <ul>
95
+ <li><a href="../Utils.html">Utils</a></li>
96
+ <li><a href="../DebugLogging.html">DebugLogging</a></li>
97
+ </ul>
98
+
99
+
100
+ <div class="sectiontitle">Classes and Modules</div>
101
+ Class <a href="ApplicationSpawner/Error.html" class="link">PhusionPassenger::Rack::ApplicationSpawner::Error</a><br />
102
+
103
+
104
+
105
+
106
+ <div class="sectiontitle">Public Class methods</div>
107
+ <div class="method">
108
+ <div class="title">
109
+ <a name="M000023"></a><b>new</b>(options)
110
+ </div>
111
+ <div class="description">
112
+ <p>
113
+ The following options are accepted:
114
+ </p>
115
+ <ul>
116
+ <li>&#8216;app_root&#8216;
117
+
118
+ </li>
119
+ </ul>
120
+ <p>
121
+ See <a
122
+ href="../SpawnManager.html#M000372">SpawnManager#spawn_application</a> for
123
+ information about the options.
124
+ </p>
125
+ </div>
126
+ <div class="sourcecode">
127
+ <p class="source-link">[ <a href="javascript:toggleSource('M000023_source')" id="l_M000023_source">show source</a> ]</p>
128
+ <div id="M000023_source" class="dyn-source">
129
+ <pre>
130
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/rack/application_spawner.rb, line 95</span>
131
+ 95: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span>)
132
+ 96: <span class="ruby-keyword kw">super</span>()
133
+ 97: <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">sanitize_spawn_options</span>(<span class="ruby-identifier">options</span>)
134
+ 98: <span class="ruby-ivar">@app_root</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-value str">&quot;app_root&quot;</span>]
135
+ 99: <span class="ruby-ivar">@canonicalized_app_root</span> = <span class="ruby-identifier">canonicalize_path</span>(<span class="ruby-ivar">@app_root</span>)
136
+ 100: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">max_idle_time</span> = <span class="ruby-constant">DEFAULT_APP_SPAWNER_MAX_IDLE_TIME</span>
137
+ 101: <span class="ruby-identifier">define_message_handler</span>(<span class="ruby-identifier">:spawn_application</span>, <span class="ruby-identifier">:handle_spawn_application</span>)
138
+ 102: <span class="ruby-keyword kw">end</span>
139
+ </pre>
140
+ </div>
141
+ </div>
142
+ </div>
143
+ <div class="method">
144
+ <div class="title">
145
+ <a name="M000022"></a><b>spawn_application</b>(options = {})
146
+ </div>
147
+ <div class="description">
148
+ <p>
149
+ Spawn an instance of the given <a href="../Rack.html">Rack</a> application.
150
+ When successful, an <a href="../AppProcess.html">AppProcess</a> object will
151
+ be returned, which represents the spawned application.
152
+ </p>
153
+ <p>
154
+ Accepts the same options as <a
155
+ href="../SpawnManager.html#M000372">SpawnManager#spawn_application</a>.
156
+ </p>
157
+ <p>
158
+ Raises:
159
+ </p>
160
+ <ul>
161
+ <li><a href="../AppInitError.html">AppInitError</a>: The <a
162
+ href="../Rack.html">Rack</a> application raised an exception or called
163
+ exit() during startup.
164
+
165
+ </li>
166
+ <li>SystemCallError, IOError, SocketError: Something went wrong.
167
+
168
+ </li>
169
+ </ul>
170
+ </div>
171
+ <div class="sourcecode">
172
+ <p class="source-link">[ <a href="javascript:toggleSource('M000022_source')" id="l_M000022_source">show source</a> ]</p>
173
+ <div id="M000022_source" class="dyn-source">
174
+ <pre>
175
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/rack/application_spawner.rb, line 59</span>
176
+ 59: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">spawn_application</span>(<span class="ruby-identifier">options</span> = {})
177
+ 60: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">sanitize_spawn_options</span>(<span class="ruby-identifier">options</span>)
178
+ 61:
179
+ 62: <span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span> = <span class="ruby-constant">UNIXSocket</span>.<span class="ruby-identifier">pair</span>
180
+ 63: <span class="ruby-identifier">pid</span> = <span class="ruby-identifier">safe_fork</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-keyword kw">true</span>) <span class="ruby-keyword kw">do</span>
181
+ 64: <span class="ruby-identifier">a</span>.<span class="ruby-identifier">close</span>
182
+ 65:
183
+ 66: <span class="ruby-identifier">file_descriptors_to_leave_open</span> = [<span class="ruby-value">0</span>, <span class="ruby-value">1</span>, <span class="ruby-value">2</span>, <span class="ruby-identifier">b</span>.<span class="ruby-identifier">fileno</span>]
184
+ 67: <span class="ruby-constant">NativeSupport</span>.<span class="ruby-identifier">close_all_file_descriptors</span>(<span class="ruby-identifier">file_descriptors_to_leave_open</span>)
185
+ 68: <span class="ruby-identifier">close_all_io_objects_for_fds</span>(<span class="ruby-identifier">file_descriptors_to_leave_open</span>)
186
+ 69:
187
+ 70: <span class="ruby-identifier">channel</span> = <span class="ruby-constant">MessageChannel</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">b</span>)
188
+ 71: <span class="ruby-identifier">app</span> = <span class="ruby-keyword kw">nil</span>
189
+ 72: <span class="ruby-identifier">success</span> = <span class="ruby-identifier">report_app_init_status</span>(<span class="ruby-identifier">channel</span>) <span class="ruby-keyword kw">do</span>
190
+ 73: <span class="ruby-identifier">prepare_app_process</span>(<span class="ruby-value str">'config.ru'</span>, <span class="ruby-identifier">options</span>)
191
+ 74: <span class="ruby-identifier">app</span> = <span class="ruby-identifier">load_rack_app</span>
192
+ 75: <span class="ruby-identifier">after_loading_app_code</span>(<span class="ruby-identifier">options</span>)
193
+ 76: <span class="ruby-keyword kw">end</span>
194
+ 77: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">success</span>
195
+ 78: <span class="ruby-identifier">start_request_handler</span>(<span class="ruby-identifier">channel</span>, <span class="ruby-identifier">app</span>, <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">options</span>)
196
+ 79: <span class="ruby-keyword kw">end</span>
197
+ 80: <span class="ruby-keyword kw">end</span>
198
+ 81: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">close</span>
199
+ 82: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">waitpid</span>(<span class="ruby-identifier">pid</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
200
+ 83:
201
+ 84: <span class="ruby-identifier">channel</span> = <span class="ruby-constant">MessageChannel</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">a</span>)
202
+ 85: <span class="ruby-identifier">unmarshal_and_raise_errors</span>(<span class="ruby-identifier">channel</span>, <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;print_exceptions&quot;</span>], <span class="ruby-value str">&quot;rack&quot;</span>)
203
+ 86:
204
+ 87: <span class="ruby-comment cmt"># No exception was raised, so spawning succeeded.</span>
205
+ 88: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">AppProcess</span>.<span class="ruby-identifier">read_from_channel</span>(<span class="ruby-identifier">channel</span>)
206
+ 89: <span class="ruby-keyword kw">end</span>
207
+ </pre>
208
+ </div>
209
+ </div>
210
+ </div>
211
+ <div class="sectiontitle">Public Instance methods</div>
212
+ <div class="method">
213
+ <div class="title">
214
+ <a name="M000024"></a><b>spawn_application</b>(options = {})
215
+ </div>
216
+ <div class="description">
217
+ <p>
218
+ Spawns an instance of the <a href="../Rack.html">Rack</a> application. When
219
+ successful, an <a href="../AppProcess.html">AppProcess</a> object will be
220
+ returned, which represents the spawned <a href="../Rack.html">Rack</a>
221
+ application.
222
+ </p>
223
+ <p>
224
+ <tt>options</tt> will be passed to the request handler&#8216;s constructor.
225
+ </p>
226
+ <p>
227
+ Raises:
228
+ </p>
229
+ <ul>
230
+ <li><a
231
+ href="../AbstractServer/ServerNotStarted.html">AbstractServer::ServerNotStarted</a>:
232
+ The <a href="ApplicationSpawner.html">ApplicationSpawner</a> server
233
+ hasn&#8216;t already been started.
234
+
235
+ </li>
236
+ <li><a href="ApplicationSpawner/Error.html">ApplicationSpawner::Error</a>: The
237
+ <a href="ApplicationSpawner.html">ApplicationSpawner</a> server exited
238
+ unexpectedly.
239
+
240
+ </li>
241
+ </ul>
242
+ </div>
243
+ <div class="sourcecode">
244
+ <p class="source-link">[ <a href="javascript:toggleSource('M000024_source')" id="l_M000024_source">show source</a> ]</p>
245
+ <div id="M000024_source" class="dyn-source">
246
+ <pre>
247
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/rack/application_spawner.rb, line 112</span>
248
+ 112: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">spawn_application</span>(<span class="ruby-identifier">options</span> = {})
249
+ 113: <span class="ruby-identifier">connect</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span>
250
+ 114: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;spawn_application&quot;</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">options</span>.<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">flatten</span>)
251
+ 115: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">AppProcess</span>.<span class="ruby-identifier">read_from_channel</span>(<span class="ruby-identifier">channel</span>)
252
+ 116: <span class="ruby-keyword kw">end</span>
253
+ 117: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SystemCallError</span>, <span class="ruby-constant">IOError</span>, <span class="ruby-constant">SocketError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
254
+ 118: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Error</span>, <span class="ruby-node">&quot;The application spawner server exited unexpectedly: #{e}&quot;</span>
255
+ 119: <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="M000025"></a><b>start</b>()
263
+ </div>
264
+ <div class="description">
265
+ <p>
266
+ Overrided from <a
267
+ href="../AbstractServer.html#M000334">AbstractServer#start</a>.
268
+ </p>
269
+ <p>
270
+ May raise these additional exceptions:
271
+ </p>
272
+ <ul>
273
+ <li><a href="../AppInitError.html">AppInitError</a>: The <a
274
+ href="../Rack.html">Rack</a> application raised an exception or called
275
+ exit() during startup.
276
+
277
+ </li>
278
+ <li><a href="ApplicationSpawner/Error.html">ApplicationSpawner::Error</a>: The
279
+ <a href="ApplicationSpawner.html">ApplicationSpawner</a> server exited
280
+ unexpectedly.
281
+
282
+ </li>
283
+ </ul>
284
+ </div>
285
+ <div class="sourcecode">
286
+ <p class="source-link">[ <a href="javascript:toggleSource('M000025_source')" id="l_M000025_source">show source</a> ]</p>
287
+ <div id="M000025_source" class="dyn-source">
288
+ <pre>
289
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/rack/application_spawner.rb, line 127</span>
290
+ 127: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
291
+ 128: <span class="ruby-keyword kw">super</span>
292
+ 129: <span class="ruby-keyword kw">begin</span>
293
+ 130: <span class="ruby-identifier">channel</span> = <span class="ruby-constant">MessageChannel</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@owner_socket</span>)
294
+ 131: <span class="ruby-identifier">unmarshal_and_raise_errors</span>(<span class="ruby-identifier">channel</span>, <span class="ruby-ivar">@options</span>[<span class="ruby-value str">&quot;print_exceptions&quot;</span>])
295
+ 132: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">IOError</span>, <span class="ruby-constant">SystemCallError</span>, <span class="ruby-constant">SocketError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
296
+ 133: <span class="ruby-identifier">stop</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">started?</span>
297
+ 134: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Error</span>, <span class="ruby-node">&quot;The application spawner server exited unexpectedly: #{e}&quot;</span>
298
+ 135: <span class="ruby-keyword kw">rescue</span>
299
+ 136: <span class="ruby-identifier">stop</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">started?</span>
300
+ 137: <span class="ruby-identifier">raise</span>
301
+ 138: <span class="ruby-keyword kw">end</span>
302
+ 139: <span class="ruby-keyword kw">end</span>
303
+ </pre>
304
+ </div>
305
+ </div>
306
+ </div>
307
+ </div>
308
+
309
+ </div>
310
+
311
+ </body>
312
+ </html>