[#6653] File based preference driver
Summary File based preference driver
Queue Horde Framework Packages
Queue Version HEAD
Type Enhancement
State Resolved
Priority 1. Low
Owners Chuck Hagenbuch <chuck (at) horde (dot) org>
Requester thomas (dot) jarosch (at) intra2net (dot) com
Created 04/25/2008 (135 days ago)
Due
Updated 05/20/2008 (110 days ago)
Assigned 05/02/2008 (128 days ago)
Resolved 05/02/2008 (128 days ago)
Attachments horde-Prefs-add-file.patch Download
framework-Prefs-file-v2.php Download
Milestone
Patch Yes

History
05/20/2008 Thomas Jarosch Comment #9 Reply to this comment
Hello Scott,
in the config: "Directory to store the preferences in."

It's not quite clear where this points when this path is relative. I
can put in an absolute path, but I'd like to keep the preference
system inside of the horde installation for portability.
A relative directory is a bit painful as it's not intuitive to what it 
relates to.
The best solution would be to relative to the horde base, but this 
imposes security problems anyway if you don't protect the directory 
with a .htaccess file from outside access. It's not easy to fix as 
horde will not provide an empty file-based  prefs directory by default.

Maybe it's best to prevent relative paths at all to protect users from 
accidentally exposing sensitive preference data? Though this would be 
quite the opposite to what you've asked for... :o)

Thomas

05/16/2008 scottat (at) cofc (dot) edu Comment #8 Reply to this comment
Thank you very much for adding this feature.  Another great use for 
this backend is when your administration discourages databases.

in the config: "Directory to store the preferences in."

It's not quite clear where this points when this path is relative. I 
can put in an absolute path, but I'd like to keep the preference 
system inside of the horde installation for portability.

(I'm not sure if this should be filed separately)
05/02/2008 Chuck Hagenbuch Comment #7
State ⇒ Resolved
Taken from Horde DevelopersHorde Developers
Assigned to Chuck Hagenbuch
Reply to this comment
committed, thanks!
05/02/2008 Jan Schneider Patch ⇒ 1
State ⇒ Assigned
Assigned to Horde DevelopersHorde Developers
 
05/02/2008 Jan Schneider Deleted Attachment: framework-Prefs-file.php
 
05/02/2008 thomas (dot) jarosch (at) intra2net (dot) com Comment #6
New Attachment: framework-Prefs-file-v2.php Download
Reply to this comment
Okay, convinced. Please do fix the /var/horde/prefs bit. You should
look at how the SQL prefs driver acts if it can't connect to the db,
and do the same thing. Thanks!
Here you go!

04/29/2008 Chuck Hagenbuch Comment #5 Reply to this comment
Okay, convinced. Please do fix the /var/horde/prefs bit. You should 
look at how the SQL prefs driver acts if it can't connect to the db, 
and do the same thing. Thanks!
04/29/2008 thomas (dot) jarosch (at) intra2net (dot) com Comment #4 Reply to this comment
Here are some advantages compared to sqlite:

- Loose coupling if you integrate it with another system:
   Easy delete/rename/restore/backup of user preferences
   as prefs are stored as /some/where/##USERNAME##.prefs.
- Scalability: Using sqlite, two or more processes cannot write
   to the same database at the same time. You either busy wait
   or get a timeout in the worst case. No worries with the file based prefs.
- Speed should be equal or faster, but preference data is usually
   very small, so that shouldn't be taken into account.
- We had two cases of corrupted sqlite databases in the past.
- No external dependencies

The /var/horde/prefs thing was just a default value to output an
error message in the log. I'll change that to PEAR_Error if you want.
Though I don't know how the preference subsystem likes me if I do this...

04/26/2008 Chuck Hagenbuch Comment #3
State ⇒ Feedback
Reply to this comment
What's the use case for this? I.e., when is this better than using sqlite?

On the code, I haven't looked too closely yet, but /var/horde/prefs 
isn't likely to be a useful default on most systems - you should 
either default to /tmp, or throw a fatal error if the directory isn't 
set.
04/25/2008 thomas (dot) jarosch (at) intra2net (dot) com Comment #2
New Attachment: horde-Prefs-add-file.patch Download
Reply to this comment
Patch for horde/config/conf.xml

04/25/2008 thomas (dot) jarosch (at) intra2net (dot) com Comment #1
New Attachment: framework-Prefs-file.php
Patch ⇒
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ File based preference driver
Type ⇒ Enhancement
Priority ⇒ 1. Low
State ⇒ New
Reply to this comment
Hello,

I've implemented a file based preference driver. Attached is the complete file
and a patch for horde/config/conf.xml. Feedback welcome.

Thomas