Class: Merb::BootLoader::SetupSession
- Inherits:
-
Merb::BootLoader
- Object
- Merb::BootLoader
- Merb::BootLoader::SetupSession
- Defined in:
- lib/merb-core/bootloader.rb
Class Method Summary collapse
-
.run ⇒ Object
Enable the configured session container(s); any class that inherits from SessionContainer will be considered by its session_store_type attribute.
Methods inherited from Merb::BootLoader
after, after_app_loads, before, before_app_loads, before_master_shutdown, before_worker_shutdown, default_framework, finished?, inherited, move_klass
Class Method Details
.run ⇒ Object
Enable the configured session container(s); any class that inherits from SessionContainer will be considered by its session_store_type attribute.
Returns
nil
:api: plugin
1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 |
# File 'lib/merb-core/bootloader.rb', line 1189 def self.run # Require all standard session containers. Dir[Merb.framework_root / "merb-core" / "dispatch" / "session" / "*.rb"].each do |file| base_name = File.basename(file, ".rb") require file unless base_name == "container" || base_name == "store_container" end # Set some defaults. Merb::Config[:session_id_key] ||= "_session_id" # List of all session_stores from :session_stores and :session_store config options. config_stores = Merb::Config.session_stores # Register all configured session stores - any loaded session container class # (subclassed from Merb::SessionContainer) will be available for registration. Merb::SessionContainer.subclasses.each do |class_name| if(store = Object.full_const_get(class_name)) && config_stores.include?(store.session_store_type) Merb::Request.register_session_type(store.session_store_type, class_name) end end # Mixin the Merb::Session module to add app-level functionality to sessions overrides = (Merb::Session.instance_methods & Merb::SessionContainer.instance_methods) overrides.each do |m| Merb.logger.warn!("Warning: Merb::Session##{m} overrides existing " \ "Merb::SessionContainer##{m}") end Merb::SessionContainer.send(:include, Merb::Session) nil end |