|
30 | 30 |
|
31 | 31 | class getconf { |
32 | 32 |
|
33 | | - var $config; |
34 | | - |
35 | 33 | function get_server_config($server_id, $section = '') { |
36 | 34 | global $app; |
37 | 35 |
|
38 | | - if(!is_array($this->config[$server_id])) { |
39 | | - $app->uses('ini_parser'); |
40 | | - $server_id = intval($server_id); |
41 | | - $server = $app->db->queryOneRecord('SELECT config FROM server WHERE server_id = ?', $server_id); |
42 | | - $this->config[$server_id] = $app->ini_parser->parse_ini_string(stripslashes($server['config'])); |
43 | | - } |
| 36 | + $app->uses('ini_parser'); |
| 37 | + $server_id = intval($server_id); |
| 38 | + $server = $app->db->queryOneRecord('SELECT config FROM server WHERE server_id = ?', $server_id); |
| 39 | + $config = $app->ini_parser->parse_ini_string(stripslashes($server['config'])); |
44 | 40 |
|
45 | 41 | if($section == '') { |
46 | | - return $this->config[$server_id]; |
| 42 | + return $config; |
47 | 43 | } else { |
48 | | - return $this->config[$server_id][$section]; |
| 44 | + return $config[$section]; |
49 | 45 | } |
50 | 46 | } |
51 | 47 |
|
52 | 48 | public function get_global_config($section = '') { |
53 | 49 | global $app; |
54 | 50 |
|
55 | | - if(!@is_array($this->config['global'])) { |
56 | | - $app->uses('ini_parser'); |
57 | | - $tmp = $app->db->queryOneRecord('SELECT config FROM sys_ini WHERE sysini_id = 1'); |
58 | | - $this->config['global'] = $app->ini_parser->parse_ini_string(stripslashes($tmp['config'])); |
59 | | - } |
60 | | - return ($section == '') ? $this->config['global'] : $this->config['global'][$section]; |
| 51 | + $app->uses('ini_parser'); |
| 52 | + $tmp = $app->db->queryOneRecord('SELECT config FROM sys_ini WHERE sysini_id = 1'); |
| 53 | + $config = $app->ini_parser->parse_ini_string(stripslashes($tmp['config'])); |
| 54 | + return ($section == '') ? $config : $config[$section]; |
61 | 55 | } |
62 | 56 |
|
63 | 57 | public function get_security_config($section = '') { |
|
0 commit comments