passenger 2.0.6 → 2.1.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 (497) hide show
  1. data/DEVELOPERS.TXT +10 -4
  2. data/LICENSE +1 -1
  3. data/NEWS +0 -0
  4. data/Rakefile +183 -117
  5. data/benchmark/dispatcher.rb +5 -9
  6. data/bin/passenger-install-apache2-module +52 -18
  7. data/bin/passenger-memory-stats +67 -13
  8. data/bin/passenger-spawn-server +8 -4
  9. data/bin/passenger-status +21 -46
  10. data/bin/passenger-stress-test +5 -5
  11. data/debian/postinst +1 -1
  12. data/doc/ApplicationPool algorithm.txt +180 -128
  13. data/doc/Architectural overview.html +1 -778
  14. data/doc/Security of user switching support.html +1 -643
  15. data/doc/Users guide Apache.html +3127 -0
  16. data/doc/Users guide Nginx.html +1458 -0
  17. data/doc/Users guide.html +1404 -467
  18. data/doc/Users guide.txt +843 -105
  19. data/doc/cxxapi/ApplicationPoolServer_8h-source.html +751 -641
  20. data/doc/cxxapi/ApplicationPool_8h-source.html +168 -171
  21. data/doc/cxxapi/Application_8h-source.html +494 -394
  22. data/doc/cxxapi/Bucket_8h-source.html +21 -15
  23. data/doc/cxxapi/CachedFileStat_8h-source.html +191 -0
  24. data/doc/cxxapi/Configuration_8h-source.html +311 -149
  25. data/doc/cxxapi/DirectoryMapper_8h-source.html +309 -0
  26. data/doc/cxxapi/DummySpawnManager_8h-source.html +3 -4
  27. data/doc/cxxapi/Exceptions_8h-source.html +182 -165
  28. data/doc/cxxapi/FileChecker_8h-source.html +130 -0
  29. data/doc/cxxapi/Hooks_8h-source.html +2 -3
  30. data/doc/cxxapi/Logging_8h-source.html +92 -89
  31. data/doc/cxxapi/MessageChannel_8h-source.html +585 -477
  32. data/doc/cxxapi/PoolOptions_8h-source.html +305 -0
  33. data/doc/cxxapi/SpawnManager_8h-source.html +515 -540
  34. data/doc/cxxapi/StandardApplicationPool_8h-source.html +779 -679
  35. data/doc/cxxapi/SystemTime_8h-source.html +104 -0
  36. data/doc/cxxapi/Utils_8h-source.html +331 -227
  37. data/doc/cxxapi/annotated.html +6 -7
  38. data/doc/cxxapi/classClient-members.html +1 -2
  39. data/doc/cxxapi/classClient.html +1 -2
  40. data/doc/cxxapi/classHooks-members.html +5 -2
  41. data/doc/cxxapi/classHooks.html +112 -2
  42. data/doc/cxxapi/classPassenger_1_1Application-members.html +2 -3
  43. data/doc/cxxapi/classPassenger_1_1Application.html +8 -9
  44. data/doc/cxxapi/classPassenger_1_1ApplicationPool-members.html +4 -4
  45. data/doc/cxxapi/classPassenger_1_1ApplicationPool.html +42 -81
  46. data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer-members.html +1 -2
  47. data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer.html +3 -4
  48. data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.png +0 -0
  49. data/doc/cxxapi/classPassenger_1_1Application_1_1Session-members.html +3 -2
  50. data/doc/cxxapi/classPassenger_1_1Application_1_1Session.html +74 -3
  51. data/doc/cxxapi/classPassenger_1_1BusyException-members.html +1 -2
  52. data/doc/cxxapi/classPassenger_1_1BusyException.html +2 -3
  53. data/doc/cxxapi/classPassenger_1_1ConfigurationException-members.html +1 -2
  54. data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +2 -3
  55. data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +38 -0
  56. data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +256 -0
  57. data/doc/cxxapi/classPassenger_1_1DummySpawnManager-members.html +1 -2
  58. data/doc/cxxapi/classPassenger_1_1DummySpawnManager.html +2 -3
  59. data/doc/cxxapi/{classPassenger_1_1Thread-members.html → classPassenger_1_1FileChecker-members.html} +4 -5
  60. data/doc/cxxapi/classPassenger_1_1FileChecker.html +121 -0
  61. data/doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html +1 -2
  62. data/doc/cxxapi/classPassenger_1_1FileNotFoundException.html +2 -3
  63. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.png +0 -0
  64. data/doc/cxxapi/classPassenger_1_1FileSystemException-members.html +2 -3
  65. data/doc/cxxapi/classPassenger_1_1FileSystemException.html +2 -3
  66. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.png +0 -0
  67. data/doc/cxxapi/classPassenger_1_1IOException-members.html +1 -2
  68. data/doc/cxxapi/classPassenger_1_1IOException.html +2 -3
  69. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.png +0 -0
  70. data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +5 -2
  71. data/doc/cxxapi/classPassenger_1_1MessageChannel.html +155 -5
  72. data/doc/cxxapi/{classboost_1_1this__thread_1_1enable__syscall__interruption-members.html → classPassenger_1_1RuntimeException-members.html} +2 -3
  73. data/doc/cxxapi/{classboost_1_1this__thread_1_1enable__syscall__interruption.html → classPassenger_1_1RuntimeException.html} +10 -8
  74. data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +1 -2
  75. data/doc/cxxapi/classPassenger_1_1SpawnException.html +2 -3
  76. data/doc/cxxapi/classPassenger_1_1SpawnManager-members.html +2 -3
  77. data/doc/cxxapi/classPassenger_1_1SpawnManager.html +15 -56
  78. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool-members.html +5 -4
  79. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool.html +20 -81
  80. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.png +0 -0
  81. data/doc/cxxapi/classPassenger_1_1SystemException-members.html +2 -3
  82. data/doc/cxxapi/classPassenger_1_1SystemException.html +9 -10
  83. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.png +0 -0
  84. data/doc/cxxapi/{classboost_1_1this__thread_1_1disable__syscall__interruption-members.html → classPassenger_1_1SystemTime-members.html} +5 -3
  85. data/doc/cxxapi/classPassenger_1_1SystemTime.html +86 -0
  86. data/doc/cxxapi/classPassenger_1_1TempFile-members.html +2 -3
  87. data/doc/cxxapi/classPassenger_1_1TempFile.html +17 -9
  88. data/doc/cxxapi/definitions_8h-source.html +1 -2
  89. data/doc/cxxapi/files.html +6 -3
  90. data/doc/cxxapi/functions.html +98 -35
  91. data/doc/cxxapi/functions_func.html +60 -32
  92. data/doc/cxxapi/functions_type.html +1 -2
  93. data/doc/cxxapi/functions_vars.html +27 -2
  94. data/doc/cxxapi/graph_legend.html +1 -2
  95. data/doc/cxxapi/graph_legend.png +0 -0
  96. data/doc/cxxapi/group__Configuration.html +3 -4
  97. data/doc/cxxapi/group__Configuration.png +0 -0
  98. data/doc/cxxapi/group__Core.html +3 -4
  99. data/doc/cxxapi/group__Core.png +0 -0
  100. data/doc/cxxapi/group__Exceptions.html +4 -2
  101. data/doc/cxxapi/group__Hooks.html +1 -6
  102. data/doc/cxxapi/group__Hooks.png +0 -0
  103. data/doc/cxxapi/group__Support.html +259 -36
  104. data/doc/cxxapi/hierarchy.html +6 -7
  105. data/doc/cxxapi/inherit__graph__0.map +1 -1
  106. data/doc/cxxapi/inherit__graph__0.md5 +1 -1
  107. data/doc/cxxapi/inherit__graph__0.png +0 -0
  108. data/doc/cxxapi/inherit__graph__1.map +1 -1
  109. data/doc/cxxapi/inherit__graph__1.md5 +1 -1
  110. data/doc/cxxapi/inherit__graph__1.png +0 -0
  111. data/doc/cxxapi/inherit__graph__10.map +1 -1
  112. data/doc/cxxapi/inherit__graph__10.md5 +1 -1
  113. data/doc/cxxapi/inherit__graph__10.png +0 -0
  114. data/doc/cxxapi/inherit__graph__11.map +1 -1
  115. data/doc/cxxapi/inherit__graph__11.md5 +1 -1
  116. data/doc/cxxapi/inherit__graph__11.png +0 -0
  117. data/doc/cxxapi/inherit__graph__12.map +2 -1
  118. data/doc/cxxapi/inherit__graph__12.md5 +1 -1
  119. data/doc/cxxapi/inherit__graph__12.png +0 -0
  120. data/doc/cxxapi/inherit__graph__13.map +1 -1
  121. data/doc/cxxapi/inherit__graph__13.md5 +1 -1
  122. data/doc/cxxapi/inherit__graph__13.png +0 -0
  123. data/doc/cxxapi/inherit__graph__14.map +1 -2
  124. data/doc/cxxapi/inherit__graph__14.md5 +1 -1
  125. data/doc/cxxapi/inherit__graph__14.png +0 -0
  126. data/doc/cxxapi/inherit__graph__15.map +1 -1
  127. data/doc/cxxapi/inherit__graph__15.md5 +1 -1
  128. data/doc/cxxapi/inherit__graph__15.png +0 -0
  129. data/doc/cxxapi/inherit__graph__16.map +1 -1
  130. data/doc/cxxapi/inherit__graph__16.md5 +1 -1
  131. data/doc/cxxapi/inherit__graph__16.png +0 -0
  132. data/doc/cxxapi/inherit__graph__17.png +0 -0
  133. data/doc/cxxapi/inherit__graph__18.png +0 -0
  134. data/doc/cxxapi/inherit__graph__19.png +0 -0
  135. data/doc/cxxapi/inherit__graph__2.map +1 -1
  136. data/doc/cxxapi/inherit__graph__2.md5 +1 -1
  137. data/doc/cxxapi/inherit__graph__2.png +0 -0
  138. data/doc/cxxapi/inherit__graph__20.map +1 -1
  139. data/doc/cxxapi/inherit__graph__20.md5 +1 -1
  140. data/doc/cxxapi/inherit__graph__20.png +0 -0
  141. data/doc/cxxapi/inherit__graph__21.map +1 -1
  142. data/doc/cxxapi/inherit__graph__21.md5 +1 -1
  143. data/doc/cxxapi/inherit__graph__21.png +0 -0
  144. data/doc/cxxapi/inherit__graph__3.map +1 -1
  145. data/doc/cxxapi/inherit__graph__3.md5 +1 -1
  146. data/doc/cxxapi/inherit__graph__3.png +0 -0
  147. data/doc/cxxapi/inherit__graph__4.map +1 -1
  148. data/doc/cxxapi/inherit__graph__4.md5 +1 -1
  149. data/doc/cxxapi/inherit__graph__4.png +0 -0
  150. data/doc/cxxapi/inherit__graph__5.map +2 -1
  151. data/doc/cxxapi/inherit__graph__5.md5 +1 -1
  152. data/doc/cxxapi/inherit__graph__5.png +0 -0
  153. data/doc/cxxapi/inherit__graph__6.map +1 -1
  154. data/doc/cxxapi/inherit__graph__6.md5 +1 -1
  155. data/doc/cxxapi/inherit__graph__6.png +0 -0
  156. data/doc/cxxapi/inherit__graph__7.map +1 -1
  157. data/doc/cxxapi/inherit__graph__7.md5 +1 -1
  158. data/doc/cxxapi/inherit__graph__7.png +0 -0
  159. data/doc/cxxapi/inherit__graph__8.map +1 -1
  160. data/doc/cxxapi/inherit__graph__8.md5 +1 -1
  161. data/doc/cxxapi/inherit__graph__8.png +0 -0
  162. data/doc/cxxapi/inherit__graph__9.map +1 -2
  163. data/doc/cxxapi/inherit__graph__9.md5 +1 -1
  164. data/doc/cxxapi/inherit__graph__9.png +0 -0
  165. data/doc/cxxapi/inherits.html +30 -31
  166. data/doc/cxxapi/main.html +1 -2
  167. data/doc/cxxapi/modules.html +1 -2
  168. data/doc/cxxapi/structPassenger_1_1AnythingToString-members.html +1 -2
  169. data/doc/cxxapi/structPassenger_1_1AnythingToString.html +2 -3
  170. data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4-members.html +1 -2
  171. data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4.html +2 -3
  172. data/doc/cxxapi/structPassenger_1_1PoolOptions-members.html +49 -0
  173. data/doc/cxxapi/structPassenger_1_1PoolOptions.html +404 -0
  174. data/doc/cxxapi/tree.html +18 -20
  175. data/doc/images/conservative_spawning.png +0 -0
  176. data/doc/images/conservative_spawning.svg +248 -0
  177. data/doc/images/smart-lv2.png +0 -0
  178. data/doc/images/smart-lv2.svg +320 -0
  179. data/doc/rdoc/classes/ConditionVariable.html +68 -34
  180. data/doc/rdoc/classes/Exception.html +16 -16
  181. data/doc/rdoc/classes/GC.html +9 -9
  182. data/doc/rdoc/classes/IO.html +36 -17
  183. data/doc/rdoc/classes/PhusionPassenger.html +183 -0
  184. data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +511 -0
  185. data/doc/rdoc/classes/{Passenger → PhusionPassenger}/AbstractServer.html +285 -242
  186. data/doc/rdoc/classes/{Passenger → PhusionPassenger}/AbstractServer/ServerAlreadyStarted.html +3 -3
  187. data/doc/rdoc/classes/{Passenger → PhusionPassenger}/AbstractServer/ServerError.html +3 -3
  188. data/doc/rdoc/classes/{Passenger → PhusionPassenger}/AbstractServer/ServerNotStarted.html +3 -3
  189. data/doc/rdoc/classes/{Passenger → PhusionPassenger}/AbstractServer/UnknownMessage.html +3 -3
  190. data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +598 -0
  191. data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +140 -0
  192. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess.html +247 -0
  193. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess/Instance.html +138 -0
  194. data/doc/rdoc/classes/{Passenger → PhusionPassenger}/AppInitError.html +36 -19
  195. data/doc/rdoc/classes/{Passenger → PhusionPassenger}/Application.html +81 -96
  196. data/doc/rdoc/classes/{Passenger → PhusionPassenger}/ConsoleTextTemplate.html +18 -18
  197. data/doc/rdoc/classes/{Passenger → PhusionPassenger}/FrameworkInitError.html +20 -18
  198. data/doc/rdoc/classes/{Passenger → PhusionPassenger}/HTMLTemplate.html +18 -18
  199. data/doc/rdoc/classes/{Passenger → PhusionPassenger}/InitializationError.html +9 -9
  200. data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +92 -0
  201. data/doc/rdoc/classes/{Passenger → PhusionPassenger}/MessageChannel.html +93 -92
  202. data/doc/rdoc/classes/{Passenger → PhusionPassenger}/NativeSupport.html +55 -25
  203. data/doc/rdoc/classes/PhusionPassenger/Rack.html +91 -0
  204. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +185 -0
  205. data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +182 -0
  206. data/doc/rdoc/classes/PhusionPassenger/Railz.html +95 -0
  207. data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner.html +424 -0
  208. data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner/Error.html +98 -0
  209. data/doc/rdoc/classes/PhusionPassenger/Railz/CGIFixed.html +200 -0
  210. data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner.html +444 -0
  211. data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner/Error.html +98 -0
  212. data/doc/rdoc/classes/PhusionPassenger/Railz/RequestHandler.html +154 -0
  213. data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +408 -0
  214. data/doc/rdoc/classes/{Passenger → PhusionPassenger}/UnknownError.html +13 -13
  215. data/doc/rdoc/classes/PhusionPassenger/Utils.html +687 -0
  216. data/doc/rdoc/classes/{Passenger → PhusionPassenger}/VersionNotFound.html +8 -8
  217. data/doc/rdoc/classes/PhusionPassenger/WSGI.html +89 -0
  218. data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +188 -0
  219. data/doc/rdoc/classes/PlatformInfo.html +663 -159
  220. data/doc/rdoc/classes/RakeExtensions.html +4 -4
  221. data/doc/rdoc/classes/Signal.html +134 -0
  222. data/doc/rdoc/created.rid +1 -1
  223. data/doc/rdoc/files/DEVELOPERS_TXT.html +15 -10
  224. data/doc/rdoc/files/README.html +5 -7
  225. data/doc/rdoc/files/ext/{passenger → phusion_passenger}/native_support_c.html +2 -2
  226. data/doc/rdoc/files/lib/{passenger → phusion_passenger}/abstract_request_handler_rb.html +7 -9
  227. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +120 -0
  228. data/doc/rdoc/files/lib/{passenger → phusion_passenger}/abstract_server_rb.html +7 -10
  229. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +99 -0
  230. data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +92 -0
  231. data/doc/rdoc/files/lib/{passenger → phusion_passenger}/application_rb.html +6 -8
  232. data/doc/rdoc/files/lib/{passenger → phusion_passenger}/console_text_template_rb.html +5 -7
  233. data/doc/rdoc/files/lib/{passenger → phusion_passenger}/constants_rb.html +4 -5
  234. data/doc/rdoc/files/lib/{passenger → phusion_passenger}/dependencies_rb.html +6 -8
  235. data/doc/rdoc/files/lib/phusion_passenger/events_rb.html +116 -0
  236. data/doc/rdoc/files/lib/{passenger → phusion_passenger}/exceptions_rb.html +5 -7
  237. data/doc/rdoc/files/lib/{passenger → phusion_passenger}/html_template_rb.html +5 -7
  238. data/doc/rdoc/files/lib/{passenger → phusion_passenger}/message_channel_rb.html +5 -7
  239. data/doc/rdoc/files/lib/{passenger → phusion_passenger}/platform_info_rb.html +6 -7
  240. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +123 -0
  241. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +117 -0
  242. data/doc/rdoc/files/lib/{passenger/utils_rb.html → phusion_passenger/railz/application_spawner_rb.html} +24 -17
  243. data/doc/rdoc/files/lib/phusion_passenger/railz/cgi_fixed_rb.html +126 -0
  244. data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +139 -0
  245. data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +118 -0
  246. data/doc/rdoc/files/lib/{passenger → phusion_passenger}/simple_benchmarking_rb.html +5 -7
  247. data/doc/rdoc/files/lib/{passenger → phusion_passenger}/spawn_manager_rb.html +40 -24
  248. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +169 -0
  249. data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +120 -0
  250. data/doc/rdoc/files/lib/rake/extensions_rb.html +3 -4
  251. data/doc/rdoc/fr_class_index.html +37 -19
  252. data/doc/rdoc/fr_file_index.html +25 -14
  253. data/doc/rdoc/fr_method_index.html +145 -74
  254. data/ext/apache2/Application.h +145 -44
  255. data/ext/apache2/ApplicationPool.h +27 -29
  256. data/ext/apache2/ApplicationPoolServer.h +183 -72
  257. data/ext/apache2/ApplicationPoolServerExecutable.cpp +249 -42
  258. data/ext/apache2/Bucket.cpp +61 -9
  259. data/ext/apache2/Bucket.h +15 -8
  260. data/ext/apache2/CachedFileStat.cpp +114 -0
  261. data/ext/apache2/CachedFileStat.h +169 -0
  262. data/ext/apache2/Configuration.cpp +213 -22
  263. data/ext/apache2/Configuration.h +176 -13
  264. data/ext/apache2/DirectoryMapper.h +287 -0
  265. data/ext/apache2/Exceptions.h +30 -12
  266. data/ext/apache2/FileChecker.h +108 -0
  267. data/ext/apache2/Hooks.cpp +709 -493
  268. data/ext/apache2/LICENSE-CNRI.TXT +15 -0
  269. data/ext/apache2/Logging.h +26 -22
  270. data/ext/apache2/MessageChannel.h +124 -15
  271. data/ext/apache2/PoolOptions.h +283 -0
  272. data/ext/apache2/SpawnManager.h +75 -99
  273. data/ext/apache2/StandardApplicationPool.h +296 -195
  274. data/ext/apache2/SystemTime.cpp +28 -0
  275. data/ext/apache2/SystemTime.h +82 -0
  276. data/ext/apache2/Utils.cpp +172 -18
  277. data/ext/apache2/Utils.h +124 -19
  278. data/ext/boost/cstdint.hpp +4 -2
  279. data/ext/boost/current_function.hpp +67 -0
  280. data/ext/boost/detail/sp_counted_base.hpp +4 -4
  281. data/ext/boost/thread/exceptions.hpp +2 -1
  282. data/ext/boost/thread/pthread/thread.hpp +11 -3
  283. data/ext/boost/thread/pthread/thread_data.hpp +2 -1
  284. data/ext/oxt/backtrace.cpp +172 -0
  285. data/ext/oxt/backtrace.hpp +135 -0
  286. data/ext/oxt/detail/backtrace_disabled.hpp +39 -0
  287. data/ext/oxt/detail/backtrace_enabled.hpp +155 -0
  288. data/ext/oxt/detail/spin_lock_gcc_x86.hpp +82 -0
  289. data/ext/oxt/detail/spin_lock_portable.hpp +38 -0
  290. data/ext/oxt/detail/spin_lock_pthreads.hpp +97 -0
  291. data/ext/oxt/detail/tracable_exception_disabled.hpp +46 -0
  292. data/ext/oxt/detail/tracable_exception_enabled.hpp +48 -0
  293. data/ext/oxt/macros.hpp +58 -0
  294. data/ext/oxt/spin_lock.hpp +55 -0
  295. data/ext/{apache2/System.cpp → oxt/system_calls.cpp} +87 -52
  296. data/ext/oxt/system_calls.hpp +234 -0
  297. data/ext/oxt/thread.cpp +32 -0
  298. data/ext/oxt/thread.hpp +223 -0
  299. data/ext/oxt/tracable_exception.cpp +87 -0
  300. data/ext/oxt/tracable_exception.hpp +35 -0
  301. data/{lib/passenger/constants.rb → ext/phusion_passenger/extconf.rb} +14 -9
  302. data/ext/{passenger → phusion_passenger}/native_support.c +33 -6
  303. data/lib/{passenger → phusion_passenger}/abstract_request_handler.rb +209 -93
  304. data/lib/{passenger → phusion_passenger}/abstract_server.rb +23 -8
  305. data/lib/phusion_passenger/abstract_server_collection.rb +301 -0
  306. data/lib/phusion_passenger/admin_tools.rb +25 -0
  307. data/lib/phusion_passenger/admin_tools/control_process.rb +107 -0
  308. data/lib/{passenger → phusion_passenger}/application.rb +13 -16
  309. data/lib/{passenger → phusion_passenger}/console_text_template.rb +2 -2
  310. data/{ext/passenger/extconf.rb → lib/phusion_passenger/constants.rb} +5 -5
  311. data/lib/{passenger → phusion_passenger}/dependencies.rb +38 -32
  312. data/lib/phusion_passenger/events.rb +45 -0
  313. data/lib/{passenger → phusion_passenger}/exceptions.rb +12 -5
  314. data/lib/{passenger → phusion_passenger}/html_template.rb +2 -2
  315. data/lib/{passenger → phusion_passenger}/message_channel.rb +3 -2
  316. data/lib/phusion_passenger/platform_info.rb +500 -0
  317. data/lib/{passenger → phusion_passenger}/rack/application_spawner.rb +29 -22
  318. data/lib/{passenger → phusion_passenger}/rack/request_handler.rb +14 -9
  319. data/lib/{passenger → phusion_passenger}/railz/application_spawner.rb +94 -74
  320. data/lib/{passenger → phusion_passenger}/railz/cgi_fixed.rb +2 -2
  321. data/lib/{passenger → phusion_passenger}/railz/framework_spawner.rb +86 -98
  322. data/lib/{passenger → phusion_passenger}/railz/request_handler.rb +6 -6
  323. data/lib/{passenger → phusion_passenger}/simple_benchmarking.rb +0 -0
  324. data/lib/{passenger → phusion_passenger}/spawn_manager.rb +136 -128
  325. data/lib/{passenger → phusion_passenger}/templates/apache2_config_snippets.txt.erb +0 -0
  326. data/lib/{passenger → phusion_passenger}/templates/apache_must_be_compiled_with_compatible_mpm.txt.erb +0 -0
  327. data/lib/phusion_passenger/templates/app_exited_during_initialization.html.erb +38 -0
  328. data/lib/{passenger → phusion_passenger}/templates/app_init_error.html.erb +0 -0
  329. data/lib/{passenger → phusion_passenger}/templates/database_error.html.erb +0 -0
  330. data/lib/{passenger → phusion_passenger}/templates/deployment_example.txt.erb +1 -1
  331. data/lib/{passenger → phusion_passenger}/templates/error_layout.css +0 -0
  332. data/lib/{passenger → phusion_passenger}/templates/error_layout.html.erb +0 -0
  333. data/lib/{passenger → phusion_passenger}/templates/framework_init_error.html.erb +0 -0
  334. data/lib/{passenger → phusion_passenger}/templates/general_error.html.erb +0 -0
  335. data/lib/{passenger → phusion_passenger}/templates/invalid_app_root.html.erb +1 -1
  336. data/lib/{passenger → phusion_passenger}/templates/load_error.html.erb +0 -0
  337. data/lib/{passenger → phusion_passenger}/templates/no_write_permission_to_passenger_root.txt.erb +0 -0
  338. data/lib/{passenger → phusion_passenger}/templates/possible_solutions_for_compilation_and_installation_problems.txt.erb +0 -0
  339. data/lib/{passenger → phusion_passenger}/templates/run_installer_as_root.txt.erb +0 -0
  340. data/lib/{passenger → phusion_passenger}/templates/version_not_found.html.erb +0 -0
  341. data/lib/{passenger → phusion_passenger}/templates/welcome.txt.erb +0 -0
  342. data/lib/{passenger → phusion_passenger}/utils.rb +210 -44
  343. data/lib/{passenger → phusion_passenger}/wsgi/application_spawner.rb +18 -15
  344. data/lib/{passenger → phusion_passenger}/wsgi/request_handler.py +7 -1
  345. data/man/passenger-memory-stats.8 +1 -1
  346. data/misc/render_error_pages.rb +1 -1
  347. data/test/ApplicationPoolServerTest.cpp +0 -28
  348. data/test/ApplicationPoolServer_ApplicationPoolTest.cpp +4 -0
  349. data/test/ApplicationPoolTest.cpp +307 -69
  350. data/test/CachedFileStatTest.cpp +262 -0
  351. data/test/FileCheckerTest.cpp +79 -0
  352. data/test/MessageChannelTest.cpp +3 -3
  353. data/test/PoolOptionsTest.cpp +37 -0
  354. data/test/SpawnManagerTest.cpp +4 -4
  355. data/test/StandardApplicationPoolTest.cpp +4 -0
  356. data/test/SystemTimeTest.cpp +37 -0
  357. data/test/UtilsTest.cpp +137 -0
  358. data/test/integration_tests.rb +270 -23
  359. data/test/oxt/backtrace_test.cpp +128 -0
  360. data/test/oxt/oxt_test_main.cpp +25 -0
  361. data/test/oxt/syscall_interruption_test.cpp +50 -0
  362. data/test/ruby/abstract_request_handler_spec.rb +83 -0
  363. data/test/ruby/abstract_server_collection_spec.rb +246 -0
  364. data/test/ruby/application_spec.rb +3 -3
  365. data/test/ruby/message_channel_spec.rb +2 -2
  366. data/test/ruby/rack/application_spawner_spec.rb +3 -5
  367. data/test/ruby/rails/application_spawner_spec.rb +54 -15
  368. data/test/ruby/rails/framework_spawner_spec.rb +6 -8
  369. data/test/ruby/rails/minimal_spawner_spec.rb +29 -0
  370. data/test/ruby/rails/spawner_error_handling_spec.rb +1 -1
  371. data/test/ruby/rails/spawner_privilege_lowering_spec.rb +3 -3
  372. data/test/ruby/spawn_manager_spec.rb +23 -12
  373. data/test/ruby/utils_spec.rb +36 -2
  374. data/test/ruby/wsgi/application_spawner_spec.rb +47 -0
  375. data/test/stub/apache2/httpd.conf.erb +3 -5
  376. data/test/stub/message_channel.rb +2 -2
  377. data/test/stub/message_channel_2.rb +2 -2
  378. data/test/stub/message_channel_3.rb +3 -3
  379. data/test/stub/minimal-railsapp/README +0 -0
  380. data/test/stub/minimal-railsapp/config/application.rb +0 -0
  381. data/test/stub/minimal-railsapp/config/environment.rb +0 -0
  382. data/test/stub/minimal-railsapp/vendor/rails/actionmailer/lib/action_mailer.rb +0 -0
  383. data/test/stub/minimal-railsapp/vendor/rails/actionpack/lib/action_controller.rb +0 -0
  384. data/test/stub/minimal-railsapp/vendor/rails/actionpack/lib/action_pack.rb +0 -0
  385. data/test/stub/minimal-railsapp/vendor/rails/actionpack/lib/action_view.rb +0 -0
  386. data/test/stub/minimal-railsapp/vendor/rails/activerecord/lib/active_record.rb +0 -0
  387. data/test/stub/minimal-railsapp/vendor/rails/activeresource/lib/active_resource.rb +0 -0
  388. data/test/stub/minimal-railsapp/vendor/rails/activesupport/lib/active_support.rb +0 -0
  389. data/test/stub/minimal-railsapp/vendor/rails/activesupport/lib/active_support/whiny_nil.rb +0 -0
  390. data/test/stub/minimal-railsapp/vendor/rails/railties/lib/dispatcher.rb +0 -0
  391. data/test/stub/minimal-railsapp/vendor/rails/railties/lib/initializer.rb +0 -0
  392. data/test/stub/minimal-railsapp/vendor/rails/railties/lib/ruby_version_check.rb +0 -0
  393. data/test/stub/rails_apps/foobar/app/controllers/foo_controller.rb +8 -0
  394. data/test/stub/rails_apps/foobar/config/environments/development.rb +1 -2
  395. data/test/stub/rails_apps/mycook/app/controllers/welcome_controller.rb +21 -1
  396. data/test/stub/rails_apps/mycook/sites/some.site/public/uploads.html +26 -0
  397. data/test/stub/rails_apps/mycook/sites/some.site/public/welcome/cached.html +26 -0
  398. data/test/stub/railsapp/app/controllers/application.rb +0 -0
  399. data/test/stub/railsapp/app/controllers/bar_controller_1.rb +0 -0
  400. data/test/stub/railsapp/app/controllers/bar_controller_2.rb +1 -1
  401. data/test/stub/railsapp/app/controllers/foo_controller.rb +4 -0
  402. data/test/stub/railsapp/app/helpers/application_helper.rb +0 -0
  403. data/test/stub/railsapp/config/boot.rb +0 -0
  404. data/test/stub/railsapp/config/database.yml +0 -0
  405. data/test/stub/railsapp/config/environment.rb +0 -0
  406. data/test/stub/railsapp/config/environments/development.rb +0 -0
  407. data/test/stub/railsapp/config/environments/production.rb +0 -0
  408. data/test/stub/railsapp/config/initializers/inflections.rb +0 -0
  409. data/test/stub/railsapp/config/initializers/mime_types.rb +0 -0
  410. data/test/stub/railsapp/config/routes.rb +0 -0
  411. data/test/stub/railsapp/public/useless.txt +0 -0
  412. data/test/stub/spawn_server.rb +3 -4
  413. data/test/stub/wsgi/passenger_wsgi.pyc +0 -0
  414. data/test/support/apache2_controller.rb +57 -7
  415. data/test/support/tut.h +15 -0
  416. data/vendor/README +12 -0
  417. data/vendor/README_FOR_PACKAGERS +1 -0
  418. data/vendor/rack-0.9.1/AUTHORS +8 -0
  419. data/vendor/rack-0.9.1/COPYING +18 -0
  420. data/vendor/rack-0.9.1/ChangeLog +1423 -0
  421. data/vendor/rack-0.9.1/KNOWN-ISSUES +18 -0
  422. data/vendor/rack-0.9.1/README +306 -0
  423. data/vendor/rack-0.9.1/Rakefile +188 -0
  424. data/vendor/rack-0.9.1/SPEC +129 -0
  425. data/vendor/rack-0.9.1/lib/rack.rb +86 -0
  426. data/vendor/rack-0.9.1/lib/rack/adapter/camping.rb +22 -0
  427. data/vendor/rack-0.9.1/lib/rack/auth/abstract/handler.rb +28 -0
  428. data/vendor/rack-0.9.1/lib/rack/auth/abstract/request.rb +37 -0
  429. data/vendor/rack-0.9.1/lib/rack/auth/basic.rb +58 -0
  430. data/vendor/rack-0.9.1/lib/rack/auth/digest/md5.rb +124 -0
  431. data/vendor/rack-0.9.1/lib/rack/auth/digest/nonce.rb +51 -0
  432. data/vendor/rack-0.9.1/lib/rack/auth/digest/params.rb +55 -0
  433. data/vendor/rack-0.9.1/lib/rack/auth/digest/request.rb +40 -0
  434. data/vendor/rack-0.9.1/lib/rack/auth/openid.rb +438 -0
  435. data/vendor/rack-0.9.1/lib/rack/builder.rb +67 -0
  436. data/vendor/rack-0.9.1/lib/rack/cascade.rb +36 -0
  437. data/vendor/rack-0.9.1/lib/rack/commonlogger.rb +61 -0
  438. data/vendor/rack-0.9.1/lib/rack/conditionalget.rb +43 -0
  439. data/vendor/rack-0.9.1/lib/rack/content_length.rb +25 -0
  440. data/vendor/rack-0.9.1/lib/rack/deflater.rb +87 -0
  441. data/vendor/rack-0.9.1/lib/rack/directory.rb +150 -0
  442. data/vendor/rack-0.9.1/lib/rack/file.rb +85 -0
  443. data/vendor/rack-0.9.1/lib/rack/handler.rb +48 -0
  444. data/vendor/rack-0.9.1/lib/rack/handler/cgi.rb +57 -0
  445. data/vendor/rack-0.9.1/lib/rack/handler/evented_mongrel.rb +8 -0
  446. data/vendor/rack-0.9.1/lib/rack/handler/fastcgi.rb +86 -0
  447. data/vendor/rack-0.9.1/lib/rack/handler/lsws.rb +52 -0
  448. data/vendor/rack-0.9.1/lib/rack/handler/mongrel.rb +82 -0
  449. data/vendor/rack-0.9.1/lib/rack/handler/scgi.rb +57 -0
  450. data/vendor/rack-0.9.1/lib/rack/handler/swiftiplied_mongrel.rb +8 -0
  451. data/vendor/rack-0.9.1/lib/rack/handler/thin.rb +15 -0
  452. data/vendor/rack-0.9.1/lib/rack/handler/webrick.rb +61 -0
  453. data/vendor/rack-0.9.1/lib/rack/head.rb +19 -0
  454. data/vendor/rack-0.9.1/lib/rack/lint.rb +465 -0
  455. data/vendor/rack-0.9.1/lib/rack/lobster.rb +65 -0
  456. data/vendor/rack-0.9.1/lib/rack/methodoverride.rb +27 -0
  457. data/vendor/rack-0.9.1/lib/rack/mime.rb +204 -0
  458. data/vendor/rack-0.9.1/lib/rack/mock.rb +160 -0
  459. data/vendor/rack-0.9.1/lib/rack/recursive.rb +57 -0
  460. data/vendor/rack-0.9.1/lib/rack/reloader.rb +64 -0
  461. data/vendor/rack-0.9.1/lib/rack/request.rb +218 -0
  462. data/vendor/rack-0.9.1/lib/rack/response.rb +171 -0
  463. data/vendor/rack-0.9.1/lib/rack/session/abstract/id.rb +153 -0
  464. data/vendor/rack-0.9.1/lib/rack/session/cookie.rb +89 -0
  465. data/vendor/rack-0.9.1/lib/rack/session/memcache.rb +97 -0
  466. data/vendor/rack-0.9.1/lib/rack/session/pool.rb +73 -0
  467. data/vendor/rack-0.9.1/lib/rack/showexceptions.rb +348 -0
  468. data/vendor/rack-0.9.1/lib/rack/showstatus.rb +106 -0
  469. data/vendor/rack-0.9.1/lib/rack/static.rb +38 -0
  470. data/vendor/rack-0.9.1/lib/rack/urlmap.rb +48 -0
  471. data/vendor/rack-0.9.1/lib/rack/utils.rb +347 -0
  472. metadata +1197 -1055
  473. data/doc/cxxapi/System_8h-source.html +0 -251
  474. data/doc/cxxapi/classDirectoryMapper-members.html +0 -38
  475. data/doc/cxxapi/classDirectoryMapper.html +0 -203
  476. data/doc/cxxapi/classPassenger_1_1Thread.html +0 -100
  477. data/doc/cxxapi/classboost_1_1this__thread_1_1disable__syscall__interruption.html +0 -46
  478. data/doc/cxxapi/classboost_1_1this__thread_1_1restore__syscall__interruption-members.html +0 -33
  479. data/doc/cxxapi/classboost_1_1this__thread_1_1restore__syscall__interruption.html +0 -44
  480. data/doc/cxxapi/namespacePassenger.html +0 -208
  481. data/doc/cxxapi/namespacePassenger_1_1InterruptableCalls.html +0 -43
  482. data/doc/cxxapi/namespacemembers.html +0 -70
  483. data/doc/cxxapi/namespacemembers_func.html +0 -66
  484. data/doc/cxxapi/namespacemembers_type.html +0 -46
  485. data/doc/cxxapi/namespaces.html +0 -35
  486. data/doc/rdoc/classes/Passenger.html +0 -136
  487. data/doc/rdoc/classes/Passenger/AbstractRequestHandler.html +0 -402
  488. data/doc/rdoc/classes/Passenger/SpawnManager.html +0 -379
  489. data/doc/rdoc/classes/Passenger/Utils.html +0 -578
  490. data/ext/apache2/System.h +0 -228
  491. data/lib/passenger/platform_info.rb +0 -302
  492. data/lib/passenger/templates/app_exited_during_initialization.html.erb +0 -19
  493. data/test/stub/apache2/httpd.conf +0 -75
  494. data/test/stub/rails_apps/foobar/config/environments/test.rb +0 -22
  495. data/test/stub/rails_apps/mycook/config/environments/test.rb +0 -22
  496. data/test/stub/railsapp/config/environments/test.rb +0 -22
  497. data/test/stub/railsapp2/config/environments/test.rb +0 -22
@@ -4,7 +4,7 @@
4
4
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
5
  <html>
6
6
  <head>
7
- <title>Class: Passenger::VersionNotFound</title>
7
+ <title>Class: PhusionPassenger::VersionNotFound</title>
8
8
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
9
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
10
10
 
@@ -51,13 +51,13 @@
51
51
 
52
52
  <body>
53
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 />Passenger::VersionNotFound</td>
54
+ <td class="file-title"><span class="file-title-prefix">Class</span><br />PhusionPassenger::VersionNotFound</td>
55
55
  <td align="right">
56
56
  <table cellspacing="0" cellpadding="2">
57
57
  <tr valign="top">
58
58
  <td>In:</td>
59
59
  <td>
60
- <a href="../../files/lib/passenger/exceptions_rb.html">lib/passenger/exceptions.rb</a>
60
+ <a href="../../files/lib/phusion_passenger/exceptions_rb.html">lib/phusion_passenger/exceptions.rb</a>
61
61
  </td>
62
62
  </tr>
63
63
  <tr>
@@ -85,7 +85,7 @@ given Ruby on Rails Gem version specification.
85
85
 
86
86
  <div class="sectiontitle">Methods</div>
87
87
  <ul>
88
- <li><a href="#M000029">new</a></li>
88
+ <li><a href="#M000088">new</a></li>
89
89
  </ul>
90
90
 
91
91
 
@@ -106,7 +106,7 @@ given Ruby on Rails Gem version specification.
106
106
  <div class="sectiontitle">Public Class methods</div>
107
107
  <div class="method">
108
108
  <div class="title">
109
- <a name="M000029"></a><b>new</b>(message, gem_version_spec)
109
+ <a name="M000088"></a><b>new</b>(message, gem_version_spec)
110
110
  </div>
111
111
  <div class="description">
112
112
  <ul>
@@ -120,10 +120,10 @@ caused this error.
120
120
  </ul>
121
121
  </div>
122
122
  <div class="sourcecode">
123
- <p class="source-link">[ <a href="javascript:toggleSource('M000029_source')" id="l_M000029_source">show source</a> ]</p>
124
- <div id="M000029_source" class="dyn-source">
123
+ <p class="source-link">[ <a href="javascript:toggleSource('M000088_source')" id="l_M000088_source">show source</a> ]</p>
124
+ <div id="M000088_source" class="dyn-source">
125
125
  <pre>
126
- <span class="ruby-comment cmt"># File lib/passenger/exceptions.rb, line 28</span>
126
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/exceptions.rb, line 28</span>
127
127
  28: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">message</span>, <span class="ruby-identifier">gem_version_spec</span>)
128
128
  29: <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">message</span>)
129
129
  30: <span class="ruby-ivar">@gem_version_spec</span> = <span class="ruby-identifier">gem_version_spec</span>
@@ -0,0 +1,89 @@
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::WSGI</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::WSGI</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/wsgi/application_spawner_rb.html">lib/phusion_passenger/wsgi/application_spawner.rb</a>
61
+ </td>
62
+ </tr>
63
+ </table>
64
+ </td>
65
+ </tr>
66
+ </table>
67
+ <!-- banner header -->
68
+
69
+ <div id="bodyContent">
70
+ <div id="content">
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+ <div class="sectiontitle">Classes and Modules</div>
79
+ Class <a href="WSGI/ApplicationSpawner.html" class="link">PhusionPassenger::WSGI::ApplicationSpawner</a><br />
80
+
81
+
82
+
83
+
84
+ </div>
85
+
86
+ </div>
87
+
88
+ </body>
89
+ </html>
@@ -0,0 +1,188 @@
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::WSGI::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::WSGI::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/wsgi/application_spawner_rb.html">lib/phusion_passenger/wsgi/application_spawner.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
+ <div class="description"><p>
79
+ Class for spawning <a href="../WSGI.html">WSGI</a> applications.
80
+ </p>
81
+ </div>
82
+
83
+
84
+
85
+ <div class="sectiontitle">Methods</div>
86
+ <ul>
87
+ <li><a href="#M000055">spawn_application</a></li>
88
+ <li><a href="#M000056">spawn_application</a></li>
89
+ </ul>
90
+
91
+ <div class="sectiontitle">Included Modules</div>
92
+ <ul>
93
+ <li><a href="../Utils.html">Utils</a></li>
94
+ </ul>
95
+
96
+
97
+
98
+ <div class="sectiontitle">Constants</div>
99
+ <table border='0' cellpadding='5'>
100
+ <tr valign='top'>
101
+ <td class="attr-name">REQUEST_HANDLER</td>
102
+ <td>=</td>
103
+ <td class="attr-value">File.expand_path(File.dirname(__FILE__) + &quot;/request_handler.py&quot;)</td>
104
+ </tr>
105
+ </table>
106
+
107
+
108
+ <div class="sectiontitle">Public Class methods</div>
109
+ <div class="method">
110
+ <div class="title">
111
+ <a name="M000055"></a><b>spawn_application</b>(*args)
112
+ </div>
113
+ <div class="sourcecode">
114
+ <p class="source-link">[ <a href="javascript:toggleSource('M000055_source')" id="l_M000055_source">show source</a> ]</p>
115
+ <div id="M000055_source" class="dyn-source">
116
+ <pre>
117
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/wsgi/application_spawner.rb, line 29</span>
118
+ 29: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">spawn_application</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
119
+ 30: <span class="ruby-ivar">@@instance</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">ApplicationSpawner</span>.<span class="ruby-identifier">new</span>
120
+ 31: <span class="ruby-ivar">@@instance</span>.<span class="ruby-identifier">spawn_application</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
121
+ 32: <span class="ruby-keyword kw">end</span>
122
+ </pre>
123
+ </div>
124
+ </div>
125
+ </div>
126
+ <div class="sectiontitle">Public Instance methods</div>
127
+ <div class="method">
128
+ <div class="title">
129
+ <a name="M000056"></a><b>spawn_application</b>(app_root, lower_privilege = true, lowest_user = &quot;nobody&quot;, environment = &quot;production&quot;)
130
+ </div>
131
+ <div class="description">
132
+ <p>
133
+ Spawn an instance of the given <a href="../WSGI.html">WSGI</a> application.
134
+ When successful, an <a href="../Application.html">Application</a> object
135
+ will be returned, which represents the spawned application.
136
+ </p>
137
+ <p>
138
+ Raises:
139
+ </p>
140
+ <ul>
141
+ <li><a href="../AppInitError.html">AppInitError</a>: The <a
142
+ href="../WSGI.html">WSGI</a> application raised an exception or called
143
+ exit() during startup.
144
+
145
+ </li>
146
+ <li>SystemCallError, IOError, SocketError: Something went wrong.
147
+
148
+ </li>
149
+ </ul>
150
+ </div>
151
+ <div class="sourcecode">
152
+ <p class="source-link">[ <a href="javascript:toggleSource('M000056_source')" id="l_M000056_source">show source</a> ]</p>
153
+ <div id="M000056_source" class="dyn-source">
154
+ <pre>
155
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/wsgi/application_spawner.rb, line 42</span>
156
+ 42: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">spawn_application</span>(<span class="ruby-identifier">app_root</span>, <span class="ruby-identifier">lower_privilege</span> = <span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">lowest_user</span> = <span class="ruby-value str">&quot;nobody&quot;</span>, <span class="ruby-identifier">environment</span> = <span class="ruby-value str">&quot;production&quot;</span>)
157
+ 43: <span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span> = <span class="ruby-constant">UNIXSocket</span>.<span class="ruby-identifier">pair</span>
158
+ 44: <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>
159
+ 45: <span class="ruby-identifier">a</span>.<span class="ruby-identifier">close</span>
160
+ 46:
161
+ 47: <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>]
162
+ 48: <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>)
163
+ 49: <span class="ruby-identifier">close_all_io_objects_for_fds</span>(<span class="ruby-identifier">file_descriptors_to_leave_open</span>)
164
+ 50:
165
+ 51: <span class="ruby-identifier">run</span>(<span class="ruby-constant">MessageChannel</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">b</span>), <span class="ruby-identifier">app_root</span>, <span class="ruby-identifier">lower_privilege</span>, <span class="ruby-identifier">lowest_user</span>, <span class="ruby-identifier">environment</span>)
166
+ 52: <span class="ruby-keyword kw">end</span>
167
+ 53: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">close</span>
168
+ 54: <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>
169
+ 55:
170
+ 56: <span class="ruby-identifier">channel</span> = <span class="ruby-constant">MessageChannel</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">a</span>)
171
+ 57: <span class="ruby-identifier">pid</span>, <span class="ruby-identifier">socket_name</span>, <span class="ruby-identifier">socket_type</span> = <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read</span>
172
+ 58: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pid</span>.<span class="ruby-identifier">nil?</span>
173
+ 59: <span class="ruby-identifier">raise</span> <span class="ruby-constant">IOError</span>, <span class="ruby-value str">&quot;Connection closed&quot;</span>
174
+ 60: <span class="ruby-keyword kw">end</span>
175
+ 61: <span class="ruby-identifier">owner_pipe</span> = <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">recv_io</span>
176
+ 62: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Application</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@app_root</span>, <span class="ruby-identifier">pid</span>, <span class="ruby-identifier">socket_name</span>,
177
+ 63: <span class="ruby-identifier">socket_type</span>, <span class="ruby-identifier">owner_pipe</span>)
178
+ 64: <span class="ruby-keyword kw">end</span>
179
+ </pre>
180
+ </div>
181
+ </div>
182
+ </div>
183
+ </div>
184
+
185
+ </div>
186
+
187
+ </body>
188
+ </html>
@@ -57,7 +57,7 @@
57
57
  <tr valign="top">
58
58
  <td>In:</td>
59
59
  <td>
60
- <a href="../files/lib/passenger/platform_info_rb.html">lib/passenger/platform_info.rb</a>
60
+ <a href="../files/lib/phusion_passenger/platform_info_rb.html">lib/phusion_passenger/platform_info.rb</a>
61
61
  </td>
62
62
  </tr>
63
63
  </table>
@@ -75,8 +75,9 @@ that information through constants.
75
75
  </p>
76
76
  <p>
77
77
  Users can change the detection behavior by setting the environment variable
78
- <tt>APXS2</tt> to the correct &#8216;apxs&#8217; (or &#8216;apxs2&#8217;)
79
- binary, as provided by Apache.
78
+ <tt>APXS2</tt> to the correct &#8216;apxs&#8217; (or &#8216;<a
79
+ href="PlatformInfo.html#M000014">apxs2</a>&#8217;) binary, as provided by
80
+ Apache.
80
81
  </p>
81
82
  </div>
82
83
 
@@ -84,7 +85,28 @@ binary, as provided by Apache.
84
85
 
85
86
  <div class="sectiontitle">Methods</div>
86
87
  <ul>
87
- <li><a href="#M000007">find_command</a></li>
88
+ <li><a href="#M000019">apache2_bindir</a></li>
89
+ <li><a href="#M000024">apache2_module_cflags</a></li>
90
+ <li><a href="#M000025">apache2_module_ldflags</a></li>
91
+ <li><a href="#M000020">apache2_sbindir</a></li>
92
+ <li><a href="#M000015">apache2ctl</a></li>
93
+ <li><a href="#M000017">apr_config</a></li>
94
+ <li><a href="#M000030">apr_config_needed_for_building_apache_modules?</a></li>
95
+ <li><a href="#M000026">apr_flags</a></li>
96
+ <li><a href="#M000027">apr_libs</a></li>
97
+ <li><a href="#M000018">apu_config</a></li>
98
+ <li><a href="#M000028">apu_flags</a></li>
99
+ <li><a href="#M000029">apu_libs</a></li>
100
+ <li><a href="#M000014">apxs2</a></li>
101
+ <li><a href="#M000023">debugging_cflags</a></li>
102
+ <li><a href="#M000011">find_command</a></li>
103
+ <li><a href="#M000016">httpd</a></li>
104
+ <li><a href="#M000031">library_extension</a></li>
105
+ <li><a href="#M000032">linux_distro</a></li>
106
+ <li><a href="#M000021">portability_cflags</a></li>
107
+ <li><a href="#M000022">portability_ldflags</a></li>
108
+ <li><a href="#M000012">rake</a></li>
109
+ <li><a href="#M000013">rspec</a></li>
88
110
  </ul>
89
111
 
90
112
 
@@ -107,7 +129,7 @@ The absolute path to the current Ruby interpreter.
107
129
  <tr valign='top'>
108
130
  <td class="attr-name">GEM</td>
109
131
  <td>=</td>
110
- <td class="attr-value">determine_gem_command</td>
132
+ <td class="attr-value">locate_ruby_executable('gem')</td>
111
133
  </tr>
112
134
  <tr valign='top'>
113
135
  <td>&nbsp;</td>
@@ -116,155 +138,424 @@ The correct &#8216;gem&#8217; command for this Ruby interpreter.
116
138
 
117
139
  </td>
118
140
  </tr>
119
- <tr valign='top'>
120
- <td class="attr-name">APXS2</td>
121
- <td>=</td>
122
- <td class="attr-value">find_apxs2</td>
123
- </tr>
124
- <tr valign='top'>
125
- <td>&nbsp;</td>
126
- <td colspan="2" class="attr-desc">
127
- The absolute path to the &#8216;apxs&#8217; or &#8216;apxs2&#8217;
128
- executable.
141
+ </table>
129
142
 
130
- </td>
131
- </tr>
132
- <tr valign='top'>
133
- <td class="attr-name">APACHE2_BINDIR</td>
134
- <td>=</td>
135
- <td class="attr-value">determine_apache2_bindir</td>
136
- </tr>
137
- <tr valign='top'>
138
- <td>&nbsp;</td>
139
- <td colspan="2" class="attr-desc">
140
- The absolute path to the Apache 2 &#8216;bin&#8217; directory.
141
143
 
142
- </td>
143
- </tr>
144
- <tr valign='top'>
145
- <td class="attr-name">APACHE2_SBINDIR</td>
146
- <td>=</td>
147
- <td class="attr-value">determine_apache2_sbindir</td>
148
- </tr>
149
- <tr valign='top'>
150
- <td>&nbsp;</td>
151
- <td colspan="2" class="attr-desc">
144
+ <div class="sectiontitle">Public Class methods</div>
145
+ <div class="method">
146
+ <div class="title">
147
+ <a name="M000019"></a><b>apache2_bindir</b>()
148
+ </div>
149
+ <div class="description">
150
+ <p>
151
+ The absolute path to the Apache 2 &#8216;bin&#8217; directory.
152
+ </p>
153
+ </div>
154
+ <div class="sourcecode">
155
+ <p class="source-link">[ <a href="javascript:toggleSource('M000019_source')" id="l_M000019_source">show source</a> ]</p>
156
+ <div id="M000019_source" class="dyn-source">
157
+ <pre>
158
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 305</span>
159
+ 305: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apache2_bindir</span>
160
+ 306: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">apxs2</span>.<span class="ruby-identifier">nil?</span>
161
+ 307: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
162
+ 308: <span class="ruby-keyword kw">else</span>
163
+ 309: <span class="ruby-keyword kw">return</span> <span class="ruby-node">`#{apxs2} -q BINDIR 2&gt;/dev/null`</span>.<span class="ruby-identifier">strip</span>
164
+ 310: <span class="ruby-keyword kw">end</span>
165
+ 311: <span class="ruby-keyword kw">end</span>
166
+ </pre>
167
+ </div>
168
+ </div>
169
+ </div>
170
+ <div class="method">
171
+ <div class="title">
172
+ <a name="M000024"></a><b>apache2_module_cflags</b>(with_apr_flags = true)
173
+ </div>
174
+ <div class="description">
175
+ <p>
176
+ The C compiler flags that are necessary to compile an Apache module.
177
+ Includes <a href="PlatformInfo.html#M000021">portability_cflags</a>.
178
+ </p>
179
+ </div>
180
+ <div class="sourcecode">
181
+ <p class="source-link">[ <a href="javascript:toggleSource('M000024_source')" id="l_M000024_source">show source</a> ]</p>
182
+ <div id="M000024_source" class="dyn-source">
183
+ <pre>
184
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 372</span>
185
+ 372: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apache2_module_cflags</span>(<span class="ruby-identifier">with_apr_flags</span> = <span class="ruby-keyword kw">true</span>)
186
+ 373: <span class="ruby-identifier">flags</span> = [<span class="ruby-value str">&quot;-fPIC&quot;</span>]
187
+ 374: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">with_apr_flags</span>
188
+ 375: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">apr_flags</span>
189
+ 376: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">apu_flags</span>
190
+ 377: <span class="ruby-keyword kw">end</span>
191
+ 378: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">apxs2</span>.<span class="ruby-identifier">nil?</span>
192
+ 379: <span class="ruby-identifier">apxs2_flags</span> = <span class="ruby-node">`#{apxs2} -q CFLAGS`</span>.<span class="ruby-identifier">strip</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; -I&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">`#{apxs2} -q INCLUDEDIR`</span>.<span class="ruby-identifier">strip</span>
193
+ 380: <span class="ruby-identifier">apxs2_flags</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/-O\d? /</span>, <span class="ruby-value str">''</span>)
194
+ 381:
195
+ 382: <span class="ruby-comment cmt"># Remove flags not supported by GCC</span>
196
+ 383: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/solaris/</span> <span class="ruby-comment cmt"># TODO: Add support for people using SunStudio</span>
197
+ 384: <span class="ruby-comment cmt"># The big problem is Coolstack apxs includes a bunch of solaris -x directives.</span>
198
+ 385: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">apxs2_flags</span>.<span class="ruby-identifier">split</span>
199
+ 386: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">reject!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\-x/</span> }
200
+ 387: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">reject!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\-Xa/</span> }
201
+ 388: <span class="ruby-identifier">apxs2_flags</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">' '</span>)
202
+ 389: <span class="ruby-keyword kw">end</span>
203
+ 390:
204
+ 391: <span class="ruby-identifier">apxs2_flags</span>.<span class="ruby-identifier">strip!</span>
205
+ 392: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">apxs2_flags</span>
206
+ 393: <span class="ruby-keyword kw">end</span>
207
+ 394: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">httpd</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/darwin/</span>
208
+ 395: <span class="ruby-comment cmt"># Add possible universal binary flags.</span>
209
+ 396: <span class="ruby-identifier">architectures</span> = []
210
+ 397: <span class="ruby-node">`file &quot;#{httpd}&quot;`</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;\n&quot;</span>).<span class="ruby-identifier">grep</span>(<span class="ruby-regexp re">/for architecture/</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
211
+ 398: <span class="ruby-identifier">line</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/for architecture (.*?)\)/</span>
212
+ 399: <span class="ruby-identifier">architectures</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;-arch #{$1}&quot;</span>
213
+ 400: <span class="ruby-keyword kw">end</span>
214
+ 401: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">architectures</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">' '</span>)
215
+ 402: <span class="ruby-keyword kw">end</span>
216
+ 403: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">portability_cflags</span>
217
+ 404: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">' '</span>).<span class="ruby-identifier">strip</span>
218
+ 405: <span class="ruby-keyword kw">end</span>
219
+ </pre>
220
+ </div>
221
+ </div>
222
+ </div>
223
+ <div class="method">
224
+ <div class="title">
225
+ <a name="M000025"></a><b>apache2_module_ldflags</b>()
226
+ </div>
227
+ <div class="description">
228
+ <p>
229
+ Linker flags that are necessary for linking an Apache module. Includes <a
230
+ href="PlatformInfo.html#M000022">portability_ldflags</a>
231
+ </p>
232
+ </div>
233
+ <div class="sourcecode">
234
+ <p class="source-link">[ <a href="javascript:toggleSource('M000025_source')" id="l_M000025_source">show source</a> ]</p>
235
+ <div id="M000025_source" class="dyn-source">
236
+ <pre>
237
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 410</span>
238
+ 410: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apache2_module_ldflags</span>
239
+ 411: <span class="ruby-identifier">flags</span> = <span class="ruby-node">&quot;-fPIC #{apr_libs} #{apu_libs} #{portability_ldflags}&quot;</span>
240
+ 412: <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">strip!</span>
241
+ 413: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">flags</span>
242
+ 414: <span class="ruby-keyword kw">end</span>
243
+ </pre>
244
+ </div>
245
+ </div>
246
+ </div>
247
+ <div class="method">
248
+ <div class="title">
249
+ <a name="M000020"></a><b>apache2_sbindir</b>()
250
+ </div>
251
+ <div class="description">
252
+ <p>
152
253
  The absolute path to the Apache 2 &#8216;sbin&#8217; directory.
153
-
154
- </td>
155
- </tr>
156
- <tr valign='top'>
157
- <td class="attr-name">APACHE2CTL</td>
158
- <td>=</td>
159
- <td class="attr-value">find_apache2ctl</td>
160
- </tr>
161
- <tr valign='top'>
162
- <td>&nbsp;</td>
163
- <td colspan="2" class="attr-desc">
164
- The absolute path to the &#8216;apachectl&#8217; or
165
- &#8216;apache2ctl&#8217; binary.
166
-
167
- </td>
168
- </tr>
169
- <tr valign='top'>
170
- <td class="attr-name">HTTPD</td>
171
- <td>=</td>
172
- <td class="attr-value">find_httpd</td>
173
- </tr>
174
- <tr valign='top'>
175
- <td>&nbsp;</td>
176
- <td colspan="2" class="attr-desc">
177
- The absolute path to the Apache binary (that is, &#8216;httpd&#8217;,
178
- &#8216;httpd2&#8217;, &#8216;apache&#8217; or &#8216;apache2&#8217;).
179
-
180
- </td>
181
- </tr>
182
- <tr valign='top'>
183
- <td class="attr-name">APR_CONFIG</td>
184
- <td>=</td>
185
- <td class="attr-value">find_apr_config</td>
186
- </tr>
187
- <tr valign='top'>
188
- <td>&nbsp;</td>
189
- <td colspan="2" class="attr-desc">
254
+ </p>
255
+ </div>
256
+ <div class="sourcecode">
257
+ <p class="source-link">[ <a href="javascript:toggleSource('M000020_source')" id="l_M000020_source">show source</a> ]</p>
258
+ <div id="M000020_source" class="dyn-source">
259
+ <pre>
260
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 315</span>
261
+ 315: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apache2_sbindir</span>
262
+ 316: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">apxs2</span>.<span class="ruby-identifier">nil?</span>
263
+ 317: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
264
+ 318: <span class="ruby-keyword kw">else</span>
265
+ 319: <span class="ruby-keyword kw">return</span> <span class="ruby-node">`#{apxs2} -q SBINDIR`</span>.<span class="ruby-identifier">strip</span>
266
+ 320: <span class="ruby-keyword kw">end</span>
267
+ 321: <span class="ruby-keyword kw">end</span>
268
+ </pre>
269
+ </div>
270
+ </div>
271
+ </div>
272
+ <div class="method">
273
+ <div class="title">
274
+ <a name="M000015"></a><b>apache2ctl</b>()
275
+ </div>
276
+ <div class="description">
277
+ <p>
278
+ The absolute path to the &#8216;apachectl&#8217; or &#8216;<a
279
+ href="PlatformInfo.html#M000015">apache2ctl</a>&#8217; binary.
280
+ </p>
281
+ </div>
282
+ <div class="sourcecode">
283
+ <p class="source-link">[ <a href="javascript:toggleSource('M000015_source')" id="l_M000015_source">show source</a> ]</p>
284
+ <div id="M000015_source" class="dyn-source">
285
+ <pre>
286
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 227</span>
287
+ 227: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apache2ctl</span>
288
+ 228: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">find_apache2_executable</span>(<span class="ruby-value str">'apache2ctl'</span>, <span class="ruby-value str">'apachectl2'</span>, <span class="ruby-value str">'apachectl'</span>)
289
+ 229: <span class="ruby-keyword kw">end</span>
290
+ </pre>
291
+ </div>
292
+ </div>
293
+ </div>
294
+ <div class="method">
295
+ <div class="title">
296
+ <a name="M000017"></a><b>apr_config</b>()
297
+ </div>
298
+ <div class="description">
299
+ <p>
190
300
  The absolute path to the &#8216;apr-config&#8217; or
191
301
  &#8216;apr-1-config&#8217; executable.
192
-
193
- </td>
194
- </tr>
195
- <tr valign='top'>
196
- <td class="attr-name">APU_CONFIG</td>
197
- <td>=</td>
198
- <td class="attr-value">find_apu_config</td>
199
- </tr>
200
- <tr valign='top'>
201
- <td class="attr-name">APXS2_FLAGS</td>
202
- <td>=</td>
203
- <td class="attr-value">determine_apxs2_flags</td>
204
- </tr>
205
- <tr valign='top'>
206
- <td>&nbsp;</td>
207
- <td colspan="2" class="attr-desc">
208
- The C compiler flags that are necessary to compile an Apache module.
209
-
210
- </td>
211
- </tr>
212
- <tr valign='top'>
213
- <td class="attr-name">APR_LIBS</td>
214
- <td>=</td>
215
- <td class="attr-value">determine_apr_info</td>
216
- </tr>
217
- <tr valign='top'>
218
- <td class="attr-name">APU_LIBS</td>
219
- <td>=</td>
220
- <td class="attr-value">determine_apu_info</td>
221
- </tr>
222
- <tr valign='top'>
223
- <td class="attr-name">MULTI_ARCH_FLAGS</td>
224
- <td>=</td>
225
- <td class="attr-value">determine_multi_arch_flags</td>
226
- </tr>
227
- <tr valign='top'>
228
- <td>&nbsp;</td>
229
- <td colspan="2" class="attr-desc">
230
- The C compiler flags that are necessary for building binaries in the same
231
- architecture(s) as Apache.
232
-
233
- </td>
234
- </tr>
235
- <tr valign='top'>
236
- <td class="attr-name">LIBEXT</td>
237
- <td>=</td>
238
- <td class="attr-value">determine_library_extension</td>
239
- </tr>
240
- <tr valign='top'>
241
- <td>&nbsp;</td>
242
- <td colspan="2" class="attr-desc">
243
- The current platform&#8216;s shared library extension (&#8216;so&#8217; on
244
- most Unices).
245
-
246
- </td>
247
- </tr>
248
- <tr valign='top'>
249
- <td class="attr-name">LINUX_DISTRO</td>
250
- <td>=</td>
251
- <td class="attr-value">determine_linux_distro</td>
252
- </tr>
253
- <tr valign='top'>
254
- <td>&nbsp;</td>
255
- <td colspan="2" class="attr-desc">
256
- An identifier for the current Linux distribution. nil if the operating
257
- system is not Linux.
258
-
259
- </td>
260
- </tr>
261
- </table>
262
-
263
-
264
- <div class="sectiontitle">Public Class methods</div>
302
+ </p>
303
+ </div>
304
+ <div class="sourcecode">
305
+ <p class="source-link">[ <a href="javascript:toggleSource('M000017_source')" id="l_M000017_source">show source</a> ]</p>
306
+ <div id="M000017_source" class="dyn-source">
307
+ <pre>
308
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 251</span>
309
+ 251: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apr_config</span>
310
+ 252: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env_defined?</span>(<span class="ruby-value str">'APR_CONFIG'</span>)
311
+ 253: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'APR_CONFIG'</span>]
312
+ 254: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">apxs2</span>.<span class="ruby-identifier">nil?</span>
313
+ 255: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
314
+ 256: <span class="ruby-keyword kw">else</span>
315
+ 257: <span class="ruby-identifier">filename</span> = <span class="ruby-node">`#{apxs2} -q APR_CONFIG 2&gt;/dev/null`</span>.<span class="ruby-identifier">strip</span>
316
+ 258: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">empty?</span>
317
+ 259: <span class="ruby-identifier">apr_bindir</span> = <span class="ruby-node">`#{apxs2} -q APR_BINDIR 2&gt;/dev/null`</span>.<span class="ruby-identifier">strip</span>
318
+ 260: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">apr_bindir</span>.<span class="ruby-identifier">empty?</span>
319
+ 261: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
320
+ 262: <span class="ruby-keyword kw">else</span>
321
+ 263: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">select_executable</span>(<span class="ruby-identifier">apr_bindir</span>,
322
+ 264: <span class="ruby-value str">&quot;apr-1-config&quot;</span>, <span class="ruby-value str">&quot;apr-config&quot;</span>)
323
+ 265: <span class="ruby-keyword kw">end</span>
324
+ 266: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">filename</span>)
325
+ 267: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">filename</span>
326
+ 268: <span class="ruby-keyword kw">else</span>
327
+ 269: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
328
+ 270: <span class="ruby-keyword kw">end</span>
329
+ 271: <span class="ruby-keyword kw">end</span>
330
+ 272: <span class="ruby-keyword kw">end</span>
331
+ </pre>
332
+ </div>
333
+ </div>
334
+ </div>
335
+ <div class="method">
336
+ <div class="title">
337
+ <a name="M000030"></a><b>apr_config_needed_for_building_apache_modules?</b>()
338
+ </div>
339
+ <div class="description">
340
+ <p>
341
+ Returns whether it is necessary to use information outputted by
342
+ &#8216;apr-config&#8217; and &#8216;apu-config&#8217; in order to compile
343
+ an Apache module. When Apache is installed with &#8212;with-included-apr,
344
+ the APR/APU headers are placed into the same directory as the Apache
345
+ headers, and so &#8216;apr-config&#8217; and &#8216;apu-config&#8217;
346
+ won&#8216;t be necessary in that case.
347
+ </p>
348
+ </div>
349
+ <div class="sourcecode">
350
+ <p class="source-link">[ <a href="javascript:toggleSource('M000030_source')" id="l_M000030_source">show source</a> ]</p>
351
+ <div id="M000030_source" class="dyn-source">
352
+ <pre>
353
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 446</span>
354
+ 446: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apr_config_needed_for_building_apache_modules?</span>
355
+ 447: <span class="ruby-identifier">filename</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-node">&quot;/tmp/passenger-platform-check-#{Process.pid}.c&quot;</span>)
356
+ 448: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">&quot;w&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
357
+ 449: <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span>(<span class="ruby-value str">&quot;#include &lt;apr.h&gt;&quot;</span>)
358
+ 450: <span class="ruby-keyword kw">end</span>
359
+ 451: <span class="ruby-keyword kw">begin</span>
360
+ 452: <span class="ruby-keyword kw">return</span> <span class="ruby-operator">!</span><span class="ruby-identifier">system</span>(<span class="ruby-node">&quot;(gcc #{apache2_module_cflags(false)} -c '#{filename}' -o '#{filename}.o') &gt;/dev/null 2&gt;/dev/null&quot;</span>)
361
+ 453: <span class="ruby-keyword kw">ensure</span>
362
+ 454: <span class="ruby-constant">File</span>.<span class="ruby-identifier">unlink</span>(<span class="ruby-identifier">filename</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
363
+ 455: <span class="ruby-constant">File</span>.<span class="ruby-identifier">unlink</span>(<span class="ruby-node">&quot;#{filename}.o&quot;</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
364
+ 456: <span class="ruby-keyword kw">end</span>
365
+ 457: <span class="ruby-keyword kw">end</span>
366
+ </pre>
367
+ </div>
368
+ </div>
369
+ </div>
370
+ <div class="method">
371
+ <div class="title">
372
+ <a name="M000026"></a><b>apr_flags</b>()
373
+ </div>
374
+ <div class="description">
375
+ <p>
376
+ The C compiler flags that are necessary for programs that use APR.
377
+ </p>
378
+ </div>
379
+ <div class="sourcecode">
380
+ <p class="source-link">[ <a href="javascript:toggleSource('M000026_source')" id="l_M000026_source">show source</a> ]</p>
381
+ <div id="M000026_source" class="dyn-source">
382
+ <pre>
383
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 418</span>
384
+ 418: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apr_flags</span>
385
+ 419: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">determine_apr_info</span>[<span class="ruby-value">0</span>]
386
+ 420: <span class="ruby-keyword kw">end</span>
387
+ </pre>
388
+ </div>
389
+ </div>
390
+ </div>
391
+ <div class="method">
392
+ <div class="title">
393
+ <a name="M000027"></a><b>apr_libs</b>()
394
+ </div>
395
+ <div class="description">
396
+ <p>
397
+ The linker flags that are necessary for linking programs that use APR.
398
+ </p>
399
+ </div>
400
+ <div class="sourcecode">
401
+ <p class="source-link">[ <a href="javascript:toggleSource('M000027_source')" id="l_M000027_source">show source</a> ]</p>
402
+ <div id="M000027_source" class="dyn-source">
403
+ <pre>
404
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 423</span>
405
+ 423: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apr_libs</span>
406
+ 424: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">determine_apr_info</span>[<span class="ruby-value">1</span>]
407
+ 425: <span class="ruby-keyword kw">end</span>
408
+ </pre>
409
+ </div>
410
+ </div>
411
+ </div>
412
+ <div class="method">
413
+ <div class="title">
414
+ <a name="M000018"></a><b>apu_config</b>()
415
+ </div>
416
+ <div class="description">
417
+ <p>
418
+ The absolute path to the &#8216;apu-config&#8217; or
419
+ &#8216;apu-1-config&#8217; executable.
420
+ </p>
421
+ </div>
422
+ <div class="sourcecode">
423
+ <p class="source-link">[ <a href="javascript:toggleSource('M000018_source')" id="l_M000018_source">show source</a> ]</p>
424
+ <div id="M000018_source" class="dyn-source">
425
+ <pre>
426
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 276</span>
427
+ 276: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apu_config</span>
428
+ 277: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env_defined?</span>(<span class="ruby-value str">'APU_CONFIG'</span>)
429
+ 278: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'APU_CONFIG'</span>]
430
+ 279: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">apxs2</span>.<span class="ruby-identifier">nil?</span>
431
+ 280: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
432
+ 281: <span class="ruby-keyword kw">else</span>
433
+ 282: <span class="ruby-identifier">filename</span> = <span class="ruby-node">`#{apxs2} -q APU_CONFIG 2&gt;/dev/null`</span>.<span class="ruby-identifier">strip</span>
434
+ 283: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">empty?</span>
435
+ 284: <span class="ruby-identifier">apu_bindir</span> = <span class="ruby-node">`#{apxs2} -q APU_BINDIR 2&gt;/dev/null`</span>.<span class="ruby-identifier">strip</span>
436
+ 285: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">apu_bindir</span>.<span class="ruby-identifier">empty?</span>
437
+ 286: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
438
+ 287: <span class="ruby-keyword kw">else</span>
439
+ 288: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">select_executable</span>(<span class="ruby-identifier">apu_bindir</span>,
440
+ 289: <span class="ruby-value str">&quot;apu-1-config&quot;</span>, <span class="ruby-value str">&quot;apu-config&quot;</span>)
441
+ 290: <span class="ruby-keyword kw">end</span>
442
+ 291: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">filename</span>)
443
+ 292: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">filename</span>
444
+ 293: <span class="ruby-keyword kw">else</span>
445
+ 294: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
446
+ 295: <span class="ruby-keyword kw">end</span>
447
+ 296: <span class="ruby-keyword kw">end</span>
448
+ 297: <span class="ruby-keyword kw">end</span>
449
+ </pre>
450
+ </div>
451
+ </div>
452
+ </div>
453
+ <div class="method">
454
+ <div class="title">
455
+ <a name="M000028"></a><b>apu_flags</b>()
456
+ </div>
457
+ <div class="description">
458
+ <p>
459
+ The C compiler flags that are necessary for programs that use APR-Util.
460
+ </p>
461
+ </div>
462
+ <div class="sourcecode">
463
+ <p class="source-link">[ <a href="javascript:toggleSource('M000028_source')" id="l_M000028_source">show source</a> ]</p>
464
+ <div id="M000028_source" class="dyn-source">
465
+ <pre>
466
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 428</span>
467
+ 428: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apu_flags</span>
468
+ 429: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">determine_apu_info</span>[<span class="ruby-value">0</span>]
469
+ 430: <span class="ruby-keyword kw">end</span>
470
+ </pre>
471
+ </div>
472
+ </div>
473
+ </div>
474
+ <div class="method">
475
+ <div class="title">
476
+ <a name="M000029"></a><b>apu_libs</b>()
477
+ </div>
478
+ <div class="description">
479
+ <p>
480
+ The linker flags that are necessary for linking programs that use APR-Util.
481
+ </p>
482
+ </div>
483
+ <div class="sourcecode">
484
+ <p class="source-link">[ <a href="javascript:toggleSource('M000029_source')" id="l_M000029_source">show source</a> ]</p>
485
+ <div id="M000029_source" class="dyn-source">
486
+ <pre>
487
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 433</span>
488
+ 433: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apu_libs</span>
489
+ 434: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">determine_apu_info</span>[<span class="ruby-value">1</span>]
490
+ 435: <span class="ruby-keyword kw">end</span>
491
+ </pre>
492
+ </div>
493
+ </div>
494
+ </div>
495
+ <div class="method">
496
+ <div class="title">
497
+ <a name="M000014"></a><b>apxs2</b>()
498
+ </div>
499
+ <div class="description">
500
+ <p>
501
+ The absolute path to the &#8216;apxs&#8217; or &#8216;<a
502
+ href="PlatformInfo.html#M000014">apxs2</a>&#8217; executable, or nil if not
503
+ found.
504
+ </p>
505
+ </div>
506
+ <div class="sourcecode">
507
+ <p class="source-link">[ <a href="javascript:toggleSource('M000014_source')" id="l_M000014_source">show source</a> ]</p>
508
+ <div id="M000014_source" class="dyn-source">
509
+ <pre>
510
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 212</span>
511
+ 212: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apxs2</span>
512
+ 213: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env_defined?</span>(<span class="ruby-value str">&quot;APXS2&quot;</span>)
513
+ 214: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;APXS2&quot;</span>]
514
+ 215: <span class="ruby-keyword kw">end</span>
515
+ 216: [<span class="ruby-value str">'apxs2'</span>, <span class="ruby-value str">'apxs'</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
516
+ 217: <span class="ruby-identifier">command</span> = <span class="ruby-identifier">find_command</span>(<span class="ruby-identifier">name</span>)
517
+ 218: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">command</span>.<span class="ruby-identifier">nil?</span>
518
+ 219: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">command</span>
519
+ 220: <span class="ruby-keyword kw">end</span>
520
+ 221: <span class="ruby-keyword kw">end</span>
521
+ 222: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
522
+ 223: <span class="ruby-keyword kw">end</span>
523
+ </pre>
524
+ </div>
525
+ </div>
526
+ </div>
527
+ <div class="method">
528
+ <div class="title">
529
+ <a name="M000023"></a><b>debugging_cflags</b>()
530
+ </div>
531
+ <div class="description">
532
+ <p>
533
+ C compiler flags that should be passed in order to enable debugging
534
+ information.
535
+ </p>
536
+ </div>
537
+ <div class="sourcecode">
538
+ <p class="source-link">[ <a href="javascript:toggleSource('M000023_source')" id="l_M000023_source">show source</a> ]</p>
539
+ <div id="M000023_source" class="dyn-source">
540
+ <pre>
541
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 359</span>
542
+ 359: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">debugging_cflags</span>
543
+ 360: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/openbsd/</span>
544
+ 361: <span class="ruby-comment cmt"># According to OpenBSD's pthreads man page, pthreads do not work</span>
545
+ 362: <span class="ruby-comment cmt"># correctly when an app is compiled with -g. It recommends using</span>
546
+ 363: <span class="ruby-comment cmt"># -ggdb instead.</span>
547
+ 364: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'-ggdb'</span>
548
+ 365: <span class="ruby-keyword kw">else</span>
549
+ 366: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'-g'</span>
550
+ 367: <span class="ruby-keyword kw">end</span>
551
+ 368: <span class="ruby-keyword kw">end</span>
552
+ </pre>
553
+ </div>
554
+ </div>
555
+ </div>
265
556
  <div class="method">
266
557
  <div class="title">
267
- <a name="M000007"></a><b>find_command</b>(name)
558
+ <a name="M000011"></a><b>find_command</b>(name)
268
559
  </div>
269
560
  <div class="description">
270
561
  <p>
@@ -277,19 +568,232 @@ always behave correctly, for some weird reason.
277
568
  </p>
278
569
  </div>
279
570
  <div class="sourcecode">
280
- <p class="source-link">[ <a href="javascript:toggleSource('M000007_source')" id="l_M000007_source">show source</a> ]</p>
281
- <div id="M000007_source" class="dyn-source">
571
+ <p class="source-link">[ <a href="javascript:toggleSource('M000011_source')" id="l_M000011_source">show source</a> ]</p>
572
+ <div id="M000011_source" class="dyn-source">
573
+ <pre>
574
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 181</span>
575
+ 181: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">find_command</span>(<span class="ruby-identifier">name</span>)
576
+ 182: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'PATH'</span>].<span class="ruby-identifier">split</span>(<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH_SEPARATOR</span>).<span class="ruby-identifier">detect</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">directory</span><span class="ruby-operator">|</span>
577
+ 183: <span class="ruby-identifier">path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">directory</span>, <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>)
578
+ 184: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">executable?</span>(<span class="ruby-identifier">path</span>)
579
+ 185: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">path</span>
580
+ 186: <span class="ruby-keyword kw">end</span>
581
+ 187: <span class="ruby-keyword kw">end</span>
582
+ 188: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
583
+ 189: <span class="ruby-keyword kw">end</span>
584
+ </pre>
585
+ </div>
586
+ </div>
587
+ </div>
588
+ <div class="method">
589
+ <div class="title">
590
+ <a name="M000016"></a><b>httpd</b>()
591
+ </div>
592
+ <div class="description">
593
+ <p>
594
+ The absolute path to the Apache binary (that is, &#8216;<a
595
+ href="PlatformInfo.html#M000016">httpd</a>&#8217;, &#8216;httpd2&#8217;,
596
+ &#8216;apache&#8217; or &#8216;apache2&#8217;).
597
+ </p>
598
+ </div>
599
+ <div class="sourcecode">
600
+ <p class="source-link">[ <a href="javascript:toggleSource('M000016_source')" id="l_M000016_source">show source</a> ]</p>
601
+ <div id="M000016_source" class="dyn-source">
602
+ <pre>
603
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 233</span>
604
+ 233: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">httpd</span>
605
+ 234: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env_defined?</span>(<span class="ruby-value str">'HTTPD'</span>)
606
+ 235: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'HTTPD'</span>]
607
+ 236: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">apxs2</span>.<span class="ruby-identifier">nil?</span>
608
+ 237: [<span class="ruby-value str">&quot;apache2&quot;</span>, <span class="ruby-value str">&quot;httpd2&quot;</span>, <span class="ruby-value str">&quot;apache&quot;</span>, <span class="ruby-value str">&quot;httpd&quot;</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
609
+ 238: <span class="ruby-identifier">command</span> = <span class="ruby-identifier">find_command</span>(<span class="ruby-identifier">name</span>)
610
+ 239: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">command</span>.<span class="ruby-identifier">nil?</span>
611
+ 240: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">command</span>
612
+ 241: <span class="ruby-keyword kw">end</span>
613
+ 242: <span class="ruby-keyword kw">end</span>
614
+ 243: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
615
+ 244: <span class="ruby-keyword kw">else</span>
616
+ 245: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">find_apache2_executable</span>(<span class="ruby-node">`#{apxs2} -q TARGET`</span>.<span class="ruby-identifier">strip</span>)
617
+ 246: <span class="ruby-keyword kw">end</span>
618
+ 247: <span class="ruby-keyword kw">end</span>
619
+ </pre>
620
+ </div>
621
+ </div>
622
+ </div>
623
+ <div class="method">
624
+ <div class="title">
625
+ <a name="M000031"></a><b>library_extension</b>()
626
+ </div>
627
+ <div class="description">
628
+ <p>
629
+ The current platform&#8216;s shared library extension (&#8216;so&#8217; on
630
+ most Unices).
631
+ </p>
632
+ </div>
633
+ <div class="sourcecode">
634
+ <p class="source-link">[ <a href="javascript:toggleSource('M000031_source')" id="l_M000031_source">show source</a> ]</p>
635
+ <div id="M000031_source" class="dyn-source">
636
+ <pre>
637
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 461</span>
638
+ 461: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">library_extension</span>
639
+ 462: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/darwin/</span>
640
+ 463: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;bundle&quot;</span>
641
+ 464: <span class="ruby-keyword kw">else</span>
642
+ 465: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;so&quot;</span>
643
+ 466: <span class="ruby-keyword kw">end</span>
644
+ 467: <span class="ruby-keyword kw">end</span>
645
+ </pre>
646
+ </div>
647
+ </div>
648
+ </div>
649
+ <div class="method">
650
+ <div class="title">
651
+ <a name="M000032"></a><b>linux_distro</b>()
652
+ </div>
653
+ <div class="description">
654
+ <p>
655
+ An identifier for the current Linux distribution. nil if the operating
656
+ system is not Linux.
657
+ </p>
658
+ </div>
659
+ <div class="sourcecode">
660
+ <p class="source-link">[ <a href="javascript:toggleSource('M000032_source')" id="l_M000032_source">show source</a> ]</p>
661
+ <div id="M000032_source" class="dyn-source">
662
+ <pre>
663
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 470</span>
664
+ 470: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">linux_distro</span>
665
+ 471: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/linux/</span>
666
+ 472: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
667
+ 473: <span class="ruby-keyword kw">end</span>
668
+ 474: <span class="ruby-identifier">lsb_release</span> = <span class="ruby-identifier">read_file</span>(<span class="ruby-value str">&quot;/etc/lsb-release&quot;</span>)
669
+ 475: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">lsb_release</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/Ubuntu/</span>
670
+ 476: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">:ubuntu</span>
671
+ 477: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-value str">&quot;/etc/debian_version&quot;</span>)
672
+ 478: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">:debian</span>
673
+ 479: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-value str">&quot;/etc/redhat-release&quot;</span>)
674
+ 480: <span class="ruby-identifier">redhat_release</span> = <span class="ruby-identifier">read_file</span>(<span class="ruby-value str">&quot;/etc/redhat-release&quot;</span>)
675
+ 481: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">redhat_release</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/CentOS/</span>
676
+ 482: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">:centos</span>
677
+ 483: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">redhat_release</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/Fedora/</span> <span class="ruby-comment cmt"># is this correct?</span>
678
+ 484: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">:fedora</span>
679
+ 485: <span class="ruby-keyword kw">else</span>
680
+ 486: <span class="ruby-comment cmt"># On official RHEL distros, the content is in the form of</span>
681
+ 487: <span class="ruby-comment cmt"># &quot;Red Hat Enterprise Linux Server release 5.1 (Tikanga)&quot;</span>
682
+ 488: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">:rhel</span>
683
+ 489: <span class="ruby-keyword kw">end</span>
684
+ 490: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-value str">&quot;/etc/suse-release&quot;</span>)
685
+ 491: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">:suse</span>
686
+ 492: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-value str">&quot;/etc/gentoo-release&quot;</span>)
687
+ 493: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">:gentoo</span>
688
+ 494: <span class="ruby-keyword kw">else</span>
689
+ 495: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">:unknown</span>
690
+ 496: <span class="ruby-keyword kw">end</span>
691
+ 497: <span class="ruby-comment cmt"># TODO: Slackware, Mandrake/Mandriva</span>
692
+ 498: <span class="ruby-keyword kw">end</span>
693
+ </pre>
694
+ </div>
695
+ </div>
696
+ </div>
697
+ <div class="method">
698
+ <div class="title">
699
+ <a name="M000021"></a><b>portability_cflags</b>()
700
+ </div>
701
+ <div class="description">
702
+ <p>
703
+ Compiler flags that should be used for compiling every C/C++ program, for
704
+ portability reasons. These flags should be specified as last when invoking
705
+ the compiler.
706
+ </p>
707
+ </div>
708
+ <div class="sourcecode">
709
+ <p class="source-link">[ <a href="javascript:toggleSource('M000021_source')" id="l_M000021_source">show source</a> ]</p>
710
+ <div id="M000021_source" class="dyn-source">
711
+ <pre>
712
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 331</span>
713
+ 331: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">portability_cflags</span>
714
+ 332: <span class="ruby-comment cmt"># _GLIBCPP__PTHREADS is for fixing Boost compilation on OpenBSD.</span>
715
+ 333: <span class="ruby-identifier">flags</span> = [<span class="ruby-value str">&quot;-D_REENTRANT -D_GLIBCPP__PTHREADS -I/usr/local/include&quot;</span>]
716
+ 334: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/solaris/</span>
717
+ 335: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-D_XOPEN_SOURCE=500 -D_XPG4_2 -D__EXTENSIONS__ -D__SOLARIS__'</span>
718
+ 336: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-DBOOST_HAS_STDINT_H'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/solaris2.9/</span>
719
+ 337: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-D__SOLARIS9__ -DBOOST__STDC_CONSTANT_MACROS_DEFINED'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/solaris2.9/</span>
720
+ 338: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-mcpu=ultrasparc'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/sparc/</span>
721
+ 339: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/openbsd/</span>
722
+ 340: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-DBOOST_HAS_STDINT_H'</span>
723
+ 341: <span class="ruby-keyword kw">end</span>
724
+ 342: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot; &quot;</span>).<span class="ruby-identifier">strip</span>
725
+ 343: <span class="ruby-keyword kw">end</span>
726
+ </pre>
727
+ </div>
728
+ </div>
729
+ </div>
730
+ <div class="method">
731
+ <div class="title">
732
+ <a name="M000022"></a><b>portability_ldflags</b>()
733
+ </div>
734
+ <div class="description">
735
+ <p>
736
+ Linker flags that should be used for linking every C/C++ program, for
737
+ portability reasons. These flags should be specified as last when invoking
738
+ the linker.
739
+ </p>
740
+ </div>
741
+ <div class="sourcecode">
742
+ <p class="source-link">[ <a href="javascript:toggleSource('M000022_source')" id="l_M000022_source">show source</a> ]</p>
743
+ <div id="M000022_source" class="dyn-source">
744
+ <pre>
745
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 349</span>
746
+ 349: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">portability_ldflags</span>
747
+ 350: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/solaris/</span>
748
+ 351: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'-lxnet -lrt -lsocket -lnsl -lpthread'</span>
749
+ 352: <span class="ruby-keyword kw">else</span>
750
+ 353: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'-lpthread'</span>
751
+ 354: <span class="ruby-keyword kw">end</span>
752
+ 355: <span class="ruby-keyword kw">end</span>
753
+ </pre>
754
+ </div>
755
+ </div>
756
+ </div>
757
+ <div class="method">
758
+ <div class="title">
759
+ <a name="M000012"></a><b>rake</b>()
760
+ </div>
761
+ <div class="description">
762
+ <p>
763
+ Returns the absolute path to the Rake executable that belongs to the
764
+ current Ruby interpreter. Returns nil if it doesn&#8216;t exist.
765
+ </p>
766
+ </div>
767
+ <div class="sourcecode">
768
+ <p class="source-link">[ <a href="javascript:toggleSource('M000012_source')" id="l_M000012_source">show source</a> ]</p>
769
+ <div id="M000012_source" class="dyn-source">
770
+ <pre>
771
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 198</span>
772
+ 198: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">rake</span>
773
+ 199: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">locate_ruby_executable</span>(<span class="ruby-value str">'rake'</span>)
774
+ 200: <span class="ruby-keyword kw">end</span>
775
+ </pre>
776
+ </div>
777
+ </div>
778
+ </div>
779
+ <div class="method">
780
+ <div class="title">
781
+ <a name="M000013"></a><b>rspec</b>()
782
+ </div>
783
+ <div class="description">
784
+ <p>
785
+ Returns the absolute path to the RSpec runner program that belongs to the
786
+ current Ruby interpreter. Returns nil if it doesn&#8216;t exist.
787
+ </p>
788
+ </div>
789
+ <div class="sourcecode">
790
+ <p class="source-link">[ <a href="javascript:toggleSource('M000013_source')" id="l_M000013_source">show source</a> ]</p>
791
+ <div id="M000013_source" class="dyn-source">
282
792
  <pre>
283
- <span class="ruby-comment cmt"># File lib/passenger/platform_info.rb, line 260</span>
284
- 260: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">find_command</span>(<span class="ruby-identifier">name</span>)
285
- 261: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'PATH'</span>].<span class="ruby-identifier">split</span>(<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH_SEPARATOR</span>).<span class="ruby-identifier">detect</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">directory</span><span class="ruby-operator">|</span>
286
- 262: <span class="ruby-identifier">path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">directory</span>, <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>)
287
- 263: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">executable?</span>(<span class="ruby-identifier">path</span>)
288
- 264: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">path</span>
289
- 265: <span class="ruby-keyword kw">end</span>
290
- 266: <span class="ruby-keyword kw">end</span>
291
- 267: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
292
- 268: <span class="ruby-keyword kw">end</span>
793
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 206</span>
794
+ 206: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">rspec</span>
795
+ 207: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">locate_ruby_executable</span>(<span class="ruby-value str">'spec'</span>)
796
+ 208: <span class="ruby-keyword kw">end</span>
293
797
  </pre>
294
798
  </div>
295
799
  </div>