public function __construct($server_cfg) { $cfg = get_eu_cfg($server_cfg['eu_conf_file']); $db_server = $cfg["db_host"]; $db_user = $cfg["db_user"]; $db_pass = $cfg["db_pass"]; $db_name = $cfg["db_name"]; $this->table = $cfg["table"]; $this->server_cfg = $server_cfg; $this->instance_counts = array(); parent::__construct($db_server, $db_user, $db_pass, $db_name); }
include_once 'game_config.php'; include_once 'XhProfDAO.php'; function get_options() { $options = array(); $params = getopt("g:t:p:j:"); if (isset($params['g'])) { return $params['g']; } } $game = get_options(); if (!file_exists($per_game_config_path . $game . ".cfg")) { exit(0); } $game_cfg = load_game_config($game); $user = $game_cfg['db_user']; $pass = $game_cfg['db_pass']; $host = $game_cfg['db_host']; $db = 'rightscale'; $deploy_id = $game_cfg['deployIDs'][0]; $XhProfDAO = new XhProfDAO($host, $user, $pass, $db); $XhProfDAO->connect(); $array_id = $XhProfDAO->prepare_and_query('select distinct array_id from instances where deploy_id =' . $deploy_id . ';'); $ids = array(); foreach ($array_id as $id) { array_push($ids, $id['array_id']); } foreach ($ids as $id) { echo $id . "\n"; } $XhProfDAO->disconnect();