@@ -522,7 +522,7 @@ |
||
522 | 522 | * "Safely" run eval |
523 | 523 | * @param string $code Code to run |
524 | 524 | * @param array $obj Object with variables |
525 | - * @return string|mixed |
|
525 | + * @return string |
|
526 | 526 | */ |
527 | 527 | function RunJail($code, $obj) { |
528 | 528 | $ret = ''; |
@@ -202,6 +202,9 @@ |
||
202 | 202 | } |
203 | 203 | |
204 | 204 | |
205 | +/** |
|
206 | + * @return string |
|
207 | + */ |
|
205 | 208 | function get_membername($username) { |
206 | 209 | global $config, $ds; |
207 | 210 | if ($config['auth_ldap_groupmembertype'] == 'fulldn') { |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | * @pinst Plugin instance |
278 | 278 | * @type Type name |
279 | 279 | * @tinst Type instance |
280 | - * @return Identifier that collectd's FLUSH command understands |
|
280 | + * @return string that collectd's FLUSH command understands |
|
281 | 281 | */ |
282 | 282 | function collectd_identifier($host, $plugin, $pinst, $type, $tinst) { |
283 | 283 | global $config; |
@@ -477,6 +477,7 @@ discard block |
||
477 | 477 | /** |
478 | 478 | * Helper function to strip quotes from RRD output |
479 | 479 | * @str RRD-Info generated string |
480 | + * @param string $str |
|
480 | 481 | * @return String with one surrounding pair of quotes stripped |
481 | 482 | */ |
482 | 483 | function rrd_strip_quotes($str) { |
@@ -493,6 +494,7 @@ discard block |
||
493 | 494 | /** |
494 | 495 | * Determine useful information about RRD file |
495 | 496 | * @file Name of RRD file to analyse |
497 | + * @param string $file |
|
496 | 498 | * @return Array describing the RRD file |
497 | 499 | */ |
498 | 500 | function rrd_info($file) { |
@@ -557,6 +559,9 @@ discard block |
||
557 | 559 | }//end rrd_info() |
558 | 560 | |
559 | 561 | |
562 | +/** |
|
563 | + * @param integer $code |
|
564 | + */ |
|
560 | 565 | function rrd_get_color($code, $line=true) { |
561 | 566 | global $config; |
562 | 567 | $name = ($line ? 'f_' : 'h_').$code; |
@@ -276,6 +276,10 @@ discard block |
||
276 | 276 | }//end generate_device_link() |
277 | 277 | |
278 | 278 | |
279 | +/** |
|
280 | + * @param string $url |
|
281 | + * @param string|null $class |
|
282 | + */ |
|
279 | 283 | function overlib_link($url, $text, $contents, $class) { |
280 | 284 | global $config; |
281 | 285 | |
@@ -505,6 +509,14 @@ discard block |
||
505 | 509 | }//end generate_graph_js_state() |
506 | 510 | |
507 | 511 | |
512 | +/** |
|
513 | + * @param integer $width |
|
514 | + * @param integer $height |
|
515 | + * @param string $left_colour |
|
516 | + * @param string $right_text |
|
517 | + * @param string $right_colour |
|
518 | + * @param string $right_background |
|
519 | + */ |
|
508 | 520 | function print_percentage_bar($width, $height, $percent, $left_text, $left_colour, $left_background, $right_text, $right_colour, $right_background) { |
509 | 521 | if ($percent > '100') { |
510 | 522 | $size_percent = '100'; |
@@ -1022,6 +1034,9 @@ discard block |
||
1022 | 1034 | }//end get_client_ip() |
1023 | 1035 | |
1024 | 1036 | |
1037 | +/** |
|
1038 | + * @param string $string |
|
1039 | + */ |
|
1025 | 1040 | function shorten_interface_type($string) { |
1026 | 1041 | return str_ireplace( |
1027 | 1042 | array( |
@@ -22,6 +22,10 @@ discard block |
||
22 | 22 | require 'includes/collectd/definitions.php'; |
23 | 23 | |
24 | 24 | |
25 | +/** |
|
26 | + * @param integer $fontsize |
|
27 | + * @param integer $width |
|
28 | + */ |
|
25 | 29 | function makeTextBlock($text, $fontfile, $fontsize, $width) { |
26 | 30 | // TODO: handle explicit line-break! |
27 | 31 | $words = explode(' ', $text); |
@@ -50,6 +54,8 @@ discard block |
||
50 | 54 | * @code_msg Short text description of HTTP error code |
51 | 55 | * @title Title for fake RRD graph |
52 | 56 | * @msg Complete error message to display in place of graph content |
57 | + * @param integer $code |
|
58 | + * @param string $code_msg |
|
53 | 59 | */ |
54 | 60 | function error($code, $code_msg, $title, $msg) { |
55 | 61 | global $config; |
@@ -30,6 +30,10 @@ discard block |
||
30 | 30 | var $portable_hashes; |
31 | 31 | var $random_state; |
32 | 32 | |
33 | + /** |
|
34 | + * @param integer $iteration_count_log2 |
|
35 | + * @param boolean $portable_hashes |
|
36 | + */ |
|
33 | 37 | function PasswordHash($iteration_count_log2, $portable_hashes) |
34 | 38 | { |
35 | 39 | $this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; |
@@ -45,6 +49,9 @@ discard block |
||
45 | 49 | $this->random_state .= getmypid(); |
46 | 50 | } |
47 | 51 | |
52 | + /** |
|
53 | + * @param integer $count |
|
54 | + */ |
|
48 | 55 | function get_random_bytes($count) |
49 | 56 | { |
50 | 57 | $output = openssl_random_pseudo_bytes($count,$strong); |
@@ -73,6 +80,9 @@ discard block |
||
73 | 80 | return $output; |
74 | 81 | } |
75 | 82 | |
83 | + /** |
|
84 | + * @param integer $count |
|
85 | + */ |
|
76 | 86 | function encode64($input, $count) |
77 | 87 | { |
78 | 88 | $output = ''; |
@@ -96,6 +106,9 @@ discard block |
||
96 | 106 | return $output; |
97 | 107 | } |
98 | 108 | |
109 | + /** |
|
110 | + * @param string $input |
|
111 | + */ |
|
99 | 112 | function gensalt_private($input) |
100 | 113 | { |
101 | 114 | $output = '$P$'; |
@@ -151,6 +164,9 @@ discard block |
||
151 | 164 | return $output; |
152 | 165 | } |
153 | 166 | |
167 | + /** |
|
168 | + * @param string $input |
|
169 | + */ |
|
154 | 170 | function gensalt_extended($input) |
155 | 171 | { |
156 | 172 | $count_log2 = min($this->iteration_count_log2 + 8, 24); |
@@ -169,6 +185,9 @@ discard block |
||
169 | 185 | return $output; |
170 | 186 | } |
171 | 187 | |
188 | + /** |
|
189 | + * @param string $input |
|
190 | + */ |
|
172 | 191 | function gensalt_blowfish($input) |
173 | 192 | { |
174 | 193 | # This one needs to use a different order of characters and a |
@@ -63,6 +63,9 @@ |
||
63 | 63 | }//end getDates() |
64 | 64 | |
65 | 65 | |
66 | +/** |
|
67 | + * @param string $inout |
|
68 | + */ |
|
66 | 69 | function getValue($host, $port, $id, $inout) { |
67 | 70 | global $config; |
68 | 71 |
@@ -16,6 +16,10 @@ discard block |
||
16 | 16 | * the source code distribution for details. |
17 | 17 | */ |
18 | 18 | |
19 | +/** |
|
20 | + * @param double $number |
|
21 | + * @param string $sf |
|
22 | + */ |
|
19 | 23 | function format_number_short($number, $sf) { |
20 | 24 | // This formats a number so that we only send back three digits plus an optional decimal point. |
21 | 25 | // Example: 723.42 -> 723 72.34 -> 72.3 2.23 -> 2.23 |
@@ -32,6 +36,9 @@ discard block |
||
32 | 36 | return $number; |
33 | 37 | } |
34 | 38 | |
39 | +/** |
|
40 | + * @param string $command |
|
41 | + */ |
|
35 | 42 | function external_exec($command) { |
36 | 43 | d_echo($command."\n"); |
37 | 44 | $output = shell_exec($command); |
@@ -396,6 +403,9 @@ discard block |
||
396 | 403 | return $os; |
397 | 404 | } |
398 | 405 | |
406 | +/** |
|
407 | + * @return string |
|
408 | + */ |
|
399 | 409 | function safename($name) { |
400 | 410 | return preg_replace('/[^a-zA-Z0-9,._\-]/', '_', $name); |
401 | 411 | } |
@@ -450,6 +460,9 @@ discard block |
||
450 | 460 | } |
451 | 461 | } |
452 | 462 | |
463 | +/** |
|
464 | + * @param string $attrib |
|
465 | + */ |
|
453 | 466 | function is_dev_attrib_enabled($device, $attrib, $default = true) { |
454 | 467 | $val = get_dev_attrib($device, $attrib); |
455 | 468 | if ($val != NULL) { |
@@ -238,6 +238,9 @@ discard block |
||
238 | 238 | return $ret; |
239 | 239 | } |
240 | 240 | |
241 | +/** |
|
242 | + * @param string $snmpver |
|
243 | + */ |
|
241 | 244 | function addHost($host, $snmpver, $port = '161', $transport = 'udp', $quiet = '0', $poller_group = '0', $force_add = '0') { |
242 | 245 | global $config; |
243 | 246 | |
@@ -601,6 +604,9 @@ discard block |
||
601 | 604 | } |
602 | 605 | } |
603 | 606 | |
607 | +/** |
|
608 | + * @param string $domain |
|
609 | + */ |
|
604 | 610 | function isDomainResolves($domain) { |
605 | 611 | return (gethostbyname($domain) != $domain || count(dns_get_record($domain)) != 0); |
606 | 612 | } |
@@ -609,6 +615,9 @@ discard block |
||
609 | 615 | return dbFetchCell("SELECT `status` FROM `devices` WHERE `device_id` = ?", array($id)); |
610 | 616 | } |
611 | 617 | |
618 | +/** |
|
619 | + * @param string $ip |
|
620 | + */ |
|
612 | 621 | function match_network($nets, $ip, $first=false) { |
613 | 622 | $return = false; |
614 | 623 | if (!is_array ($nets)) $nets = array ($nets); |
@@ -729,6 +738,10 @@ discard block |
||
729 | 738 | return $result; |
730 | 739 | } |
731 | 740 | |
741 | +/** |
|
742 | + * @param string $subject |
|
743 | + * @param string $message |
|
744 | + */ |
|
732 | 745 | function send_mail($emails,$subject,$message,$html=false) { |
733 | 746 | global $config; |
734 | 747 | if( is_array($emails) || ($emails = parse_email($emails)) ) { |
@@ -964,6 +977,9 @@ discard block |
||
964 | 977 | } |
965 | 978 | } |
966 | 979 | |
980 | +/** |
|
981 | + * @param string $json |
|
982 | + */ |
|
967 | 983 | function _json_format($json, $options = 448) { |
968 | 984 | $prettyPrint = (bool) ($options & JSON_PRETTY_PRINT); |
969 | 985 | $unescapeUnicode = (bool) ($options & JSON_UNESCAPED_UNICODE); |
@@ -1004,6 +1020,10 @@ discard block |
||
1004 | 1020 | if ($unescapeUnicode && function_exists('mb_convert_encoding')) { |
1005 | 1021 | // http://stackoverflow.com/questions/2934563/how-to-decode-unicode-escape-sequences-like-u00ed-to-proper-utf-8-encoded-cha |
1006 | 1022 | $buffer = preg_replace_callback('/\\\\u([0-9a-f]{4})/i', |
1023 | + |
|
1024 | + /** |
|
1025 | + * @param string $match |
|
1026 | + */ |
|
1007 | 1027 | function ($match) { |
1008 | 1028 | return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); |
1009 | 1029 | }, $buffer); |
@@ -1064,6 +1084,9 @@ discard block |
||
1064 | 1084 | return $result; |
1065 | 1085 | } |
1066 | 1086 | |
1087 | +/** |
|
1088 | + * @param string $delay |
|
1089 | + */ |
|
1067 | 1090 | function convert_delay($delay) { |
1068 | 1091 | $delay = preg_replace('/\s/','',$delay); |
1069 | 1092 | if(strstr($delay, 'm',TRUE)) { |
@@ -1095,6 +1118,9 @@ discard block |
||
1095 | 1118 | return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4)); |
1096 | 1119 | } |
1097 | 1120 | |
1121 | +/** |
|
1122 | + * @param resource $post |
|
1123 | + */ |
|
1098 | 1124 | function set_curl_proxy($post) { |
1099 | 1125 | global $config; |
1100 | 1126 | if (isset($_ENV['https_proxy'])) { |
@@ -1182,6 +1208,11 @@ discard block |
||
1182 | 1208 | return true; |
1183 | 1209 | } |
1184 | 1210 | |
1211 | +/** |
|
1212 | + * @param string $host |
|
1213 | + * @param string $params |
|
1214 | + * @param integer $address_family |
|
1215 | + */ |
|
1185 | 1216 | function fping($host,$params,$address_family = AF_INET) { |
1186 | 1217 | |
1187 | 1218 | global $config; |
@@ -1226,6 +1257,9 @@ discard block |
||
1226 | 1257 | return $response; |
1227 | 1258 | } |
1228 | 1259 | |
1260 | +/** |
|
1261 | + * @param string $function |
|
1262 | + */ |
|
1229 | 1263 | function function_check($function) { |
1230 | 1264 | return function_exists($function); |
1231 | 1265 | } |