@@ -52,6 +52,9 @@ |
||
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
55 | +/** |
|
56 | + * @param string $n |
|
57 | + */ |
|
55 | 58 | function valuator($n) { |
56 | 59 | return array('valuator', $n); |
57 | 60 | } |
@@ -45,6 +45,9 @@ discard block |
||
45 | 45 | return "../bolt_snap/compare_snapshot_$x"; |
46 | 46 | } |
47 | 47 | |
48 | +/** |
|
49 | + * @param null|integer $dur |
|
50 | + */ |
|
48 | 51 | function write_compare_snapshot($course_id, $select_name, $xset_name, $dur) { |
49 | 52 | $now = time(); |
50 | 53 | $start = $now - $dur*86400; |
@@ -127,6 +130,9 @@ discard block |
||
127 | 130 | return "../bolt_snap/map_snapshot_".$course_id; |
128 | 131 | } |
129 | 132 | |
133 | +/** |
|
134 | + * @param null|integer $dur |
|
135 | + */ |
|
130 | 136 | function write_map_snapshot($course_id, $dur) { |
131 | 137 | $now = time(); |
132 | 138 | $start = $now - $dur*86400; |
@@ -23,6 +23,9 @@ discard block |
||
23 | 23 | |
24 | 24 | // get names of units of a given type |
25 | 25 | |
26 | +/** |
|
27 | + * @param string $type |
|
28 | + */ |
|
26 | 29 | function units_of_type($unit, $type) { |
27 | 30 | $names = array(); |
28 | 31 | if (get_class($unit) == $type) { |
@@ -118,6 +121,10 @@ discard block |
||
118 | 121 | |
119 | 122 | //////////// graph drawing |
120 | 123 | |
124 | +/** |
|
125 | + * @param integer $n |
|
126 | + * @param integer $width |
|
127 | + */ |
|
121 | 128 | function compare_bar($title, $n, $width, $lo, $hi) { |
122 | 129 | $x1 = $width*$lo; |
123 | 130 | $x2 = $width*($hi-$lo); |
@@ -137,6 +144,9 @@ discard block |
||
137 | 144 | "; |
138 | 145 | } |
139 | 146 | |
147 | +/** |
|
148 | + * @param integer $width |
|
149 | + */ |
|
140 | 150 | function compare_bar_insuff($title, $width) { |
141 | 151 | return " |
142 | 152 | <tr> |
@@ -150,6 +160,10 @@ discard block |
||
150 | 160 | "; |
151 | 161 | } |
152 | 162 | |
163 | +/** |
|
164 | + * @param integer[] $x |
|
165 | + * @param integer $width |
|
166 | + */ |
|
153 | 167 | function outcome_graph($x, $width) { |
154 | 168 | $n = $x[0]+$x[1]+$x[2]; |
155 | 169 | if (!$n) return empty_cell(); |
@@ -182,6 +196,9 @@ discard block |
||
182 | 196 | return $s; |
183 | 197 | } |
184 | 198 | |
199 | +/** |
|
200 | + * @param integer $w |
|
201 | + */ |
|
185 | 202 | function time_graph($t, $w) { |
186 | 203 | if ($t == 0) return "<td>---</td>"; |
187 | 204 | $x = (log10($t)+2)*$w/4; |
@@ -193,6 +210,10 @@ discard block |
||
193 | 210 | </td>"; |
194 | 211 | } |
195 | 212 | |
213 | +/** |
|
214 | + * @param integer $t |
|
215 | + * @param integer $w |
|
216 | + */ |
|
196 | 217 | function score_graph($t, $w) { |
197 | 218 | if ($t == 0) return "<td>---</td>"; |
198 | 219 | $x = $t*$w; |
@@ -22,6 +22,9 @@ discard block |
||
22 | 22 | public $weight; |
23 | 23 | public $callback; |
24 | 24 | |
25 | + /** |
|
26 | + * @param null|BoltRefresh $refresh |
|
27 | + */ |
|
25 | 28 | function __construct( |
26 | 29 | $name, $units, $number, $repeats, $refresh, $attrs, $callback, $weight |
27 | 30 | ) { |
@@ -156,10 +159,16 @@ discard block |
||
156 | 159 | define('REPEAT', 2); |
157 | 160 | define('NEXT', 4); |
158 | 161 | |
162 | +/** |
|
163 | + * @param integer $f |
|
164 | + */ |
|
159 | 165 | function repeat($s, $u, $f) { |
160 | 166 | return new BoltRepeat($s, $u, $f); |
161 | 167 | } |
162 | 168 | |
169 | +/** |
|
170 | + * @param integer[] $a |
|
171 | + */ |
|
163 | 172 | function refresh($a) { |
164 | 173 | return new BoltRefresh($a); |
165 | 174 | } |
@@ -38,6 +38,9 @@ |
||
38 | 38 | return $job->insert($clause); |
39 | 39 | } |
40 | 40 | |
41 | +/** |
|
42 | + * @param string $name |
|
43 | + */ |
|
41 | 44 | function bossa_batch_create($appid, $name, $calibration) { |
42 | 45 | $now = time(); |
43 | 46 | $c = $calibration?"1":"0"; |
@@ -59,6 +59,9 @@ discard block |
||
59 | 59 | return $path; |
60 | 60 | } |
61 | 61 | |
62 | +/** |
|
63 | + * @param string $dir |
|
64 | + */ |
|
62 | 65 | function disk_usage($dir) { |
63 | 66 | $usage=0; |
64 | 67 | if ($handle=@opendir($dir)) { |
@@ -76,6 +79,10 @@ discard block |
||
76 | 79 | return $usage; |
77 | 80 | } |
78 | 81 | |
82 | +/** |
|
83 | + * @param integer $max_age |
|
84 | + * @param string $dir |
|
85 | + */ |
|
79 | 86 | function clean_cache($max_age, $dir) { |
80 | 87 | $start_dir = getcwd(); |
81 | 88 | if (!chdir($dir)) { |
@@ -116,6 +123,9 @@ discard block |
||
116 | 123 | clean_cache($x, "../cache"); |
117 | 124 | } |
118 | 125 | |
126 | +/** |
|
127 | + * @param string $path |
|
128 | + */ |
|
119 | 129 | function cache_need_to_regenerate($path, $max_age){ |
120 | 130 | $regenerate = false; |
121 | 131 | $request = apache_request_headers(); |
@@ -139,6 +149,9 @@ discard block |
||
139 | 149 | } |
140 | 150 | |
141 | 151 | // Returns cached data or false if nothing was found |
152 | +/** |
|
153 | + * @param integer $max_age |
|
154 | + */ |
|
142 | 155 | function get_cached_data($max_age, $params=""){ |
143 | 156 | global $no_cache; |
144 | 157 | |
@@ -253,6 +266,10 @@ discard block |
||
253 | 266 | } |
254 | 267 | } |
255 | 268 | |
269 | +/** |
|
270 | + * @param integer $max_age |
|
271 | + * @param string $data |
|
272 | + */ |
|
256 | 273 | function set_cached_data($max_age, $data, $params=""){ |
257 | 274 | // for the benefit of hackers |
258 | 275 | if (strstr($params, "..")) { |
@@ -37,6 +37,9 @@ |
||
37 | 37 | $ops = number_format($ops, 2); |
38 | 38 | } |
39 | 39 | |
40 | +/** |
|
41 | + * @param boolean $bolden |
|
42 | + */ |
|
40 | 43 | function credit_string($credit, $bolden) { |
41 | 44 | $cobbs = number_format($credit, 0); |
42 | 45 |
@@ -69,6 +69,10 @@ discard block |
||
69 | 69 | function _mysql_fetch_row($r) { |
70 | 70 | return mysqli_fetch_row($r); |
71 | 71 | } |
72 | + |
|
73 | + /** |
|
74 | + * @param resource $r |
|
75 | + */ |
|
72 | 76 | function _mysql_fetch_assoc($r) { |
73 | 77 | return mysqli_fetch_assoc($r); |
74 | 78 | } |
@@ -132,6 +136,10 @@ discard block |
||
132 | 136 | function _mysql_fetch_row($r) { |
133 | 137 | return mysql_fetch_row($r); |
134 | 138 | } |
139 | + |
|
140 | + /** |
|
141 | + * @param resource $r |
|
142 | + */ |
|
135 | 143 | function _mysql_fetch_assoc($r) { |
136 | 144 | return mysql_fetch_assoc($r); |
137 | 145 | } |
@@ -103,6 +103,9 @@ discard block |
||
103 | 103 | |
104 | 104 | // Function prints a description of $table |
105 | 105 | // |
106 | +/** |
|
107 | + * @param integer $which |
|
108 | + */ |
|
106 | 109 | function print_describe_table_onecol($table, $which, $columns) { |
107 | 110 | $db = BoincDb::get(true); |
108 | 111 | $result = $db->do_query("SELECT * from $table LIMIT 1"); |
@@ -262,6 +265,10 @@ discard block |
||
262 | 265 | $this->urlquery .= "&clauses=$clause"; |
263 | 266 | } |
264 | 267 | } |
268 | + |
|
269 | + /** |
|
270 | + * @param string $name |
|
271 | + */ |
|
265 | 272 | function addeq($name) { |
266 | 273 | if (isset($_GET[$name])) { |
267 | 274 | $value = $_GET[$name]; |
@@ -273,6 +280,10 @@ discard block |
||
273 | 280 | $this->urlquery .= "&$name=".urlencode($value); |
274 | 281 | } |
275 | 282 | } |
283 | + |
|
284 | + /** |
|
285 | + * @param string $name |
|
286 | + */ |
|
276 | 287 | function addeq_not_CHOOSE_ALL($name) { |
277 | 288 | if (isset($_GET[$name])) { |
278 | 289 | $value = $_GET[$name]; |
@@ -287,6 +298,10 @@ discard block |
||
287 | 298 | $this->urlquery .= "&$name=".urlencode($value); |
288 | 299 | } |
289 | 300 | } |
301 | + |
|
302 | + /** |
|
303 | + * @param string $name |
|
304 | + */ |
|
290 | 305 | function addgt($name) { |
291 | 306 | if (isset($_GET[$name])) { |
292 | 307 | $value = $_GET[$name]; |
@@ -298,6 +313,11 @@ discard block |
||
298 | 313 | $this->urlquery .= "&$name=".urlencode($value); |
299 | 314 | } |
300 | 315 | } |
316 | + |
|
317 | + /** |
|
318 | + * @param string $name |
|
319 | + * @param string $order |
|
320 | + */ |
|
301 | 321 | function addsort($name, $order) { |
302 | 322 | if (isset($_GET[$name])) { |
303 | 323 | $value = $_GET[$name]; |
@@ -375,6 +395,9 @@ discard block |
||
375 | 395 | } |
376 | 396 | |
377 | 397 | |
398 | +/** |
|
399 | + * @param string $mq |
|
400 | + */ |
|
378 | 401 | function link_results($n, $mq, $query, $clauses) { |
379 | 402 | if ($n == '0') { // intentional compare by string |
380 | 403 | return "0"; |
@@ -824,6 +847,9 @@ discard block |
||
824 | 847 | return number_format($x/86400, 2)." days"; |
825 | 848 | } |
826 | 849 | |
850 | +/** |
|
851 | + * @param integer $x |
|
852 | + */ |
|
827 | 853 | function resource_name($x) { |
828 | 854 | switch ($x) { |
829 | 855 | case 2: return "CPU"; |