unset($_SERVER['argv'][$pos]); $partype = "sources"; if ($pos + 1 < $params && substr($_SERVER['argv'][$pos + 1], 0, 1) != "-") { $partype = $_SERVER['argv'][$pos + 1]; unset($_SERVER['argv'][$pos + 1]); } $req = new REQUEST(); switch ($partype) { case "servers": $list = $req->GetServerList(); break; case "sources": $list = $req->GetSourceList(); break; case "groups": $list = $req->GetGroupList(); break; default: throw new ADEIException(translate("Unsupported type of parallelization (%s)", $partype)); } $params = implode(" ", $_SERVER['argv']); chdir($curdir); $procs = array(); foreach ($list as $item) { $source = "db_server={$item['db_server']}"; if (isset($item['db_name'])) { $source .= "&db_name={$item['db_name']}"; } if (isset($item['db_group'])) { $source .= "&db_group={$item['db_group']}"; }
unset($_SERVER['argv'][$pos]); $partype = "sources"; if ($pos + 1 < $params && substr($_SERVER['argv'][$pos + 1], 0, 1) != "-") { $partype = $_SERVER['argv'][$pos + 1]; unset($_SERVER['argv'][$pos + 1]); } $req = new REQUEST(); switch ($partype) { case "servers": $list = $req->GetServerList(); break; case "sources": $list = $req->GetSourceList($list_flags); break; case "groups": $list = $req->GetGroupList($list_flags); break; default: throw new ADEIException(translate("Unsupported type of parallelization (%s)", $partype)); } $params = implode(" ", $_SERVER['argv']); chdir($curdir); $procs = array(); foreach ($list as $item) { $source = "db_server={$item['db_server']}"; if (isset($item['db_name'])) { $source .= "&db_name={$item['db_name']}"; } if (isset($item['db_group'])) { $source .= "&db_group={$item['db_group']}"; }
function GetGroupList($flags = 0) { if ($flags & REQUEST::LIST_ALL) { return REQUEST::GetGroupList($flags); } $list = array(); if (isset($this->props['db_group'])) { if ($rdr) { $reader =& $rdr; } else { $reader = $this->CreateReader(); } $grp = $reader->CreateGroup($req = array('db_group' => $this->props['db_group'])); $list = $reader->GetGroupInfo($grp, $flags); } else { if ($rdr) { $reader =& $rdr; } else { $reader = $this->CreateReader(); } $list = $reader->GetGroupList($flags); } if ($flags & REQUEST::SKIP_UNCACHED && !$this->srv['virtual']) { $cache = new CACHEDB(); $cached_groups = $cache->ListCachedGroups($this->props['db_name'], $this->props['db_server']); # print_r($list); # print_r($cached_groups); foreach (array_keys($list) as $key) { if (!in_array($list[$key]['gid'], $cached_groups)) { unset($list[$key]); } } } if ($list) { foreach ($list as &$gr) { $gr['db_group'] = $gr['gid']; $gr['db_group_name'] = $gr['name']; } } return $list; }