One of the problems with OpenInteract is that the configuration gets
reset every time you upgrade a package. So if you've set your user
objects to use SPOPS::DBI::Pg instead of the pre-configured
SPOPS::DBI::MySQL, you need to run:
$ oi_manage change_spops_driver --driver=SPOPS::DBI::Pg
This is fragile and probably the source of some frustration. (Even I
forget to do this, and I wrote the thing!) So instead, why don't we have
a single place where we can modify or rewrite configuration information
before it gets set in the server?
I'd imagine this would live in:
$WEBSITE_DIR/confglobal_override_spops.ini
('m trying to move to INI-style files for just about everything now
since they're much easier to edit and understand.) Such a file might
look something like:
----------
[Global]
override_type = spops
# Replace 'SPOPS::DBI::MySQL with 'SPOPS::DBI::Pg' in the
# 'user.isa' list
[user.isa]
action = replace
replace = SPOPS::DBI::MySQL
value = SPOPS::DBI::Pg
# Set the value of 'user.track.create' to 1
[user.track.create]
action = replace
value = 1
# Add a new value to 'user.track'
[user.track.finalize]
action = add
value = 1
# Add two new entries to the ruleset for the 'news' object
[news.rules_from]
action = add
value = OpenInteract::RSSArticleSummarize
value = OpenInteract::EditorApproval
# Remove 'SPOPS::Secure' from 'page.isa' list
[page.isa]
action = remove
value = SPOPS::Secure
# Remove key and value for 'uid' from 'user.field_map' hash
[user.field_map]
action = remove
value = uid
----------
There are three actions you can take: 'replace', 'add' and 'remove'. The
code should be smart enough to tell what you're acting on and perform
the appropriate action -- for instance, a 'remove' performed on a list
will remove that entry from the list, but a 'remove' performed on a hash
will delete the hash key entirely.
I also had an idea for something like:
----------
# Replace 'SPOPS::DBI::MySQL with 'SPOPS::DBI::Pg' in all keys that
# have an 'isa' entry
[*.isa]
action = replace
replace = SPOPS::DBI::MySQL
value = SPOPS::DBI::Pg
----------
But I want to get the initial part done and working first.
Does this sound reasonable? Do you have any feature or implementation
ideas?
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|