[Ilugc] How do your read/write/store you app specific configurations ?

  • From: kode@xxxxxxxxxxxxxx (Bhasker Kode)
  • Date: Sat Sep 29 01:05:03 2007

 Greetings,

I'm writing a app that relies considerebly on C, cron jobs, and PHP.
I'm doing the logic/processing on the server in C, and the interface
/website to users is in PHP .

I need to maintain some CUSTOM properties that will be my app
configuration or meta data . I have an option to read/write these
properties in either c/shell or PHP. Hence the queries cited below in
[2 chunks] of thought...

[1] how can i set my own custom env variable ( available via php or
the shell ) ?

-SO rather than relying on storing in a flat file or in a sql table. i
was wondering how reliable/practical is to read/write these metadata
in a environmental variable.

on the PHP side can i add my own variables to PHP's $_SERVER and then
use getenv("property") or ini_set

on the os level, i'd want something like the $PATH variable. can't i
have my own customPATH or customBlah variables. i hear that
environment variables depend on their parent process ,and the reason
$PATH is accessable is because it's in the startup process.

then i read that u could try .rc files . it seems through .rc i can
execute scripts, but only on startup. but i want to be able to
read/write/store without depending on a startup. ( eg i found that use
.rc : gtk's rc files
http://www.pygtk.org/pygtk2tutorial/sec-ExampleRcFile.html , as well
as one at http://wiki.tcl.tk/13565) .

I'm still hoping that i don't have to rely on accessing some db or a flat file .
Is 'nt there a simple way to read/write/store custom env variables :
(a) without flat files , without sql , perhaps editing some magic lin
on apache's conf or php's ini (b) and that are persistent across
process's without depending on being called at startup

[2] so if not env variables , how do you usually manage your app
specific meta data/ configuration that can be accessable via the
shell/ php across process's ?

Keep Clicking,
Bhasker V Kode

Other related posts: