| | |
| | | <?php |
| | | /** |
| | | * getconf class |
| | | * |
| | | * @author Till Brehm |
| | | * @copyright 2005, Till Brehm, projektfarm Gmbh |
| | | * @version 0.1 |
| | | * @package ISPConfig |
| | | */ |
| | | |
| | | /* |
| | | Copyright (c) 2006, Till Brehm, projektfarm Gmbh |
| | | Copyright (c) 2007, Till Brehm, projektfarm Gmbh |
| | | All rights reserved. |
| | | |
| | | Redistribution and use in source and binary forms, with or without modification, |
| | |
| | | class getconf { |
| | | |
| | | private $config; |
| | | |
| | | |
| | | public function get_server_config($server_id, $section = '') { |
| | | global $app; |
| | | |
| | | if(!is_array($this->config[$server_id])) { |
| | | |
| | | if(!isset($this->config[$server_id])) { |
| | | $app->uses('ini_parser'); |
| | | $server_id = intval($server_id); |
| | | $server = $app->db->queryOneRecord("SELECT config FROM server WHERE server_id = $server_id"); |
| | | $this->config[$server_id] = $app->ini_parser->parse_ini_string(stripslashes($server["config"])); |
| | | $server_id = $app->functions->intval($server_id); |
| | | $server = $app->db->queryOneRecord('SELECT config FROM server WHERE server_id = '.$server_id); |
| | | $this->config[$server_id] = $app->ini_parser->parse_ini_string(stripslashes($server['config'])); |
| | | } |
| | | return ($section == '') ? $this->config[$server_id] : $this->config[$server_id][$section]; |
| | | } |
| | | |
| | | public function get_global_config() { |
| | | |
| | | die("not yet implemented"); |
| | | |
| | | public function get_global_config($section = '') { |
| | | global $app; |
| | | |
| | | if(!isset($this->config['global'])) { |
| | | $app->uses('ini_parser'); |
| | | $tmp = $app->db->queryOneRecord('SELECT config FROM sys_ini WHERE sysini_id = 1'); |
| | | $this->config['global'] = $app->ini_parser->parse_ini_string(stripslashes($tmp['config'])); |
| | | } |
| | | return ($section == '') ? $this->config['global'] : $this->config['global'][$section]; |
| | | } |
| | | |
| | | } |
| | | |
| | | ?> |
| | | ?> |