@@ -55,6 +55,10 @@ |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | if (!function_exists('checkdnsrr')) { |
58 | + |
|
59 | + /** |
|
60 | + * @param string $type |
|
61 | + */ |
|
58 | 62 | function checkdnsrr($host, $type) { |
59 | 63 | if(tep_not_null($host) && tep_not_null($type)) { |
60 | 64 | @exec("nslookup -type=" . escapeshellarg($type) . " " . escapeshellarg($host), $output); |
@@ -32,6 +32,10 @@ discard block |
||
32 | 32 | return mysqli_close($$link); |
33 | 33 | } |
34 | 34 | |
35 | + /** |
|
36 | + * @param integer $errno |
|
37 | + * @param string $error |
|
38 | + */ |
|
35 | 39 | function tep_db_error($query, $errno, $error) { |
36 | 40 | if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) { |
37 | 41 | error_log('ERROR: [' . $errno . '] ' . $error . "\n", 3, STORE_PAGE_PARSE_TIME_LOG); |
@@ -52,6 +56,9 @@ discard block |
||
52 | 56 | return $result; |
53 | 57 | } |
54 | 58 | |
59 | + /** |
|
60 | + * @param string $table |
|
61 | + */ |
|
55 | 62 | function tep_db_perform($table, $data, $action = 'insert', $parameters = '', $link = 'db_link') { |
56 | 63 | reset($data); |
57 | 64 | if ($action == 'insert') { |
@@ -191,6 +198,9 @@ discard block |
||
191 | 198 | return mysql_error($link); |
192 | 199 | } |
193 | 200 | |
201 | + /** |
|
202 | + * @param string $charset |
|
203 | + */ |
|
194 | 204 | function mysqli_set_charset($link, $charset) { |
195 | 205 | if ( function_exists('mysql_set_charset') ) { |
196 | 206 | return mysql_set_charset($charset, $link); |
@@ -221,6 +231,9 @@ discard block |
||
221 | 231 | return mysql_error($link); |
222 | 232 | } |
223 | 233 | |
234 | + /** |
|
235 | + * @param integer $type |
|
236 | + */ |
|
224 | 237 | function mysqli_fetch_array($query, $type) { |
225 | 238 | return mysql_fetch_array($query, $type); |
226 | 239 | } |
@@ -81,6 +81,9 @@ discard block |
||
81 | 81 | |
82 | 82 | //// |
83 | 83 | // Return a random row from a database query |
84 | + /** |
|
85 | + * @param string $query |
|
86 | + */ |
|
84 | 87 | function tep_random_select($query) { |
85 | 88 | $random_product = ''; |
86 | 89 | $random_query = tep_db_query($query); |
@@ -145,6 +148,10 @@ discard block |
||
145 | 148 | |
146 | 149 | //// |
147 | 150 | // Break a word in a string if it is longer than a specified length ($len) |
151 | + /** |
|
152 | + * @param string $string |
|
153 | + * @param integer $len |
|
154 | + */ |
|
148 | 155 | function tep_break_string($string, $len, $break_char = '-') { |
149 | 156 | $l = 0; |
150 | 157 | $output = ''; |
@@ -260,6 +267,9 @@ discard block |
||
260 | 267 | |
261 | 268 | //// |
262 | 269 | // Returns the clients browser |
270 | + /** |
|
271 | + * @param string $component |
|
272 | + */ |
|
263 | 273 | function tep_browser_detect($component) { |
264 | 274 | global $HTTP_USER_AGENT; |
265 | 275 | |
@@ -302,6 +312,9 @@ discard block |
||
302 | 312 | |
303 | 313 | //// |
304 | 314 | // Wrapper function for round() |
315 | + /** |
|
316 | + * @return double |
|
317 | + */ |
|
305 | 318 | function tep_round($number, $precision) { |
306 | 319 | if (strpos($number, '.') && (strlen(substr($number, strpos($number, '.')+1)) > $precision)) { |
307 | 320 | $number = substr($number, 0, strpos($number, '.') + 1 + $precision + 1); |
@@ -448,6 +461,11 @@ discard block |
||
448 | 461 | //// |
449 | 462 | // Return a formatted address |
450 | 463 | // TABLES: address_format |
464 | + /** |
|
465 | + * @param boolean $html |
|
466 | + * @param string $boln |
|
467 | + * @param string $eoln |
|
468 | + */ |
|
451 | 469 | function tep_address_format($address_format_id, $address, $html, $boln, $eoln) { |
452 | 470 | $address_format_query = tep_db_query("select address_format as format from " . TABLE_ADDRESS_FORMAT . " where address_format_id = '" . (int)$address_format_id . "'"); |
453 | 471 | $address_format = tep_db_fetch_array($address_format_query); |
@@ -940,6 +958,9 @@ discard block |
||
940 | 958 | |
941 | 959 | //// |
942 | 960 | // Return a product ID with attributes |
961 | + /** |
|
962 | + * @param string $params |
|
963 | + */ |
|
943 | 964 | function tep_get_uprid($prid, $params) { |
944 | 965 | if (is_numeric($prid)) { |
945 | 966 | $uprid = (int)$prid; |
@@ -1036,6 +1057,11 @@ discard block |
||
1036 | 1057 | // $from_email_adress The eMail address of the sender, |
1037 | 1058 | // e.g. [email protected] |
1038 | 1059 | |
1060 | + /** |
|
1061 | + * @param string $to_name |
|
1062 | + * @param string $email_subject |
|
1063 | + * @param string $email_text |
|
1064 | + */ |
|
1039 | 1065 | function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) { |
1040 | 1066 | if (SEND_EMAILS != 'true') return false; |
1041 | 1067 | |
@@ -1104,6 +1130,9 @@ discard block |
||
1104 | 1130 | return tep_count_modules(MODULE_SHIPPING_INSTALLED); |
1105 | 1131 | } |
1106 | 1132 | |
1133 | + /** |
|
1134 | + * @param integer $length |
|
1135 | + */ |
|
1107 | 1136 | function tep_create_random_value($length, $type = 'mixed') { |
1108 | 1137 | if ( ($type != 'mixed') && ($type != 'chars') && ($type != 'digits')) $type = 'mixed'; |
1109 | 1138 | |
@@ -1253,6 +1282,10 @@ discard block |
||
1253 | 1282 | |
1254 | 1283 | //// |
1255 | 1284 | // Return a random value |
1285 | + /** |
|
1286 | + * @param integer $min |
|
1287 | + * @param integer $max |
|
1288 | + */ |
|
1256 | 1289 | function tep_rand($min = null, $max = null) { |
1257 | 1290 | static $seeded; |
1258 | 1291 | |
@@ -1386,6 +1419,9 @@ discard block |
||
1386 | 1419 | } |
1387 | 1420 | |
1388 | 1421 | // nl2br() prior PHP 4.2.0 did not convert linefeeds on all OSs (it only converted \n) |
1422 | + /** |
|
1423 | + * @param string[] $from |
|
1424 | + */ |
|
1389 | 1425 | function tep_convert_linefeeds($from, $to, $string) { |
1390 | 1426 | if ((PHP_VERSION < "4.0.5") && is_array($from)) { |
1391 | 1427 | return preg_replace('/(' . implode('|', $from) . ')/', $to, $string); |
@@ -117,6 +117,9 @@ discard block |
||
117 | 117 | //// |
118 | 118 | // The HTML form submit button wrapper function |
119 | 119 | // Outputs a button in the selected language |
120 | + /** |
|
121 | + * @param string $image |
|
122 | + */ |
|
120 | 123 | function tep_image_submit($image, $alt = '', $parameters = '') { |
121 | 124 | global $language; |
122 | 125 | |
@@ -147,6 +150,9 @@ discard block |
||
147 | 150 | |
148 | 151 | //// |
149 | 152 | // Output a form |
153 | + /** |
|
154 | + * @param string $name |
|
155 | + */ |
|
150 | 156 | function tep_draw_form($name, $action, $method = 'post', $parameters = '', $tokenize = false) { |
151 | 157 | global $sessiontoken; |
152 | 158 | |
@@ -197,6 +203,9 @@ discard block |
||
197 | 203 | |
198 | 204 | //// |
199 | 205 | // Output a selection field - alias function for tep_draw_checkbox_field() and tep_draw_radio_field() |
206 | + /** |
|
207 | + * @param string $type |
|
208 | + */ |
|
200 | 209 | function tep_draw_selection_field($name, $type, $value = '', $checked = false, $parameters = '') { |
201 | 210 | global $HTTP_GET_VARS, $HTTP_POST_VARS; |
202 | 211 | |
@@ -217,6 +226,9 @@ discard block |
||
217 | 226 | |
218 | 227 | //// |
219 | 228 | // Output a form checkbox field |
229 | + /** |
|
230 | + * @param string $name |
|
231 | + */ |
|
220 | 232 | function tep_draw_checkbox_field($name, $value = '', $checked = false, $parameters = '') { |
221 | 233 | return tep_draw_selection_field($name, 'checkbox', $value, $checked, $parameters); |
222 | 234 | } |
@@ -230,6 +242,10 @@ discard block |
||
230 | 242 | //// |
231 | 243 | // Output a form textarea field |
232 | 244 | // The $wrap parameter is no longer used in the core xhtml template |
245 | + /** |
|
246 | + * @param string $name |
|
247 | + * @param string|false $wrap |
|
248 | + */ |
|
233 | 249 | function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) { |
234 | 250 | global $HTTP_GET_VARS, $HTTP_POST_VARS; |
235 | 251 | |
@@ -337,6 +353,12 @@ discard block |
||
337 | 353 | |
338 | 354 | //// |
339 | 355 | // Output a jQuery UI Button |
356 | + /** |
|
357 | + * @param string $title |
|
358 | + * @param string $icon |
|
359 | + * @param string $link |
|
360 | + * @param string $priority |
|
361 | + */ |
|
340 | 362 | function tep_draw_button($title = null, $icon = null, $link = null, $priority = null, $params = null) { |
341 | 363 | static $button_counter = 1; |
342 | 364 |
@@ -91,6 +91,9 @@ discard block |
||
91 | 91 | return session_start(); |
92 | 92 | } |
93 | 93 | |
94 | + /** |
|
95 | + * @param string $variable |
|
96 | + */ |
|
94 | 97 | function tep_session_register($variable) { |
95 | 98 | if (!isset($GLOBALS[$variable])) { |
96 | 99 | $GLOBALS[$variable] = null; |
@@ -101,10 +104,16 @@ discard block |
||
101 | 104 | return false; |
102 | 105 | } |
103 | 106 | |
107 | + /** |
|
108 | + * @param string $variable |
|
109 | + */ |
|
104 | 110 | function tep_session_is_registered($variable) { |
105 | 111 | return isset($_SESSION) && array_key_exists($variable, $_SESSION); |
106 | 112 | } |
107 | 113 | |
114 | + /** |
|
115 | + * @param string $variable |
|
116 | + */ |
|
108 | 117 | function tep_session_unregister($variable) { |
109 | 118 | unset($_SESSION[$variable]); |
110 | 119 | } |
@@ -12,6 +12,9 @@ |
||
12 | 12 | |
13 | 13 | //// |
14 | 14 | // Sets the status of a special product |
15 | + /** |
|
16 | + * @param string $status |
|
17 | + */ |
|
15 | 18 | function tep_set_specials_status($specials_id, $status) { |
16 | 19 | return tep_db_query("update " . TABLE_SPECIALS . " set status = '" . (int)$status . "', date_status_change = now() where specials_id = '" . (int)$specials_id . "'"); |
17 | 20 | } |
@@ -312,6 +312,9 @@ |
||
312 | 312 | return array('OSCOM_APP_PAYPAL_LOGIN_CONTENT_WIDTH', 'OSCOM_APP_PAYPAL_LOGIN_SORT_ORDER'); |
313 | 313 | } |
314 | 314 | |
315 | + /** |
|
316 | + * @param string $attribute |
|
317 | + */ |
|
315 | 318 | function hasAttribute($attribute) { |
316 | 319 | return in_array($attribute, explode(';', OSCOM_APP_PAYPAL_LOGIN_ATTRIBUTES)); |
317 | 320 | } |
@@ -436,6 +436,9 @@ discard block |
||
436 | 436 | return $this->_check; |
437 | 437 | } |
438 | 438 | |
439 | + /** |
|
440 | + * @param string $parameter |
|
441 | + */ |
|
439 | 442 | function install($parameter = null) { |
440 | 443 | $params = $this->getParams(); |
441 | 444 | |
@@ -598,6 +601,10 @@ discard block |
||
598 | 601 | return md5($k_opad . pack("H*",md5($k_ipad . $data))); |
599 | 602 | } |
600 | 603 | |
604 | + /** |
|
605 | + * @param string $url |
|
606 | + * @param string $parameters |
|
607 | + */ |
|
601 | 608 | function sendTransactionToGateway($url, $parameters) { |
602 | 609 | $server = parse_url($url); |
603 | 610 |
@@ -343,6 +343,9 @@ discard block |
||
343 | 343 | return $this->_check; |
344 | 344 | } |
345 | 345 | |
346 | + /** |
|
347 | + * @param string $parameter |
|
348 | + */ |
|
346 | 349 | function install($parameter = null) { |
347 | 350 | $params = $this->getParams(); |
348 | 351 | |
@@ -473,6 +476,9 @@ discard block |
||
473 | 476 | return $params; |
474 | 477 | } |
475 | 478 | |
479 | + /** |
|
480 | + * @param string $data |
|
481 | + */ |
|
476 | 482 | function _hmac($key, $data) { |
477 | 483 | if (function_exists('hash_hmac')) { |
478 | 484 | return hash_hmac('md5', $data, $key); |