Hi 

I'd like to add some site-wide configuration to the mediawiki_filter
extension, however, the cache mechanism is not too happy about it. Here's
what happens:

In environment.rb I add the following:
MediawikiFilter::config[:images_directory] = '/assets/images'

This should overwrite the defaults in the mediawiki_filter.rb which looks as
follows (stripped down testing code):

class MediawikiFilter < TextFilter

  @@config = {
    :images_directory => 'default'
  }
  cattr_accessor :config

  def filter(text)
    @@config.inspect
  end

end

I clear the cache and restart the server - and voilĂ , the output is just
right:

{ :images_directory => '/assets/images' }

But once I clear the cache in the backend, the output changes to the default
value:

{ :images_directory => 'default' }

Is this a bug or a feature? Or is there a better pattern to implement such
configurations? (I've been thinking about a config part, but it doesn't seem
right for such general extension settings.

Thanks...    -sven
-- 
View this message in context: 
http://www.nabble.com/Caches-and-environment---or%3A-how-to-add-extension-configuration--tp16277151p16277151.html
Sent from the Radiant - User (New) mailing list archive at Nabble.com.

_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to