@@ -82,6 +82,7 @@ discard block |
||
| 82 | 82 | * it. This can then be given as the first |
| 83 | 83 | * argument of the the functions |
| 84 | 84 | * add_html_image() or add_attachment(). |
| 85 | + * @param string $filename |
|
| 85 | 86 | */ |
| 86 | 87 | |
| 87 | 88 | function get_file($filename) { |
@@ -153,6 +154,7 @@ discard block |
||
| 153 | 154 | * Adds a html part to the mail. |
| 154 | 155 | * Also replaces image names with |
| 155 | 156 | * content-id's. |
| 157 | + * @param string $text |
|
| 156 | 158 | */ |
| 157 | 159 | |
| 158 | 160 | function add_html($html, $text = NULL, $images_dir = NULL) { |
@@ -165,6 +167,7 @@ discard block |
||
| 165 | 167 | /** |
| 166 | 168 | * Adds an image to the list of embedded |
| 167 | 169 | * images. |
| 170 | + * @param string $file |
|
| 168 | 171 | */ |
| 169 | 172 | |
| 170 | 173 | function add_html_image($file, $name = '', $c_type='application/octet-stream') { |
@@ -239,6 +242,9 @@ discard block |
||
| 239 | 242 | |
| 240 | 243 | /* HPDL PHP3 */ |
| 241 | 244 | // function &add_alternative_part(&$obj) { |
| 245 | + /** |
|
| 246 | + * @param null|mime $obj |
|
| 247 | + */ |
|
| 242 | 248 | function add_alternative_part(&$obj) { |
| 243 | 249 | $params['content_type'] = 'multipart/alternative'; |
| 244 | 250 | |
@@ -70,6 +70,9 @@ |
||
| 70 | 70 | $this->set_language($lng); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | + /** |
|
| 74 | + * @param string $language |
|
| 75 | + */ |
|
| 73 | 76 | function set_language($language) { |
| 74 | 77 | if ( (tep_not_null($language)) && (isset($this->catalog_languages[$language])) ) { |
| 75 | 78 | $this->language = $this->catalog_languages[$language]; |
@@ -45,6 +45,10 @@ |
||
| 45 | 45 | return '<span class="smallText">Parse Time: ' . $this->timer_total . 's</span>'; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | + /** |
|
| 49 | + * @param string $message |
|
| 50 | + * @param string $type |
|
| 51 | + */ |
|
| 48 | 52 | function write($message, $type) { |
| 49 | 53 | error_log(strftime(STORE_PARSE_DATE_TIME_FORMAT) . ' [' . $type . '] ' . $message . "\n", 3, STORE_PAGE_PARSE_TIME_LOG); |
| 50 | 54 | } |
@@ -55,6 +55,10 @@ discard block |
||
| 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); |
@@ -74,6 +78,11 @@ discard block |
||
| 74 | 78 | */ |
| 75 | 79 | |
| 76 | 80 | if ( !function_exists('http_build_query') && (PHP_VERSION >= 4)) { |
| 81 | + |
|
| 82 | + /** |
|
| 83 | + * @param string $numeric_prefix |
|
| 84 | + * @param string $arg_separator |
|
| 85 | + */ |
|
| 77 | 86 | function http_build_query($formdata, $numeric_prefix = null, $arg_separator = null) { |
| 78 | 87 | // If $formdata is an object, convert it to an array |
| 79 | 88 | if ( is_object($formdata) ) { |
@@ -125,6 +134,9 @@ discard block |
||
| 125 | 134 | } |
| 126 | 135 | |
| 127 | 136 | // Helper function |
| 137 | + /** |
|
| 138 | + * @param string $name |
|
| 139 | + */ |
|
| 128 | 140 | function http_build_query_helper($array, $name, $arg_separator) { |
| 129 | 141 | $tmp = array(); |
| 130 | 142 | |
@@ -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 | global $logger; |
| 37 | 41 | |
@@ -55,6 +59,9 @@ discard block |
||
| 55 | 59 | return $result; |
| 56 | 60 | } |
| 57 | 61 | |
| 62 | + /** |
|
| 63 | + * @param string $table |
|
| 64 | + */ |
|
| 58 | 65 | function tep_db_perform($table, $data, $action = 'insert', $parameters = '', $link = 'db_link') { |
| 59 | 66 | reset($data); |
| 60 | 67 | if ($action == 'insert') { |
@@ -205,6 +212,9 @@ discard block |
||
| 205 | 212 | return mysql_error($link); |
| 206 | 213 | } |
| 207 | 214 | |
| 215 | + /** |
|
| 216 | + * @param string $charset |
|
| 217 | + */ |
|
| 208 | 218 | function mysqli_set_charset($link, $charset) { |
| 209 | 219 | if ( function_exists('mysql_set_charset') ) { |
| 210 | 220 | return mysql_set_charset($charset, $link); |
@@ -235,6 +245,9 @@ discard block |
||
| 235 | 245 | return mysql_error($link); |
| 236 | 246 | } |
| 237 | 247 | |
| 248 | + /** |
|
| 249 | + * @param integer $type |
|
| 250 | + */ |
|
| 238 | 251 | function mysqli_fetch_array($query, $type) { |
| 239 | 252 | return mysql_fetch_array($query, $type); |
| 240 | 253 | } |
@@ -167,6 +167,9 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | + /** |
|
| 171 | + * @param string $raw_datetime |
|
| 172 | + */ |
|
| 170 | 173 | function tep_datetime_short($raw_datetime) { |
| 171 | 174 | if ( ($raw_datetime == '0000-00-00 00:00:00') || ($raw_datetime == '') ) return false; |
| 172 | 175 | |
@@ -277,6 +280,10 @@ discard block |
||
| 277 | 280 | return $image; |
| 278 | 281 | } |
| 279 | 282 | |
| 283 | + /** |
|
| 284 | + * @param string $string |
|
| 285 | + * @param integer $len |
|
| 286 | + */ |
|
| 280 | 287 | function tep_break_string($string, $len, $break_char = '-') { |
| 281 | 288 | $l = 0; |
| 282 | 289 | $output = ''; |
@@ -334,6 +341,9 @@ discard block |
||
| 334 | 341 | } |
| 335 | 342 | } |
| 336 | 343 | |
| 344 | + /** |
|
| 345 | + * @param string $component |
|
| 346 | + */ |
|
| 337 | 347 | function tep_browser_detect($component) { |
| 338 | 348 | global $HTTP_USER_AGENT; |
| 339 | 349 | |
@@ -379,6 +389,11 @@ discard block |
||
| 379 | 389 | return $geo_zone_name; |
| 380 | 390 | } |
| 381 | 391 | |
| 392 | + /** |
|
| 393 | + * @param boolean $html |
|
| 394 | + * @param string $boln |
|
| 395 | + * @param string $eoln |
|
| 396 | + */ |
|
| 382 | 397 | function tep_address_format($address_format_id, $address, $html, $boln, $eoln) { |
| 383 | 398 | $address_format_query = tep_db_query("select address_format as format from " . TABLE_ADDRESS_FORMAT . " where address_format_id = '" . (int)$address_format_id . "'"); |
| 384 | 399 | $address_format = tep_db_fetch_array($address_format_query); |
@@ -476,6 +491,9 @@ discard block |
||
| 476 | 491 | return $state_prov_code; |
| 477 | 492 | } |
| 478 | 493 | |
| 494 | + /** |
|
| 495 | + * @param string $params |
|
| 496 | + */ |
|
| 479 | 497 | function tep_get_uprid($prid, $params) { |
| 480 | 498 | $uprid = $prid; |
| 481 | 499 | if ( (is_array($params)) && (!strstr($prid, '{')) ) { |
@@ -573,6 +591,9 @@ discard block |
||
| 573 | 591 | //// |
| 574 | 592 | // Wrapper for class_exists() function |
| 575 | 593 | // This function is not available in all PHP versions so we test it before using it. |
| 594 | + /** |
|
| 595 | + * @param string $class_name |
|
| 596 | + */ |
|
| 576 | 597 | function tep_class_exists($class_name) { |
| 577 | 598 | if (function_exists('class_exists')) { |
| 578 | 599 | return class_exists($class_name); |
@@ -732,6 +753,9 @@ discard block |
||
| 732 | 753 | |
| 733 | 754 | //// |
| 734 | 755 | // Sets the status of a banner |
| 756 | + /** |
|
| 757 | + * @param string $status |
|
| 758 | + */ |
|
| 735 | 759 | function tep_set_banner_status($banners_id, $status) { |
| 736 | 760 | if ($status == '1') { |
| 737 | 761 | return tep_db_query("update " . TABLE_BANNERS . " set status = '1', expires_impressions = NULL, expires_date = NULL, date_status_change = NULL where banners_id = '" . $banners_id . "'"); |
@@ -768,6 +792,9 @@ discard block |
||
| 768 | 792 | |
| 769 | 793 | //// |
| 770 | 794 | // Sets the status of a product on special |
| 795 | + /** |
|
| 796 | + * @param string $status |
|
| 797 | + */ |
|
| 771 | 798 | function tep_set_specials_status($specials_id, $status) { |
| 772 | 799 | if ($status == '1') { |
| 773 | 800 | return tep_db_query("update " . TABLE_SPECIALS . " set status = '1', expires_date = NULL, date_status_change = NULL where specials_id = '" . (int)$specials_id . "'"); |
@@ -1018,6 +1045,9 @@ discard block |
||
| 1018 | 1045 | tep_db_query("delete from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "'"); |
| 1019 | 1046 | } |
| 1020 | 1047 | |
| 1048 | + /** |
|
| 1049 | + * @param string $cache_block |
|
| 1050 | + */ |
|
| 1021 | 1051 | function tep_reset_cache_block($cache_block) { |
| 1022 | 1052 | global $cache_blocks; |
| 1023 | 1053 | |
@@ -1161,6 +1191,11 @@ discard block |
||
| 1161 | 1191 | return $value; |
| 1162 | 1192 | } |
| 1163 | 1193 | |
| 1194 | + /** |
|
| 1195 | + * @param string $to_name |
|
| 1196 | + * @param string $email_subject |
|
| 1197 | + * @param string $email_text |
|
| 1198 | + */ |
|
| 1164 | 1199 | function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) { |
| 1165 | 1200 | if (SEND_EMAILS != 'true') return false; |
| 1166 | 1201 | |
@@ -1213,6 +1248,9 @@ discard block |
||
| 1213 | 1248 | |
| 1214 | 1249 | //// |
| 1215 | 1250 | // Wrapper function for round() for php3 compatibility |
| 1251 | + /** |
|
| 1252 | + * @return double |
|
| 1253 | + */ |
|
| 1216 | 1254 | function tep_round($value, $precision) { |
| 1217 | 1255 | return round($value, $precision); |
| 1218 | 1256 | } |
@@ -1329,6 +1367,10 @@ discard block |
||
| 1329 | 1367 | |
| 1330 | 1368 | //// |
| 1331 | 1369 | // Return a random value |
| 1370 | + /** |
|
| 1371 | + * @param integer $min |
|
| 1372 | + * @param integer $max |
|
| 1373 | + */ |
|
| 1332 | 1374 | function tep_rand($min = null, $max = null) { |
| 1333 | 1375 | static $seeded; |
| 1334 | 1376 | |
@@ -1352,6 +1394,9 @@ discard block |
||
| 1352 | 1394 | } |
| 1353 | 1395 | |
| 1354 | 1396 | // nl2br() prior PHP 4.2.0 did not convert linefeeds on all OSs (it only converted \n) |
| 1397 | + /** |
|
| 1398 | + * @param string[] $from |
|
| 1399 | + */ |
|
| 1355 | 1400 | function tep_convert_linefeeds($from, $to, $string) { |
| 1356 | 1401 | if ((PHP_VERSION < "4.0.5") && is_array($from)) { |
| 1357 | 1402 | return preg_replace('/(' . implode('|', $from) . ')/', $to, $string); |
@@ -109,6 +109,9 @@ discard block |
||
| 109 | 109 | //// |
| 110 | 110 | // The HTML form submit button wrapper function |
| 111 | 111 | // Outputs a button in the selected language |
| 112 | + /** |
|
| 113 | + * @param string $image |
|
| 114 | + */ |
|
| 112 | 115 | function tep_image_submit($image, $alt = '', $parameters = '') { |
| 113 | 116 | global $language; |
| 114 | 117 | |
@@ -176,6 +179,9 @@ discard block |
||
| 176 | 179 | |
| 177 | 180 | //// |
| 178 | 181 | // Output a form |
| 182 | + /** |
|
| 183 | + * @param string $name |
|
| 184 | + */ |
|
| 179 | 185 | function tep_draw_form($name, $action, $parameters = '', $method = 'post', $params = '') { |
| 180 | 186 | $form = '<form name="' . tep_output_string($name) . '" action="'; |
| 181 | 187 | if (tep_not_null($parameters)) { |
@@ -238,6 +244,9 @@ discard block |
||
| 238 | 244 | |
| 239 | 245 | //// |
| 240 | 246 | // Output a selection field - alias function for tep_draw_checkbox_field() and tep_draw_radio_field() |
| 247 | + /** |
|
| 248 | + * @param string $type |
|
| 249 | + */ |
|
| 241 | 250 | function tep_draw_selection_field($name, $type, $value = '', $checked = false, $compare = '') { |
| 242 | 251 | global $HTTP_GET_VARS, $HTTP_POST_VARS; |
| 243 | 252 | |
@@ -256,6 +265,9 @@ discard block |
||
| 256 | 265 | |
| 257 | 266 | //// |
| 258 | 267 | // Output a form checkbox field |
| 268 | + /** |
|
| 269 | + * @param string $name |
|
| 270 | + */ |
|
| 259 | 271 | function tep_draw_checkbox_field($name, $value = '', $checked = false, $compare = '') { |
| 260 | 272 | return tep_draw_selection_field($name, 'checkbox', $value, $checked, $compare); |
| 261 | 273 | } |
@@ -269,6 +281,10 @@ discard block |
||
| 269 | 281 | //// |
| 270 | 282 | // Output a form textarea field |
| 271 | 283 | // The $wrap parameter is no longer used in the core xhtml template |
| 284 | + /** |
|
| 285 | + * @param string $name |
|
| 286 | + * @param string|false $wrap |
|
| 287 | + */ |
|
| 272 | 288 | function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) { |
| 273 | 289 | global $HTTP_GET_VARS, $HTTP_POST_VARS; |
| 274 | 290 | |
@@ -365,6 +381,12 @@ discard block |
||
| 365 | 381 | |
| 366 | 382 | //// |
| 367 | 383 | // Output a jQuery UI Button |
| 384 | + /** |
|
| 385 | + * @param string $title |
|
| 386 | + * @param string $icon |
|
| 387 | + * @param string $link |
|
| 388 | + * @param string $priority |
|
| 389 | + */ |
|
| 368 | 390 | function tep_draw_button($title = null, $icon = null, $link = null, $priority = null, $params = null) { |
| 369 | 391 | static $button_counter = 1; |
| 370 | 392 | |
@@ -12,6 +12,11 @@ |
||
| 12 | 12 | /* Ensure the http_build_query is defined */ |
| 13 | 13 | |
| 14 | 14 | if (!function_exists('http_build_query')) {
|
| 15 | + |
|
| 16 | + /** |
|
| 17 | + * @param string $prefix |
|
| 18 | + * @param string $sep |
|
| 19 | + */ |
|
| 15 | 20 | function http_build_query($data, $prefix='', $sep='', $key='') {
|
| 16 | 21 | $ret = array(); |
| 17 | 22 | foreach ((array)$data as $k => $v) {
|
@@ -69,6 +69,9 @@ |
||
| 69 | 69 | return $this->doMigrationCheck($this->_pm_code) || $this->doMigrationCheck($this->_pm_pf_code); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | + /** |
|
| 73 | + * @param string $class |
|
| 74 | + */ |
|
| 72 | 75 | function doMigrationCheck($class) { |
| 73 | 76 | if ( file_exists(DIR_FS_CATALOG . 'includes/modules/payment/' . $class . '.php') ) { |
| 74 | 77 | if ( !class_exists($class) ) { |