Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 43
- Log:
Use of PATH_PREFIX to make the configuration more easy to relocate.
Prompted by Ticket #33, where Radiant URLs were being served relative
to the document root; this is fixed in app/models/behavior.rb though
it is not a very clean solution.
- Author:
- adh
- Date:
- Tue Aug 01 12:23:10 +0100 2006
- Size:
- 3280 Bytes
1 | # Be sure to restart your web server when you modify this file. |
2 | |
3 | # Rails Gem Version |
4 | RAILS_GEM_VERSION = '1.1.2' |
5 | |
6 | # Uncomment below to force Rails into production mode when |
7 | # you don't control web/app server and can't set it the proper way |
8 | # ENV['RAILS_ENV'] ||= 'production' |
9 | |
10 | # Bootstrap the Rails environment, frameworks, and default configuration |
11 | require File.join(File.dirname(__FILE__), 'boot') |
12 | |
13 | # Location of application relative to document root in terms of |
14 | # URLs (i.e. according to the web server configuration, not the |
15 | # filesystem location). |
16 | |
17 | PATH_PREFIX = '/rails/radiant' |
18 | |
19 | require 'radius' |
20 | |
21 | Rails::Initializer.run do |config| |
22 | # We don't run in the document root, so images etc. must come from |
23 | # a non-root location too. Hijack the 'asset host' facility to get |
24 | # helper-based links pointing in the right place. |
25 | config.action_controller.asset_host = PATH_PREFIX |
26 | |
27 | # Settings in config/environments/* take precedence those specified here |
28 | |
29 | # Skip frameworks you're not going to use |
30 | config.frameworks -= [ :action_web_service, :action_mailer ] |
31 | |
32 | # Add additional load paths for when Radiant is running in instance mode |
33 | config.load_paths += %w( |
34 | app/controllers |
35 | app/models |
36 | app/helpers |
37 | app/behaviors |
38 | app/filters |
39 | lib |
40 | ).map { |path| File.join(RADIANT_ROOT, path) } |
41 | config.controller_paths << File.join(RADIANT_ROOT, 'app', 'controllers') |
42 | config.view_path = File.join(RADIANT_ROOT, 'app', 'views') |
43 | |
44 | # Force all environments to use the same logger level |
45 | # (by default production uses :info, the others :debug) |
46 | config.log_level = :warn |
47 | |
48 | # Use the database for sessions instead of the file system |
49 | # (create the session table with 'rake create_sessions_table') |
50 | # config.action_controller.session_store = :active_record_store |
51 | |
52 | # Enable page/fragment caching by setting a file-based store |
53 | # (remember to create the caching directory and make it readable to the application) |
54 | # config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/fragment_cache" |
55 | config.action_controller.page_cache_directory = "#{RAILS_ROOT}/cache" |
56 | |
57 | # Make Active Record use UTC-base instead of local time |
58 | config.active_record.default_timezone = :utc |
59 | |
60 | # Make sure plugins are loaded from lib and vendor |
61 | config.plugin_paths = ["#{RAILS_ROOT}/vendor/plugins", "#{RADIANT_ROOT}/lib/plugins", |
62 | "#{RADIANT_ROOT}/vendor/plugins"] |
63 | |
64 | # See Rails::Configuration for more options |
65 | end |
66 | |
67 | # Allow multiple Rails applications by giving the session cookie a |
68 | # unique prefix. |
69 | |
70 | ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:session_key] = 'radiantapp_session_id' |
71 | |
72 | # Add new inflection rules using the following format: |
73 | Inflector.inflections do |inflect| |
74 | inflect.uncountable 'config' |
75 | end |
76 | |
77 | # Auto-require text filters |
78 | Dir["#{RADIANT_ROOT}/app/filters/*_filter.rb"].each do |filter| |
79 | require_dependency filter |
80 | end |
81 | |
82 | # Auto-require behaviors |
83 | Dir["#{RADIANT_ROOT}/app/behaviors/*_behavior.rb"].each do |behavior| |
84 | require_dependency behavior |
85 | end |
86 | |
87 | # Response Caching Defaults |
88 | ResponseCache.defaults[:directory] = ActionController::Base.page_cache_directory |
89 | ResponseCache.defaults[:logger] = ActionController::Base.logger |
90 | |
91 | # Activate observers that should always be running |
92 | ActiveRecord::Base.observers = :user_action_observer |