@@ -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 | |
@@ -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); |
@@ -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) ) { |
@@ -42,6 +42,9 @@ discard block |
||
| 42 | 42 | return $countries; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | + /** |
|
| 46 | + * @param integer $result |
|
| 47 | + */ |
|
| 45 | 48 | function log($module, $action, $result, $request, $response, $server, $is_ipn = false) { |
| 46 | 49 | global $customer_id; |
| 47 | 50 | |
@@ -182,6 +185,9 @@ discard block |
||
| 182 | 185 | return false; |
| 183 | 186 | } |
| 184 | 187 | |
| 188 | + /** |
|
| 189 | + * @param string $info |
|
| 190 | + */ |
|
| 185 | 191 | function getModuleInfo($module, $info) { |
| 186 | 192 | $class = 'OSCOM_PayPal_' . $module; |
| 187 | 193 | |
@@ -196,6 +202,10 @@ discard block |
||
| 196 | 202 | return $m->{'_' . $info}; |
| 197 | 203 | } |
| 198 | 204 | |
| 205 | + /** |
|
| 206 | + * @param string $module |
|
| 207 | + * @param string $type |
|
| 208 | + */ |
|
| 199 | 209 | function hasCredentials($module, $type = null) { |
| 200 | 210 | $server = constant('OSCOM_APP_PAYPAL_' . $module . '_STATUS'); |
| 201 | 211 | |
@@ -230,6 +240,10 @@ discard block |
||
| 230 | 240 | return true; |
| 231 | 241 | } |
| 232 | 242 | |
| 243 | + /** |
|
| 244 | + * @param string $module |
|
| 245 | + * @param string $type |
|
| 246 | + */ |
|
| 233 | 247 | function getCredentials($module, $type) { |
| 234 | 248 | if ( constant('OSCOM_APP_PAYPAL_' . $module . '_STATUS') == '1' ) { |
| 235 | 249 | if ( $type == 'email') { |
@@ -377,6 +391,11 @@ discard block |
||
| 377 | 391 | } |
| 378 | 392 | |
| 379 | 393 | // APP calls require $server to be "live" or "sandbox" |
| 394 | + /** |
|
| 395 | + * @param string $module |
|
| 396 | + * @param string $call |
|
| 397 | + * @param string $server |
|
| 398 | + */ |
|
| 380 | 399 | function getApiResult($module, $call, $extra_params = null, $server = null, $is_ipn = false) { |
| 381 | 400 | if ( $module == 'APP' ) { |
| 382 | 401 | $function = 'OSCOM_PayPal_Api_' . $call; |
@@ -403,6 +422,9 @@ discard block |
||
| 403 | 422 | return $result['res']; |
| 404 | 423 | } |
| 405 | 424 | |
| 425 | + /** |
|
| 426 | + * @param string $parameters |
|
| 427 | + */ |
|
| 406 | 428 | function makeApiCall($url, $parameters = null, $headers = null) { |
| 407 | 429 | $server = parse_url($url); |
| 408 | 430 | |
@@ -461,6 +483,10 @@ discard block |
||
| 461 | 483 | return $result; |
| 462 | 484 | } |
| 463 | 485 | |
| 486 | + /** |
|
| 487 | + * @param string $link |
|
| 488 | + * @param string $type |
|
| 489 | + */ |
|
| 464 | 490 | function drawButton($title = null, $link = null, $type = null, $params = null, $force_css = false) { |
| 465 | 491 | $colours = array('success' => '#1cb841', |
| 466 | 492 | 'error' => '#ca3c3c', |
@@ -752,6 +778,9 @@ discard block |
||
| 752 | 778 | } |
| 753 | 779 | } |
| 754 | 780 | |
| 781 | + /** |
|
| 782 | + * @param string $filename |
|
| 783 | + */ |
|
| 755 | 784 | public function loadLanguageFile($filename, $lang = null) { |
| 756 | 785 | global $language; |
| 757 | 786 | |
@@ -793,6 +822,9 @@ discard block |
||
| 793 | 822 | } |
| 794 | 823 | } |
| 795 | 824 | |
| 825 | + /** |
|
| 826 | + * @param string $key |
|
| 827 | + */ |
|
| 796 | 828 | function getDef($key, $values = null) { |
| 797 | 829 | $def = isset($this->_definitions[$key]) ? $this->_definitions[$key] : $key; |
| 798 | 830 | |
@@ -863,6 +895,9 @@ discard block |
||
| 863 | 895 | return str_replace('/', DIRECTORY_SEPARATOR, $pathname); |
| 864 | 896 | } |
| 865 | 897 | // OSCOM v2.2rc2a compatibility |
| 898 | + /** |
|
| 899 | + * @return string |
|
| 900 | + */ |
|
| 866 | 901 | function getIpAddress() { |
| 867 | 902 | if ( function_exists('tep_get_ip_address') ) { |
| 868 | 903 | return tep_get_ip_address(); |
@@ -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 | |
@@ -20,6 +20,9 @@ |
||
| 20 | 20 | $this->register('global'); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | + /** |
|
| 24 | + * @param string $group |
|
| 25 | + */ |
|
| 23 | 26 | function register($group) { |
| 24 | 27 | $group = basename($group); |
| 25 | 28 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | /** |
| 111 | 111 | * addHeader |
| 112 | 112 | * set a unique request header |
| 113 | - * @param headerName the header name |
|
| 113 | + * @param headerName string header name |
|
| 114 | 114 | * @param headerValue the header value, ( unencoded) |
| 115 | 115 | **/ |
| 116 | 116 | function addHeader($headerName, $headerValue) { |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | /** |
| 121 | 121 | * removeHeader |
| 122 | 122 | * unset a request header |
| 123 | - * @param headerName the header name |
|
| 123 | + * @param headerName string header name |
|
| 124 | 124 | **/ |
| 125 | 125 | function removeHeader($headerName) { |
| 126 | 126 | unset($this->requestHeaders[$headerName]); |
@@ -172,6 +172,7 @@ discard block |
||
| 172 | 172 | * get |
| 173 | 173 | * issue a GET http request |
| 174 | 174 | * @param uri URI (path on server) or full URL of the document |
| 175 | + * @param string $url |
|
| 175 | 176 | * @return string response status code (200 if ok) |
| 176 | 177 | * @seeAlso getHeaders(), getBody() |
| 177 | 178 | **/ |
@@ -309,7 +310,8 @@ discard block |
||
| 309 | 310 | * a) the command |
| 310 | 311 | * b) the request headers if they are defined |
| 311 | 312 | * c) the request body if defined |
| 312 | - * @return string the server repsonse status code |
|
| 313 | + * @param string $command |
|
| 314 | + * @return boolean|null the server repsonse status code |
|
| 313 | 315 | **/ |
| 314 | 316 | function sendCommand($command) { |
| 315 | 317 | $this->responseHeaders = array(); |
@@ -433,7 +435,7 @@ discard block |
||
| 433 | 435 | /** |
| 434 | 436 | * Calculate and return the URI to be sent ( proxy purpose ) |
| 435 | 437 | * @param the local URI |
| 436 | - * @return URI to be used in the HTTP request |
|
| 438 | + * @return string to be used in the HTTP request |
|
| 437 | 439 | * @scope private |
| 438 | 440 | **/ |
| 439 | 441 | function makeUri($uri) { |