Skip to content

Commit 5f80860

Browse files
committed
Added information about the system config system to the coding notes file.
1 parent f99b37f commit 5f80860

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

CODING_NOTES.php.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,34 @@ public function do_something($x, $y, $foo){
9292
... do something interesting
9393
}
9494

95+
//*****************************************************************************
96+
// Where to store custom settings
97+
//*****************************************************************************
98+
99+
-- Interface settings
100+
101+
The recommended place to store global interface settings is the ini style global config system
102+
(see system.ini.master file in install/tpl/ to set defaults). The settings file
103+
gets stored inside the ispconfig database. Settings can be accessed with the function:
104+
105+
$app->uses('ini_parser,getconf');
106+
$interface_settings = $app->getconf->get_global_config('modulename');
107+
108+
where modulename corresponds to the config section in the system.ini.master file.
109+
To make the settings editable under System > interface config, add the new configuration
110+
fields to the file interface/web/admin/form/system_config.tform.php and the corresponding
111+
tempalte file in the templates subfolder of the admin module.
112+
113+
-- Server settings
114+
115+
Server settings are stored in the ini style server config system (see server.ini.master template file)
116+
The settings file gets stored inside the ispconfig database in the server table. Settings can be
117+
accessed with the function $app->getconf->get_server_config(....)
118+
119+
Example to access the web configuration:
120+
121+
$app->uses('ini_parser,getconf');
122+
$web_config = $app->getconf->get_server_config($server_id,'web');
123+
95124

96125

0 commit comments

Comments
 (0)