diff --git a/app/models/wiki.rb b/app/models/wiki.rb index bd202ce2..e5a21d9e 100644 --- a/app/models/wiki.rb +++ b/app/models/wiki.rb @@ -1,8 +1,7 @@ -class Wiki +class Wiki cattr_accessor :storage_path, :logger self.storage_path = "#{RAILS_ROOT}/storage/" - self.logger = INSTIKI_LOGGER def authenticate(password) password == (system.password || 'instiki') @@ -38,14 +37,14 @@ class Wiki end def read_page(web_address, page_name) - self.class.logger.debug "Reading page '#{page_name}' from web '#{web_address}'" + ApplicationController.logger.debug "Reading page '#{page_name}' from web '#{web_address}'" web = Web.find_by_address(web_address) if web.nil? - self.class.logger.debug "Web '#{web_address}' not found" + ApplicationController.logger.debug "Web '#{web_address}' not found" return nil else page = web.pages.find(:first, :conditions => ['name = ?', page_name]) - self.class.logger.debug "Page '#{page_name}' #{page.nil? ? 'not' : ''} found" + ApplicationController.logger.debug "Page '#{page_name}' #{page.nil? ? 'not' : ''} found" return page end end diff --git a/config/environments/production.rb b/config/environments/production.rb index 6291d2f8..26769bc5 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -6,18 +6,15 @@ config.cache_classes = true # config.logger = SyslogLogger.new #### -# This one rotates the log file, keeping 25 files, of 1MB each. +# This rotates the log file, keeping 25 files, of 1MB each. -INSTIKI_LOGGER = Logger.new("#{RAILS_ROOT}/log/#{RAILS_ENV}.log", 25, 1024000) +config.action_controller.logger = Logger.new("#{RAILS_ROOT}/log/#{RAILS_ENV}.log", 25, 1024000) # Unfortunately, the above does not work well under Mongrel, as the default Ruby logger class # does no locking and you will have several processes running, each wanting to write to (and # rotate) the log file. One solution is to have each mongrel instance writes to a different log file: # http://blog.caboo.se/articles/2006/11/14/configure-mongrel-rails-logger-per-port for a solution. -# Another is to use the default logging behaviour: - -#INSTIKI_LOGGER = RAILS_DEFAULT_LOGGER - +# Another is to use the default logging behaviour (comment out the above line) # and use an external program (e.g. logrotate) to rotate the logs. #### diff --git a/vendor/rails/actionpack/lib/action_controller/cgi_ext/session_performance_fix.rb b/vendor/rails/actionpack/lib/action_controller/cgi_ext/session_performance_fix.rb new file mode 100644 index 00000000..73051678 --- /dev/null +++ b/vendor/rails/actionpack/lib/action_controller/cgi_ext/session_performance_fix.rb @@ -0,0 +1,30 @@ +# CGI::Session#create_new_id requires 'digest/md5' on every call. This makes +# sense when spawning processes per request, but is unnecessarily expensive +# when serving requests from a long-lived process. +# +# http://railsexpress.de/blog/articles/2005/11/22/speeding-up-the-creation-of-new-sessions +require 'cgi/session' +require 'digest/md5' + +class CGI + class Session #:nodoc: + private + # Create a new session id. + # + # The session id is an MD5 hash based upon the time, + # a random number, and a constant string. This routine + # is used internally for automatically generated + # session ids. + def create_new_id + md5 = Digest::MD5::new + now = Time::now + md5.update(now.to_s) + md5.update(String(now.usec)) + md5.update(String(rand(0))) + md5.update(String($$)) + md5.update('foobar') + @new_session = true + md5.hexdigest + end + end +end diff --git a/vendor/rails/activerecord/test/fixtures/mixed_case_monkey.rb b/vendor/rails/activerecord/test/fixtures/mixed_case_monkey.rb new file mode 100644 index 00000000..853f2682 --- /dev/null +++ b/vendor/rails/activerecord/test/fixtures/mixed_case_monkey.rb @@ -0,0 +1,3 @@ +class MixedCaseMonkey < ActiveRecord::Base + set_primary_key 'monkeyID' +end diff --git a/vendor/rails/activerecord/test/fixtures/mixed_case_monkeys.yml b/vendor/rails/activerecord/test/fixtures/mixed_case_monkeys.yml new file mode 100644 index 00000000..eecd448f --- /dev/null +++ b/vendor/rails/activerecord/test/fixtures/mixed_case_monkeys.yml @@ -0,0 +1,6 @@ +first: + monkeyID: 1 + fleaCount: 42 +second: + monkeyID: 2 + fleaCount: 43