Skip to content

Commit

Permalink
- parsing of platforms from WCG's get_project_config.php was wrong
Browse files Browse the repository at this point in the history
svn path=/trunk/boinc/; revision=20461
  • Loading branch information
davidpanderson committed Feb 7, 2010
1 parent 1c73e6f commit 906cfeb
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 7 deletions.
6 changes: 6 additions & 0 deletions checkin_notes
Original file line number Diff line number Diff line change
Expand Up @@ -976,3 +976,9 @@ Rom 6 Feb 2010
taskbarex.cpp, .h
clientgui/msw/
taskbarex.cpp, .h

David 6 Feb 2010
- parsing of platforms from WCG's get_project_config.php was wrong

doc/
get_platforms.inc
46 changes: 39 additions & 7 deletions doc/get_platforms.inc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,24 @@ function friendly_name($p) {

// get platforms from get_project_config.php (preferred method)
//
// format is either
//
// <project_config>
// <platforms>
// <platform>windows_intelx86</platform>
// ...
//
// or
//
// <project_config>
// <platforms>
// <platform>
// <platform_name>windows_intelx86</platform_name>
// <user_friendly_name>Windows</user_friendly_name>
// [<plan_class>xxx</plan_class>]
// </platform>
// ...
//
function get_platforms(&$url) {
$url .= 'get_project_config.php';
$x = @file_get_contents($url);
Expand All @@ -51,16 +69,27 @@ function get_platforms(&$url) {
if (array_key_exists('rpc_prefix', $s)) {
$url = $s->rpc_prefix;
}
if (!array_key_exists('platforms', $s)) return null;
if (!array_key_exists('platforms', $s)) {
return null;
}
$p = $s->platforms;
if (!array_key_exists('platform', $p)) return null;
if (sizeof($p->platform) == 0) return null;
//print_r($p);
//echo "---\n";
//foreach ($p->children() as $x) {
// echo $x;
//}
if (!array_key_exists('platform', $p)) {
return null;
}
if (sizeof($p->platform) == 0) {
return null;
}
$list = array();
if (array_key_exists(0, $p->platform[0])) {
foreach ($p->platform as $r) {
$list[] = (string)$r->platform_name;
foreach ($p->children() as $r) {
$list[] = (string)$r;
}
} else {
$list = array();
foreach ($p->platform as $r) {
if (array_key_exists('plan_class', $r)) {
$list[] = (string)$r->platform_name.'['.(string)$r->plan_class.']';
Expand Down Expand Up @@ -152,7 +181,10 @@ function get_platforms_string($url) {
return make_friendly_string($l);
}

//echo get_platforms_string("http://www.worldcommunitygrid.org/");
//$u = "http://www.worldcommunitygrid.org/";
//$u = "http://setiathome.berkeley.edu/";
//$x = get_platforms($u);
//print_r($x);
//echo get_platforms_string("http://setiathome.berkeley.edu/");
//echo get_platforms_string("http://dist.ist.tugraz.at/cape5/");
//print_r(get_platforms2("http://www.primegrid.com/"));
Expand Down

0 comments on commit 906cfeb

Please sign in to comment.