6.0.0-beta1
7/5/25

[#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 (at) horde (dot) org
Requester thomas.jarosch (at) intra2net (dot) com
Created 04/25/2008 (6280 days ago)
Due
Updated 05/20/2008 (6255 days ago)
Assigned 05/02/2008 (6273 days ago)
Resolved 05/02/2008 (6273 days ago)
Milestone
Patch Yes

History
05/20/2008 11:21:02 AM 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 08:46:28 PM 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 06:27:52 PM Chuck Hagenbuch Comment #7
Assigned to Chuck Hagenbuch
Taken from Horde DevelopersHorde Developers
State ⇒ Resolved
Reply to this comment
committed, thanks!
05/02/2008 05:26:55 PM Jan Schneider Patch ⇒ Yes
State ⇒ Assigned
Assigned to Horde DevelopersHorde Developers
 
05/02/2008 05:26:40 PM Jan Schneider Deleted Original Message
 
05/02/2008 10:11:34 AM 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 06:33:17 PM 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 08:07:10 AM 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 07:42:04 PM 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 09:47:20 AM 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 09:46:48 AM thomas (dot) jarosch (at) intra2net (dot) com Comment #1
New Attachment: framework-Prefs-file.php
State ⇒ New
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ File based preference driver
Type ⇒ Enhancement
Priority ⇒ 1. Low
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


Saved Queries