Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Is there a way to read configuration from different source?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Thu Jul 30, 2015 9:51 am    Post subject: Is there a way to read configuration from different source? Reply with quote

I'm not exactly clear after reading the documentation.
Can I set a handler to read config vars from database table, f.e.?
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Thu Jul 30, 2015 2:07 pm    Post subject: Reply with quote

Config files are text which is parsed and compiled like a template source. It can be loaded from other resources same way like templates.

It might be possible to create a custom resource which for example reads a mysql table where each row is assigned to a config variable.

The major challenge would be how a cached template could detect modifications of template var and rebuild the cache.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Thu Jul 30, 2015 10:49 pm    Post subject: Reply with quote

Cached template shouldn't detect anything Smile The point of caching.

Anyway, thanks for assurance. My idea is to write response handler with Smarty as its body content producer, and use Smarty config functionality to set up site variables.
I'll be fine with files for a while, but eventually I'd like to move to more accessible storage.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP