0
@@ -136,6 +136,7 @@ module Rails
0
@@ -264,6 +265,19 @@ module Rails
0
+ # Preload all frameworks specified by the Configuration#frameworks.
0
+ # Used by Passenger to ensure everything's loaded before forking and
0
+ # to avoid autoload race conditions in JRuby.
0
+ def preload_frameworks
0
+ if configuration.preload_frameworks
0
+ configuration.frameworks.each do |framework|
0
+ # String#classify and #constantize aren't available yet.
0
+ toplevel = Object.const_get(framework.to_s.gsub(/(?:^|_)(.)/) { $1.upcase })
0
# Add the load paths used by support functions such as the info controller
0
def add_support_load_paths
0
@@ -602,6 +616,9 @@ Run `rake gems:install` to install the missing gems.
0
# A stub for setting options on ActiveSupport.
0
attr_accessor :active_support
0
+ # Whether to preload all frameworks at startup.
0
+ attr_accessor :preload_frameworks
0
# Whether or not classes should be cached (set to false if you want
0
# application classes to be reloaded on each request)
0
attr_accessor :cache_classes
0
@@ -768,6 +785,7 @@ Run `rake gems:install` to install the missing gems.
0
self.log_level = default_log_level
0
self.view_path = default_view_path
0
self.controller_paths = default_controller_paths
0
+ self.preload_frameworks = default_preload_frameworks
0
self.cache_classes = default_cache_classes
0
self.dependency_loading = default_dependency_loading
0
self.whiny_nils = default_whiny_nils
0
@@ -810,6 +828,7 @@ Run `rake gems:install` to install the missing gems.
0
# multiple database connections. Also disables automatic dependency loading
0
+ self.preload_frameworks = true
0
self.cache_classes = true
0
self.dependency_loading = false
0
self.action_controller.allow_concurrency = true
0
@@ -955,6 +974,10 @@ Run `rake gems:install` to install the missing gems.
0
+ def default_preload_frameworks
0
def default_cache_classes