shm config variables?
| From: | Steve | Date: | Thu, 30 May 2002 01:53:25 +0000 |
| Subject: | shm config variables? | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-106@lists.php.net to get a copy of this message | ||
I have altered the way I use the config file type of idiom. I have a
database table that has the following column
id var val description scope
The scopes I'm using are template, script, both.
I then have a class that loads the variable with template or both into a
shared memory segment. Then, these variables are all assigned to the
template. This makes them available to every template.
The ones with script (and both) scope are treated similarly and loaded into
a $_SCRIPT[] associative array.
Why do I do this? It allows me to have a simple admin page that controls
each of these values. They are stored in the database (I have no interest
in maintaining a file), yet the database is only queried on server reboot or
on change to the values.
Is anyone interested in this? I'm not sure if it qualifies as a plugin
perse. But I find it very useful because I dont have the expense of the db
queries, yet get the convenience of the values being stored in the db.
Steve