6.0.0-git
2021-01-18

[#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 2008-04-25 (4651 days ago)
Due
Updated 2008-05-20 (4626 days ago)
Assigned 2008-05-02 (4644 days ago)
Resolved 2008-05-02 (4644 days ago)
Milestone
Patch Yes

History
2008-05-20 11:21:02 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


2008-05-16 20:46:28 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)
2008-05-02 18:27:52 Chuck Hagenbuch Comment #7
Assigned to Chuck Hagenbuch
Taken from Horde DevelopersHorde Developers
State ⇒ Resolved
Reply to this comment
committed, thanks!
2008-05-02 17:26:55 Jan Schneider Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
Patch ⇒ Yes
 
2008-05-02 17:26:40 Jan Schneider Deleted Original Message
 
2008-05-02 10:11:34 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!


2008-04-29 18:33:17 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!
2008-04-29 08:07:10 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...


2008-04-26 19:42:04 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.
2008-04-25 09:47:20 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


2008-04-25 09:46:48 thomas (dot) jarosch (at) intra2net (dot) com Comment #1
Type ⇒ Enhancement
State ⇒ New
Priority ⇒ 1. Low
Summary ⇒ File based preference driver
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
New Attachment: framework-Prefs-file.php
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