@@ -315,6 +315,11 @@ discard block |
||
315 | 315 | /** |
316 | 316 | * Helper function used to scan for <meta>/<link> tags and extract information |
317 | 317 | * from them |
318 | + * @param string $tag |
|
319 | + * @param string $attrName |
|
320 | + * @param string $attrValue |
|
321 | + * @param string $valueName |
|
322 | + * @return string |
|
318 | 323 | */ |
319 | 324 | protected function htmlTag($content, $tag, $attrName, $attrValue, $valueName) |
320 | 325 | { |
@@ -531,6 +536,9 @@ discard block |
||
531 | 536 | return $params; |
532 | 537 | } |
533 | 538 | |
539 | + /** |
|
540 | + * @param boolean $immediate |
|
541 | + */ |
|
534 | 542 | protected function authUrl_v1($immediate) |
535 | 543 | { |
536 | 544 | $returnUrl = $this->returnUrl; |
@@ -552,6 +560,9 @@ discard block |
||
552 | 560 | , array('query' => http_build_query($params, '', '&'))); |
553 | 561 | } |
554 | 562 | |
563 | + /** |
|
564 | + * @param boolean $immediate |
|
565 | + */ |
|
555 | 566 | protected function authUrl_v2($immediate) |
556 | 567 | { |
557 | 568 | $params = array( |
@@ -587,7 +598,6 @@ discard block |
||
587 | 598 | /** |
588 | 599 | * Returns authentication url. Usually, you want to redirect your user to it. |
589 | 600 | * @return String The authentication url. |
590 | - * @param String $select_identifier Whether to request OP to select identity for an user in OpenID 2. Does not affect OpenID 1. |
|
591 | 601 | * @throws ErrorException |
592 | 602 | */ |
593 | 603 | function authUrl($immediate = false) |
@@ -88,17 +88,26 @@ discard block |
||
88 | 88 | "; |
89 | 89 | } |
90 | 90 | |
91 | +/** |
|
92 | + * @param string $name |
|
93 | + */ |
|
91 | 94 | function item_xml($name, $val) { |
92 | 95 | if (!$val) $val = 0; |
93 | 96 | echo " <$name>$val</$name>\n"; |
94 | 97 | } |
95 | 98 | |
99 | +/** |
|
100 | + * @param string $name |
|
101 | + */ |
|
96 | 102 | function item_html($name, $val) { |
97 | 103 | $name = tra($name); |
98 | 104 | echo "<tr><td>$name</td><td>$val</td></tr>\n"; |
99 | 105 | //echo "<tr><td align=right>$name</td><td align=right>$val</td></tr>\n"; |
100 | 106 | } |
101 | 107 | |
108 | +/** |
|
109 | + * @param stdClass $x |
|
110 | + */ |
|
102 | 111 | function show_status_html($x) { |
103 | 112 | page_head(tra("Project status")); |
104 | 113 | $j = $x->jobs; |
@@ -190,6 +199,9 @@ discard block |
||
190 | 199 | page_tail(); |
191 | 200 | } |
192 | 201 | |
202 | +/** |
|
203 | + * @param stdClass $x |
|
204 | + */ |
|
193 | 205 | function show_status_xml($x) { |
194 | 206 | xml_header(); |
195 | 207 | echo "<server_status>\n<daemon_status>\n"; |
@@ -239,6 +251,11 @@ discard block |
||
239 | 251 | "; |
240 | 252 | } |
241 | 253 | |
254 | +/** |
|
255 | + * @param string $cmd |
|
256 | + * @param string $pidname |
|
257 | + * @param string $host |
|
258 | + */ |
|
242 | 259 | function local_daemon_running($cmd, $pidname, $host) { |
243 | 260 | if (!$pidname) { |
244 | 261 | $cmd = trim($cmd); |
@@ -25,6 +25,9 @@ |
||
25 | 25 | |
26 | 26 | check_get_args(array("mode")); |
27 | 27 | |
28 | +/** |
|
29 | + * @param string $mode |
|
30 | + */ |
|
28 | 31 | function filename($mode) { |
29 | 32 | switch ($mode) { |
30 | 33 | case 'host': return "cuda_hosts.dat"; |
@@ -37,6 +37,9 @@ discard block |
||
37 | 37 | return $n; |
38 | 38 | } |
39 | 39 | |
40 | +/** |
|
41 | + * @param integer $state |
|
42 | + */ |
|
40 | 43 | function show_all_link($batches, $state, $limit, $user, $app) { |
41 | 44 | $n = state_count($batches, $state); |
42 | 45 | if ($n > $limit) { |
@@ -269,6 +272,9 @@ discard block |
||
269 | 272 | page_tail(); |
270 | 273 | } |
271 | 274 | |
275 | +/** |
|
276 | + * @param null|integer $app_id |
|
277 | + */ |
|
272 | 278 | function check_admin_access($user, $app_id) { |
273 | 279 | $user_submit = BoincUserSubmit::lookup_userid($user->id); |
274 | 280 | if (!$user_submit) error_page("no access"); |
@@ -523,6 +529,9 @@ discard block |
||
523 | 529 | page_tail(); |
524 | 530 | } |
525 | 531 | |
532 | +/** |
|
533 | + * @param null|integer $state |
|
534 | + */ |
|
526 | 535 | function show_batches_in_state($batches, $state) { |
527 | 536 | switch ($state) { |
528 | 537 | case BATCH_STATE_IN_PROGRESS: |
@@ -30,6 +30,9 @@ discard block |
||
30 | 30 | ini_set('display_errors', true); |
31 | 31 | ini_set('display_startup_errors', true); |
32 | 32 | |
33 | +/** |
|
34 | + * @param string $name |
|
35 | + */ |
|
33 | 36 | function get_wu($name) { |
34 | 37 | $name = BoincDb::escape_string($name); |
35 | 38 | $wu = BoincWorkunit::lookup("name='$name'"); |
@@ -37,6 +40,9 @@ discard block |
||
37 | 40 | return $wu; |
38 | 41 | } |
39 | 42 | |
43 | +/** |
|
44 | + * @param string $name |
|
45 | + */ |
|
40 | 46 | function get_submit_app($name) { |
41 | 47 | $name = BoincDb::escape_string($name); |
42 | 48 | $app = BoincApp::lookup("name='$name'"); |
@@ -76,6 +82,9 @@ discard block |
||
76 | 82 | return $y; |
77 | 83 | } |
78 | 84 | |
85 | +/** |
|
86 | + * @param SimpleXMLElement|null $template |
|
87 | + */ |
|
79 | 88 | function est_elapsed_time($r, $template) { |
80 | 89 | // crude estimate: batch FLOPs / project FLOPS |
81 | 90 | // |
@@ -122,6 +131,9 @@ discard block |
||
122 | 131 | "; |
123 | 132 | } |
124 | 133 | |
134 | +/** |
|
135 | + * @param SimpleXMLElement $template |
|
136 | + */ |
|
125 | 137 | function validate_batch($jobs, $template) { |
126 | 138 | $i = 0; |
127 | 139 | $n = count($template->file_info); |
@@ -191,6 +203,10 @@ discard block |
||
191 | 203 | |
192 | 204 | // submit a list of jobs with a single create_work command. |
193 | 205 | // |
206 | +/** |
|
207 | + * @param SimpleXMLElement|null $template |
|
208 | + * @param double $priority |
|
209 | + */ |
|
194 | 210 | function submit_jobs( |
195 | 211 | $jobs, $template, $app, $batch_id, $priority, |
196 | 212 | $result_template_file, // batch-level; can also specify per job |
@@ -267,6 +283,9 @@ discard block |
||
267 | 283 | // Check whether the template is already in our map. |
268 | 284 | // If not, write it to a temp file. |
269 | 285 | // |
286 | +/** |
|
287 | + * @param stdClass $job |
|
288 | + */ |
|
270 | 289 | function make_wu_template($job) { |
271 | 290 | global $wu_templates; |
272 | 291 | if (!array_key_exists($job->wu_template, $wu_templates)) { |
@@ -283,6 +302,9 @@ discard block |
||
283 | 302 | // A little different because these have to exist for life of job. |
284 | 303 | // Store them in templates/tmp/, with content-based filenames |
285 | 304 | // |
305 | +/** |
|
306 | + * @param stdClass $job |
|
307 | + */ |
|
286 | 308 | function make_result_template($job) { |
287 | 309 | global $result_templates; |
288 | 310 | if (!array_key_exists($job->result_template, $result_templates)) { |
@@ -468,6 +490,9 @@ discard block |
||
468 | 490 | "; |
469 | 491 | } |
470 | 492 | |
493 | +/** |
|
494 | + * @param integer $get_cpu_time |
|
495 | + */ |
|
471 | 496 | function print_batch_params($batch, $get_cpu_time) { |
472 | 497 | $app = BoincApp::lookup_id($batch->app_id); |
473 | 498 | if (!$app) $app->name = "none"; |
@@ -57,6 +57,9 @@ |
||
57 | 57 | edit_form($user, $team, $forum, true); |
58 | 58 | } |
59 | 59 | |
60 | +/** |
|
61 | + * @param boolean $first |
|
62 | + */ |
|
60 | 63 | function edit_form($user, $team, $forum, $first) { |
61 | 64 | page_head(tra("Team Message Board")); |
62 | 65 | echo " |
@@ -30,6 +30,9 @@ |
||
30 | 30 | // list entries are of the form id => team, |
31 | 31 | // where team includes a field "refcnt". |
32 | 32 | // |
33 | +/** |
|
34 | + * @param integer $weight |
|
35 | + */ |
|
33 | 36 | function merge_lists($list1, &$list2, $weight) { |
34 | 37 | foreach($list1 as $team) { |
35 | 38 | $id = $team->id; |
@@ -36,6 +36,10 @@ discard block |
||
36 | 36 | return file_exists("$d/stop_sched"); |
37 | 37 | } |
38 | 38 | |
39 | +/** |
|
40 | + * @param string $x |
|
41 | + * @param string $y |
|
42 | + */ |
|
39 | 43 | function show_page($x, $y) { |
40 | 44 | echo " |
41 | 45 | <title>$x</title> |
@@ -44,6 +48,9 @@ discard block |
||
44 | 48 | "; |
45 | 49 | } |
46 | 50 | |
51 | +/** |
|
52 | + * @param integer $num |
|
53 | + */ |
|
47 | 54 | function xml_error($num, $msg=null, $file=null, $line=null) { |
48 | 55 | global $xml_outer_tag; |
49 | 56 | if (!$msg) { |
@@ -92,6 +99,9 @@ discard block |
||
92 | 99 | // Look for an element in a line of XML text |
93 | 100 | // If it's a single-tag element, and it's present, just return the tag |
94 | 101 | // |
102 | +/** |
|
103 | + * @return string |
|
104 | + */ |
|
95 | 105 | function parse_element($xml, $tag) { |
96 | 106 | $element = null; |
97 | 107 | $closetag = "</" . substr($tag,1); |
@@ -107,6 +117,9 @@ discard block |
||
107 | 117 | return trim($element); |
108 | 118 | } |
109 | 119 | |
120 | +/** |
|
121 | + * @param string $tag |
|
122 | + */ |
|
110 | 123 | function parse_next_element($xml, $tag, &$cursor) { |
111 | 124 | $element = null; |
112 | 125 | $closetag = "</" . substr($tag,1); |
@@ -137,6 +150,9 @@ discard block |
||
137 | 150 | |
138 | 151 | // look for a particular element in the config file |
139 | 152 | // |
153 | +/** |
|
154 | + * @param string $tag |
|
155 | + */ |
|
140 | 156 | function parse_config($config, $tag) { |
141 | 157 | $element = parse_element($config, $tag); |
142 | 158 | return $element; |
@@ -168,6 +168,7 @@ discard block |
||
168 | 168 | /** |
169 | 169 | * Implementation of hook_node_view(); add custom actions when a node |
170 | 170 | * is viewed (forward compatible to Drupal 7) |
171 | + * @param string $view_mode |
|
171 | 172 | */ |
172 | 173 | function boinctranslate_node_view($node, $view_mode, $langcode) { |
173 | 174 | switch($node->type) { |
@@ -706,6 +707,7 @@ discard block |
||
706 | 707 | |
707 | 708 | /** |
708 | 709 | * |
710 | + * @param string $type |
|
709 | 711 | */ |
710 | 712 | function boinctranslate_export_po_generate($language = NULL, $strings = array(), $header = NULL, $type = NULL) { |
711 | 713 | |
@@ -1081,6 +1083,7 @@ discard block |
||
1081 | 1083 | |
1082 | 1084 | /** |
1083 | 1085 | * |
1086 | + * @param stdClass $file |
|
1084 | 1087 | */ |
1085 | 1088 | function _boinctranslate_locale_import_po($file, $langcode, $mode, $group = NULL) { |
1086 | 1089 | // Try to allocate enough time to parse and import the data. |
@@ -1127,6 +1130,7 @@ discard block |
||
1127 | 1130 | |
1128 | 1131 | /** |
1129 | 1132 | * |
1133 | + * @param string $op |
|
1130 | 1134 | */ |
1131 | 1135 | function _boinctranslate_locale_import_read_po($op, $file, $mode = NULL, $lang = NULL, $group = 'default') { |
1132 | 1136 | |
@@ -1478,6 +1482,7 @@ discard block |
||
1478 | 1482 | * |
1479 | 1483 | * Textgroups 'boinc' and 'project' use the location string to |
1480 | 1484 | * uniquely identify rows in the locales_source database. |
1485 | + * @param string $textgroup |
|
1481 | 1486 | */ |
1482 | 1487 | function _boinctranslate_locale_import_one_string_db(&$report, $langcode, $source, $translation, $textgroup, $location, $mode, $plid = NULL, $plural = NULL) { |
1483 | 1488 |