[Rt-devel] RT Extension settings "storage"

Jerrad Pierce jpierce at cambridgeenergyalliance.org
Thu Mar 26 16:24:10 EDT 2009


> Do extension/plugin writers have a standard place to put settings or
> configuration options? I'm building a small module and I'd like to
> provide the ability to apply it only to certain queues. At present, I
> have an array in RT_SiteConfig.pm for this configuration option, but
> this is kind of a pain. I'd like to add a tab to the "Preferences"
> section instead, but I'm not sure where to store the results.
>
> Is there a standard way to do this (like creating a new table in the
> DB, for example)?
> Alternatively, is there any specific storage method to avoid?

Extensions can also have their own configuration files in
  plugins/RTx-Foo/etc/Foo_Config.pm
  plugins/RTx-Foo/etc/Foo_SiteConfig.pm

They obviously get loaded later, which can be a benefit and a curse.

I do not recommend using RT config's hash data type.
Setting variables of this type clobbers existing hashes, rather than
setting the specific keys in an existing hash (would make it more
useful for customization of defaults).
-- 
Cambridge Energy Alliance: Save money. Save the planet.


More information about the Rt-devel mailing list