Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -76,10 +76,10 @@ |
77 | 77 | if( !function_exists( 'mb_strpos' ) ) { |
78 | 78 | /** |
79 | 79 | * Fallback implementation of mb_strpos, hardcoded to UTF-8. |
80 | | - * @param string $haystack |
81 | | - * @param string $needle |
82 | | - * @param string $offset optional start position |
83 | | - * @param string $encoding optional encoding; ignored |
| 80 | + * @param $haystack String |
| 81 | + * @param $needle String |
| 82 | + * @param $offset String: optional start position |
| 83 | + * @param $encoding String: optional encoding; ignored |
84 | 84 | * @return int |
85 | 85 | */ |
86 | 86 | function mb_strpos( $haystack, $needle, $offset = 0, $encoding="" ) { |
— | — | @@ -99,10 +99,10 @@ |
100 | 100 | if( !function_exists( 'mb_strrpos' ) ) { |
101 | 101 | /** |
102 | 102 | * Fallback implementation of mb_strrpos, hardcoded to UTF-8. |
103 | | - * @param string $haystack |
104 | | - * @param string $needle |
105 | | - * @param string $offset optional start position |
106 | | - * @param string $encoding optional encoding; ignored |
| 103 | + * @param $haystack String |
| 104 | + * @param $needle String |
| 105 | + * @param $offset String: optional start position |
| 106 | + * @param $encoding String: optional encoding; ignored |
107 | 107 | * @return int |
108 | 108 | */ |
109 | 109 | function mb_strrpos( $haystack, $needle, $offset = 0, $encoding = "" ) { |
— | — | @@ -295,7 +295,7 @@ |
296 | 296 | |
297 | 297 | /** |
298 | 298 | * Send a line giving PHP memory usage. |
299 | | - * @param $exact Bool : print exact values instead of kilobytes (default: false) |
| 299 | + * @param $exact Bool: print exact values instead of kilobytes (default: false) |
300 | 300 | */ |
301 | 301 | function wfDebugMem( $exact = false ) { |
302 | 302 | $mem = memory_get_usage(); |
— | — | @@ -628,11 +628,11 @@ |
629 | 629 | |
630 | 630 | /** |
631 | 631 | * Fetch a message string value, but don't replace any keys yet. |
632 | | - * @param string $key |
633 | | - * @param bool $useDB |
634 | | - * @param string $langcode Code of the language to get the message for, or |
635 | | - * behaves as a content language switch if it is a |
636 | | - * boolean. |
| 632 | + * @param $key String |
| 633 | + * @param $useDB Bool |
| 634 | + * @param $langCode String: Code of the language to get the message for, or |
| 635 | + * behaves as a content language switch if it is a boolean. |
| 636 | + * @param $transform Boolean: whether to parse magic words, etc. |
637 | 637 | * @return string |
638 | 638 | * @private |
639 | 639 | */ |
— | — | @@ -667,8 +667,8 @@ |
668 | 668 | /** |
669 | 669 | * Replace message parameter keys on the given formatted output. |
670 | 670 | * |
671 | | - * @param string $message |
672 | | - * @param array $args |
| 671 | + * @param $message String |
| 672 | + * @param $args Array |
673 | 673 | * @return string |
674 | 674 | * @private |
675 | 675 | */ |
— | — | @@ -699,7 +699,7 @@ |
700 | 700 | * to pre-escape them if you really do want plaintext, or just wrap |
701 | 701 | * the whole thing in htmlspecialchars(). |
702 | 702 | * |
703 | | - * @param string $key |
| 703 | + * @param $key String |
704 | 704 | * @param string ... parameters |
705 | 705 | * @return string |
706 | 706 | */ |
— | — | @@ -716,7 +716,7 @@ |
717 | 717 | * to pre-escape them if you really do want plaintext, or just wrap |
718 | 718 | * the whole thing in htmlspecialchars(). |
719 | 719 | * |
720 | | - * @param string $key |
| 720 | + * @param $key String |
721 | 721 | * @param string ... parameters |
722 | 722 | * @return string |
723 | 723 | */ |
— | — | @@ -729,8 +729,8 @@ |
730 | 730 | |
731 | 731 | /** |
732 | 732 | * Returns message in the requested format |
733 | | - * @param string $key Key of the message |
734 | | - * @param array $options Processing rules. Can take the following options: |
| 733 | + * @param $key String: key of the message |
| 734 | + * @param $options Array: processing rules. Can take the following options: |
735 | 735 | * <i>parse</i>: parses wikitext to html |
736 | 736 | * <i>parseinline</i>: parses wikitext to html and removes the surrounding |
737 | 737 | * p's added by parser or tidy |
— | — | @@ -855,7 +855,7 @@ |
856 | 856 | /** |
857 | 857 | * Print a simple message and die, returning nonzero to the shell if any. |
858 | 858 | * Plain die() fails to return nonzero to the shell if you pass a string. |
859 | | - * @param string $msg |
| 859 | + * @param $msg String |
860 | 860 | */ |
861 | 861 | function wfDie( $msg='' ) { |
862 | 862 | echo $msg; |
— | — | @@ -866,7 +866,7 @@ |
867 | 867 | * Throw a debugging exception. This function previously once exited the process, |
868 | 868 | * but now throws an exception instead, with similar results. |
869 | 869 | * |
870 | | - * @param string $msg Message shown when dieing. |
| 870 | + * @param $msg String: message shown when dieing. |
871 | 871 | */ |
872 | 872 | function wfDebugDieBacktrace( $msg = '' ) { |
873 | 873 | throw new MWException( $msg ); |
— | — | @@ -900,21 +900,21 @@ |
901 | 901 | return $host; |
902 | 902 | } |
903 | 903 | |
904 | | - /** |
905 | | - * Returns a HTML comment with the elapsed time since request. |
906 | | - * This method has no side effects. |
907 | | - * @return string |
908 | | - */ |
909 | | - function wfReportTime() { |
910 | | - global $wgRequestTime, $wgShowHostnames; |
| 904 | +/** |
| 905 | + * Returns a HTML comment with the elapsed time since request. |
| 906 | + * This method has no side effects. |
| 907 | + * @return string |
| 908 | + */ |
| 909 | +function wfReportTime() { |
| 910 | + global $wgRequestTime, $wgShowHostnames; |
911 | 911 | |
912 | | - $now = wfTime(); |
913 | | - $elapsed = $now - $wgRequestTime; |
| 912 | + $now = wfTime(); |
| 913 | + $elapsed = $now - $wgRequestTime; |
914 | 914 | |
915 | | - return $wgShowHostnames |
916 | | - ? sprintf( "<!-- Served by %s in %01.3f secs. -->", wfHostname(), $elapsed ) |
917 | | - : sprintf( "<!-- Served in %01.3f secs. -->", $elapsed ); |
918 | | - } |
| 915 | + return $wgShowHostnames |
| 916 | + ? sprintf( "<!-- Served by %s in %01.3f secs. -->", wfHostname(), $elapsed ) |
| 917 | + : sprintf( "<!-- Served in %01.3f secs. -->", $elapsed ); |
| 918 | +} |
919 | 919 | |
920 | 920 | /** |
921 | 921 | * Safety wrapper for debug_backtrace(). |
— | — | @@ -1022,11 +1022,11 @@ |
1023 | 1023 | |
1024 | 1024 | /** |
1025 | 1025 | * Generate (prev x| next x) (20|50|100...) type links for paging |
1026 | | - * @param $offset string |
1027 | | - * @param $limit int |
1028 | | - * @param $link string |
1029 | | - * @param $query string, optional URL query parameter string |
1030 | | - * @param $atend bool, optional param for specified if this is the last page |
| 1026 | + * @param $offset String |
| 1027 | + * @param $limit Integer |
| 1028 | + * @param $link String |
| 1029 | + * @param $query String: optional URL query parameter string |
| 1030 | + * @param $atend Bool: optional param for specified if this is the last page |
1031 | 1031 | */ |
1032 | 1032 | function wfViewPrevNext( $offset, $limit, $link, $query = '', $atend = false ) { |
1033 | 1033 | global $wgLang; |
— | — | @@ -1083,10 +1083,10 @@ |
1084 | 1084 | |
1085 | 1085 | /** |
1086 | 1086 | * Generate links for (20|50|100...) items-per-page links |
1087 | | - * @param $offset string |
1088 | | - * @param $limit int |
| 1087 | + * @param $offset String |
| 1088 | + * @param $limit Integer |
1089 | 1089 | * @param $title Title |
1090 | | - * @param $query string, optional URL query parameter string |
| 1090 | + * @param $query String: optional URL query parameter string |
1091 | 1091 | */ |
1092 | 1092 | function wfNumLink( $offset, $limit, $title, $query = '' ) { |
1093 | 1093 | global $wgLang; |
— | — | @@ -1147,7 +1147,7 @@ |
1148 | 1148 | * not filter out characters which have special meaning only at the |
1149 | 1149 | * start of a line, such as "*". |
1150 | 1150 | * |
1151 | | - * @param string $text Text to be escaped |
| 1151 | + * @param $text String: text to be escaped |
1152 | 1152 | */ |
1153 | 1153 | function wfEscapeWikiText( $text ) { |
1154 | 1154 | $text = str_replace( |
— | — | @@ -1258,7 +1258,7 @@ |
1259 | 1259 | * arrays. Of course, keys and values are urldecode()d. Don't try passing in- |
1260 | 1260 | * valid query strings, or it will explode. |
1261 | 1261 | * |
1262 | | - * @param $query string Query string |
| 1262 | + * @param $query String: query string |
1263 | 1263 | * @return array Array version of input |
1264 | 1264 | */ |
1265 | 1265 | function wfCgiToArray( $query ) { |
— | — | @@ -1283,8 +1283,8 @@ |
1284 | 1284 | * Append a query string to an existing URL, which may or may not already |
1285 | 1285 | * have query string parameters already. If so, they will be combined. |
1286 | 1286 | * |
1287 | | - * @param string $url |
1288 | | - * @param mixed $query String or associative array |
| 1287 | + * @param $url String |
| 1288 | + * @param $query Mixed: string or associative array |
1289 | 1289 | * @return string |
1290 | 1290 | */ |
1291 | 1291 | function wfAppendQuery( $url, $query ) { |
— | — | @@ -1305,7 +1305,7 @@ |
1306 | 1306 | /** |
1307 | 1307 | * Expand a potentially local URL to a fully-qualified URL. |
1308 | 1308 | * Assumes $wgServer is correct. :) |
1309 | | - * @param string $url, either fully-qualified or a local path + query |
| 1309 | + * @param $url String: either fully-qualified or a local path + query |
1310 | 1310 | * @return string Fully-qualified URL |
1311 | 1311 | */ |
1312 | 1312 | function wfExpandUrl( $url ) { |
— | — | @@ -1440,10 +1440,10 @@ |
1441 | 1441 | /** |
1442 | 1442 | * Returns unified plain-text diff of two texts. |
1443 | 1443 | * Useful for machine processing of diffs. |
1444 | | - * @param $before string The text before the changes. |
1445 | | - * @param $after string The text after the changes. |
1446 | | - * @param $params string Command-line options for the diff command. |
1447 | | - * @return string Unified diff of $before and $after |
| 1444 | + * @param $before String: the text before the changes. |
| 1445 | + * @param $after String: the text after the changes. |
| 1446 | + * @param $params String: command-line options for the diff command. |
| 1447 | + * @return String: unified diff of $before and $after |
1448 | 1448 | */ |
1449 | 1449 | function wfDiff( $before, $after, $params = '-u' ) { |
1450 | 1450 | if ($before == $after) { |
— | — | @@ -1555,7 +1555,7 @@ |
1556 | 1556 | * Note that some PHP configuration options may add output buffer |
1557 | 1557 | * layers which cannot be removed; these are left in place. |
1558 | 1558 | * |
1559 | | - * @param bool $resetGzipEncoding |
| 1559 | + * @param $resetGzipEncoding Bool |
1560 | 1560 | */ |
1561 | 1561 | function wfResetOutputBuffers( $resetGzipEncoding=true ) { |
1562 | 1562 | if( $resetGzipEncoding ) { |
— | — | @@ -1640,8 +1640,8 @@ |
1641 | 1641 | * Returns the matching MIME type (or wildcard) if a match, otherwise |
1642 | 1642 | * NULL if no match. |
1643 | 1643 | * |
1644 | | - * @param string $type |
1645 | | - * @param array $avail |
| 1644 | + * @param $type String |
| 1645 | + * @param $avail Array |
1646 | 1646 | * @return string |
1647 | 1647 | * @private |
1648 | 1648 | */ |
— | — | @@ -1666,8 +1666,8 @@ |
1667 | 1667 | * array of type to preference (preference is a float between 0.0 and 1.0). |
1668 | 1668 | * Wildcards in the types are acceptable. |
1669 | 1669 | * |
1670 | | - * @param array $cprefs Client's acceptable type list |
1671 | | - * @param array $sprefs Server's offered types |
| 1670 | + * @param $cprefs Array: client's acceptable type list |
| 1671 | + * @param $sprefs Array: server's offered types |
1672 | 1672 | * @return string |
1673 | 1673 | * |
1674 | 1674 | * @todo FIXME: doesn't handle params like 'text/plain; charset=UTF-8' |
— | — | @@ -1812,12 +1812,13 @@ |
1813 | 1813 | define('TS_DB2', 8); |
1814 | 1814 | |
1815 | 1815 | /** |
1816 | | - * @param mixed $outputtype A timestamp in one of the supported formats, the |
1817 | | - * function will autodetect which format is supplied |
1818 | | - * and act accordingly. |
1819 | | - * @return string Time in the format specified in $outputtype |
| 1816 | + * @param $outputtype Mixed: A timestamp in one of the supported formats, the |
| 1817 | + * function will autodetect which format is supplied and act |
| 1818 | + * accordingly. |
| 1819 | + * @param $ts Mixed: the timestamp to convert or 0 for the current timestamp |
| 1820 | + * @return String: in the format specified in $outputtype |
1820 | 1821 | */ |
1821 | | -function wfTimestamp($outputtype=TS_UNIX,$ts=0) { |
| 1822 | +function wfTimestamp( $outputtype = TS_UNIX, $ts = 0 ) { |
1822 | 1823 | $uts = 0; |
1823 | 1824 | $da = array(); |
1824 | 1825 | if ($ts==0) { |
— | — | @@ -1883,9 +1884,9 @@ |
1884 | 1885 | /** |
1885 | 1886 | * Return a formatted timestamp, or null if input is null. |
1886 | 1887 | * For dealing with nullable timestamp columns in the database. |
1887 | | - * @param int $outputtype |
1888 | | - * @param string $ts |
1889 | | - * @return string |
| 1888 | + * @param $outputtype Integer |
| 1889 | + * @param $ts String |
| 1890 | + * @return String |
1890 | 1891 | */ |
1891 | 1892 | function wfTimestampOrNull( $outputtype = TS_UNIX, $ts = null ) { |
1892 | 1893 | if( is_null( $ts ) ) { |
— | — | @@ -1898,7 +1899,7 @@ |
1899 | 1900 | /** |
1900 | 1901 | * Check if the operating system is Windows |
1901 | 1902 | * |
1902 | | - * @return bool True if it's Windows, False otherwise. |
| 1903 | + * @return Bool: true if it's Windows, False otherwise. |
1903 | 1904 | */ |
1904 | 1905 | function wfIsWindows() { |
1905 | 1906 | if (substr(php_uname(), 0, 7) == 'Windows') { |
— | — | @@ -2033,7 +2034,7 @@ |
2034 | 2035 | * NOTE: When possible, use the tempfile() function to create temporary |
2035 | 2036 | * files to avoid race conditions on file creation, etc. |
2036 | 2037 | * |
2037 | | - * @return string |
| 2038 | + * @return String |
2038 | 2039 | */ |
2039 | 2040 | function wfTempDir() { |
2040 | 2041 | foreach( array( 'TMPDIR', 'TMP', 'TEMP' ) as $var ) { |
— | — | @@ -2049,9 +2050,9 @@ |
2050 | 2051 | /** |
2051 | 2052 | * Make directory, and make all parent directories if they don't exist |
2052 | 2053 | * |
2053 | | - * @param string $dir Full path to directory to create |
2054 | | - * @param int $mode Chmod value to use, default is $wgDirectoryMode |
2055 | | - * @param string $caller Optional caller param for debugging. |
| 2054 | + * @param $dir String: full path to directory to create |
| 2055 | + * @param $mode Integer: chmod value to use, default is $wgDirectoryMode |
| 2056 | + * @param $caller String: optional caller param for debugging. |
2056 | 2057 | * @return bool |
2057 | 2058 | */ |
2058 | 2059 | function wfMkdirParents( $dir, $mode = null, $caller = null ) { |
— | — | @@ -2100,9 +2101,9 @@ |
2101 | 2102 | } |
2102 | 2103 | |
2103 | 2104 | /** |
2104 | | - * @param mixed $nr The number to format |
2105 | | - * @param int $acc The number of digits after the decimal point, default 2 |
2106 | | - * @param bool $round Whether or not to round the value, default true |
| 2105 | + * @param $nr Mixed: the number to format |
| 2106 | + * @param $acc Integer: the number of digits after the decimal point, default 2 |
| 2107 | + * @param $round Boolean: whether or not to round the value, default true |
2107 | 2108 | * @return float |
2108 | 2109 | */ |
2109 | 2110 | function wfPercent( $nr, $acc = 2, $round = true ) { |
— | — | @@ -2113,9 +2114,9 @@ |
2114 | 2115 | /** |
2115 | 2116 | * Encrypt a username/password. |
2116 | 2117 | * |
2117 | | - * @param string $userid ID of the user |
2118 | | - * @param string $password Password of the user |
2119 | | - * @return string Hashed password |
| 2118 | + * @param $userid Integer: ID of the user |
| 2119 | + * @param $password String: password of the user |
| 2120 | + * @return String: hashed password |
2120 | 2121 | * @deprecated Use User::crypt() or User::oldCrypt() instead |
2121 | 2122 | */ |
2122 | 2123 | function wfEncryptPassword( $userid, $password ) { |
— | — | @@ -2141,9 +2142,9 @@ |
2142 | 2143 | * looked up didn't exist but a XHTML string, this function checks for the |
2143 | 2144 | * nonexistance of messages by looking at wfMsg() output |
2144 | 2145 | * |
2145 | | - * @param $msg The message key looked up |
2146 | | - * @param $wfMsgOut The output of wfMsg*() |
2147 | | - * @return bool |
| 2146 | + * @param $msg String: the message key looked up |
| 2147 | + * @param $wfMsgOut String: the output of wfMsg*() |
| 2148 | + * @return Boolean |
2148 | 2149 | */ |
2149 | 2150 | function wfEmptyMsg( $msg, $wfMsgOut ) { |
2150 | 2151 | return $wfMsgOut === htmlspecialchars( "<$msg>" ); |
— | — | @@ -2152,9 +2153,9 @@ |
2153 | 2154 | /** |
2154 | 2155 | * Find out whether or not a mixed variable exists in a string |
2155 | 2156 | * |
2156 | | - * @param mixed needle |
2157 | | - * @param string haystack |
2158 | | - * @return bool |
| 2157 | + * @param $needle String |
| 2158 | + * @param $str String |
| 2159 | + * @return Boolean |
2159 | 2160 | */ |
2160 | 2161 | function in_string( $needle, $str ) { |
2161 | 2162 | return strpos( $str, $needle ) !== false; |
— | — | @@ -2169,7 +2170,7 @@ |
2170 | 2171 | /** |
2171 | 2172 | * Returns a regular expression of url protocols |
2172 | 2173 | * |
2173 | | - * @return string |
| 2174 | + * @return String |
2174 | 2175 | */ |
2175 | 2176 | function wfUrlProtocols() { |
2176 | 2177 | global $wgUrlProtocols; |
— | — | @@ -2207,8 +2208,8 @@ |
2208 | 2209 | * |
2209 | 2210 | * I frickin' hate PHP... :P |
2210 | 2211 | * |
2211 | | - * @param string $setting |
2212 | | - * @return bool |
| 2212 | + * @param $setting String |
| 2213 | + * @return Bool |
2213 | 2214 | */ |
2214 | 2215 | function wfIniGetBool( $setting ) { |
2215 | 2216 | $val = ini_get( $setting ); |
— | — | @@ -2281,10 +2282,11 @@ |
2282 | 2283 | } |
2283 | 2284 | return $output; |
2284 | 2285 | } |
| 2286 | + |
2285 | 2287 | /** |
2286 | 2288 | * Executes a shell command in the background. Passes back the PID of the operation |
2287 | 2289 | * |
2288 | | - * @param string $cmd |
| 2290 | + * @param $cmd String |
2289 | 2291 | */ |
2290 | 2292 | function wfShellBackgroundExec( $cmd ){ |
2291 | 2293 | wfDebug( "wfShellBackgroundExec: $cmd\n" ); |
— | — | @@ -2296,6 +2298,7 @@ |
2297 | 2299 | $pid = shell_exec( "nohup $cmd > /dev/null & echo $!" ); |
2298 | 2300 | return $pid; |
2299 | 2301 | } |
| 2302 | + |
2300 | 2303 | /** |
2301 | 2304 | * Checks if the current instance can execute a shell command |
2302 | 2305 | * |
— | — | @@ -2314,6 +2317,7 @@ |
2315 | 2318 | } |
2316 | 2319 | return true; |
2317 | 2320 | } |
| 2321 | + |
2318 | 2322 | /** |
2319 | 2323 | * Workaround for http://bugs.php.net/bug.php?id=45132 |
2320 | 2324 | * escapeshellarg() destroys non-ASCII characters if LANG is not a UTF-8 locale |
— | — | @@ -2341,8 +2345,8 @@ |
2342 | 2346 | * |
2343 | 2347 | * @see perldoc -f use |
2344 | 2348 | * |
2345 | | - * @param mixed $version The version to check, can be a string, an integer, or |
2346 | | - * a float |
| 2349 | + * @param $req_ver Mixed: the version to check, can be a string, an integer, or |
| 2350 | + * a float |
2347 | 2351 | */ |
2348 | 2352 | function wfUsePHP( $req_ver ) { |
2349 | 2353 | $php_ver = PHP_VERSION; |
— | — | @@ -2361,8 +2365,8 @@ |
2362 | 2366 | * |
2363 | 2367 | * @see perldoc -f use |
2364 | 2368 | * |
2365 | | - * @param mixed $version The version to check, can be a string, an integer, or |
2366 | | - * a float |
| 2369 | + * @param $req_ver Mixed: the version to check, can be a string, an integer, or |
| 2370 | + * a float |
2367 | 2371 | */ |
2368 | 2372 | function wfUseMW( $req_ver ) { |
2369 | 2373 | global $wgVersion; |
— | — | @@ -2386,9 +2390,9 @@ |
2387 | 2391 | * PHP's basename() only considers '\' a pathchar on Windows and Netware. |
2388 | 2392 | * We'll consider it so always, as we don't want \s in our Unix paths either. |
2389 | 2393 | * |
2390 | | - * @param string $path |
2391 | | - * @param string $suffix to remove if present |
2392 | | - * @return string |
| 2394 | + * @param $path String |
| 2395 | + * @param $suffix String: to remove if present |
| 2396 | + * @return String |
2393 | 2397 | */ |
2394 | 2398 | function wfBaseName( $path, $suffix='' ) { |
2395 | 2399 | $encSuffix = ($suffix == '') |
— | — | @@ -2407,9 +2411,9 @@ |
2408 | 2412 | * May explode on non-matching case-insensitive paths, |
2409 | 2413 | * funky symlinks, etc. |
2410 | 2414 | * |
2411 | | - * @param string $path Absolute destination path including target filename |
2412 | | - * @param string $from Absolute source path, directory only |
2413 | | - * @return string |
| 2415 | + * @param $path String: absolute destination path including target filename |
| 2416 | + * @param $from String: Absolute source path, directory only |
| 2417 | + * @return String |
2414 | 2418 | */ |
2415 | 2419 | function wfRelativePath( $path, $from ) { |
2416 | 2420 | // Normalize mixed input on Windows... |
— | — | @@ -2451,8 +2455,9 @@ |
2452 | 2456 | * Backwards array plus for people who haven't bothered to read the PHP manual |
2453 | 2457 | * XXX: will not darn your socks for you. |
2454 | 2458 | * |
2455 | | - * @param array $array1, [$array2, [...]] |
2456 | | - * @return array |
| 2459 | + * @param $array1 Array |
| 2460 | + * @param [$array2, [...]] Arrays |
| 2461 | + * @return Array |
2457 | 2462 | */ |
2458 | 2463 | function wfArrayMerge( $array1/* ... */ ) { |
2459 | 2464 | $args = func_get_args(); |
— | — | @@ -2499,8 +2504,8 @@ |
2500 | 2505 | * 2) Handles protocols that don't use :// (e.g., mailto: and news:) correctly |
2501 | 2506 | * 3) Adds a "delimiter" element to the array, either '://' or ':' (see (2)) |
2502 | 2507 | * |
2503 | | - * @param string $url A URL to parse |
2504 | | - * @return array Bits of the URL in an associative array, per PHP docs |
| 2508 | + * @param $url String: a URL to parse |
| 2509 | + * @return Array: bits of the URL in an associative array, per PHP docs |
2505 | 2510 | */ |
2506 | 2511 | function wfParseUrl( $url ) { |
2507 | 2512 | global $wgUrlProtocols; // Allow all protocols defined in DefaultSettings/LocalSettings.php |
— | — | @@ -2600,12 +2605,12 @@ |
2601 | 2606 | * Supports base 2 through 36; digit values 10-36 are represented |
2602 | 2607 | * as lowercase letters a-z. Input is case-insensitive. |
2603 | 2608 | * |
2604 | | - * @param $input string of digits |
2605 | | - * @param $sourceBase int 2-36 |
2606 | | - * @param $destBase int 2-36 |
2607 | | - * @param $pad int 1 or greater |
2608 | | - * @param $lowercase bool |
2609 | | - * @return string or false on invalid input |
| 2609 | + * @param $input String: of digits |
| 2610 | + * @param $sourceBase Integer: 2-36 |
| 2611 | + * @param $destBase Integer: 2-36 |
| 2612 | + * @param $pad Integer: 1 or greater |
| 2613 | + * @param $lowercase Boolean |
| 2614 | + * @return String or false on invalid input |
2610 | 2615 | */ |
2611 | 2616 | function wfBaseConvert( $input, $sourceBase, $destBase, $pad=1, $lowercase=true ) { |
2612 | 2617 | $input = strval( $input ); |
— | — | @@ -2682,8 +2687,8 @@ |
2683 | 2688 | |
2684 | 2689 | /** |
2685 | 2690 | * Create an object with a given name and an array of construct parameters |
2686 | | - * @param string $name |
2687 | | - * @param array $p parameters |
| 2691 | + * @param $name String |
| 2692 | + * @param $p Array: parameters |
2688 | 2693 | */ |
2689 | 2694 | function wfCreateObject( $name, $p ){ |
2690 | 2695 | $p = array_values( $p ); |
— | — | @@ -2781,7 +2786,7 @@ |
2782 | 2787 | /** |
2783 | 2788 | * Get an object from the precompiled serialized directory |
2784 | 2789 | * |
2785 | | - * @return mixed The variable on success, false on failure |
| 2790 | + * @return Mixed: the variable on success, false on failure |
2786 | 2791 | */ |
2787 | 2792 | function wfGetPrecompiledData( $name ) { |
2788 | 2793 | global $IP; |
— | — | @@ -2806,12 +2811,17 @@ |
2807 | 2812 | return $caller; |
2808 | 2813 | } |
2809 | 2814 | |
2810 | | -/** Return a string consisting all callers in stack, somewhat useful sometimes for profiling specific points */ |
| 2815 | +/** |
| 2816 | + * Return a string consisting all callers in stack, somewhat useful sometimes |
| 2817 | + * for profiling specific points |
| 2818 | + */ |
2811 | 2819 | function wfGetAllCallers() { |
2812 | 2820 | return implode('/', array_map('wfFormatStackFrame',array_reverse(wfDebugBacktrace()))); |
2813 | 2821 | } |
2814 | 2822 | |
2815 | | -/** Return a string representation of frame */ |
| 2823 | +/** |
| 2824 | + * Return a string representation of frame |
| 2825 | + */ |
2816 | 2826 | function wfFormatStackFrame($frame) { |
2817 | 2827 | return isset( $frame["class"] )? |
2818 | 2828 | $frame["class"]."::".$frame["function"]: |
— | — | @@ -2866,15 +2876,15 @@ |
2867 | 2877 | |
2868 | 2878 | /* |
2869 | 2879 | * Get a Database object. |
2870 | | - * @param integer $db Index of the connection to get. May be DB_MASTER for the |
2871 | | - * master (for write queries), DB_SLAVE for potentially lagged |
2872 | | - * read queries, or an integer >= 0 for a particular server. |
| 2880 | + * @param $db Integer: index of the connection to get. May be DB_MASTER for the |
| 2881 | + * master (for write queries), DB_SLAVE for potentially lagged read |
| 2882 | + * queries, or an integer >= 0 for a particular server. |
2873 | 2883 | * |
2874 | | - * @param mixed $groups Query groups. An array of group names that this query |
2875 | | - * belongs to. May contain a single string if the query is only |
2876 | | - * in one group. |
| 2884 | + * @param $groups Mixed: query groups. An array of group names that this query |
| 2885 | + * belongs to. May contain a single string if the query is only |
| 2886 | + * in one group. |
2877 | 2887 | * |
2878 | | - * @param string $wiki The wiki ID, or false for the current wiki |
| 2888 | + * @param $wiki String: the wiki ID, or false for the current wiki |
2879 | 2889 | * |
2880 | 2890 | * Note: multiple calls to wfGetDB(DB_SLAVE) during the course of one request |
2881 | 2891 | * will always return the same object, unless the underlying connection or load |
— | — | @@ -2887,8 +2897,7 @@ |
2888 | 2898 | /** |
2889 | 2899 | * Get a load balancer object. |
2890 | 2900 | * |
2891 | | - * @param array $groups List of query groups |
2892 | | - * @param string $wiki Wiki ID, or false for the current wiki |
| 2901 | + * @param $wiki String: wiki ID, or false for the current wiki |
2893 | 2902 | * @return LoadBalancer |
2894 | 2903 | */ |
2895 | 2904 | function wfGetLB( $wiki = false ) { |
— | — | @@ -2905,12 +2914,12 @@ |
2906 | 2915 | /** |
2907 | 2916 | * Find a file. |
2908 | 2917 | * Shortcut for RepoGroup::singleton()->findFile() |
2909 | | - * @param mixed $title Title object or string. May be interwiki. |
2910 | | - * @param mixed $time Requested time for an archived image, or false for the |
2911 | | - * current version. An image object will be returned which |
2912 | | - * was created at the specified time. |
2913 | | - * @param mixed $flags FileRepo::FIND_ flags |
2914 | | - * @param boolean $bypass Bypass the file cache even if it could be used |
| 2918 | + * @param $title Title object or string. May be interwiki. |
| 2919 | + * @param $time Mixed: requested time for an archived image, or false for the |
| 2920 | + * current version. An image object will be returned which was |
| 2921 | + * created at the specified time. |
| 2922 | + * @param $flags Mixed: FileRepo::FIND_ flags |
| 2923 | + * @param $bypass Boolean: bypass the file cache even if it could be used |
2915 | 2924 | * @return File, or false if the file does not exist |
2916 | 2925 | */ |
2917 | 2926 | function wfFindFile( $title, $time = false, $flags = 0, $bypass = false ) { |
— | — | @@ -2932,7 +2941,7 @@ |
2933 | 2942 | /** |
2934 | 2943 | * Should low-performance queries be disabled? |
2935 | 2944 | * |
2936 | | - * @return bool |
| 2945 | + * @return Boolean |
2937 | 2946 | */ |
2938 | 2947 | function wfQueriesMustScale() { |
2939 | 2948 | global $wgMiserMode; |
— | — | @@ -2946,8 +2955,8 @@ |
2947 | 2956 | * Get the path to a specified script file, respecting file |
2948 | 2957 | * extensions; this is a wrapper around $wgScriptExtension etc. |
2949 | 2958 | * |
2950 | | - * @param string $script Script filename, sans extension |
2951 | | - * @return string |
| 2959 | + * @param $script String: script filename, sans extension |
| 2960 | + * @return String |
2952 | 2961 | */ |
2953 | 2962 | function wfScript( $script = 'index' ) { |
2954 | 2963 | global $wgScriptPath, $wgScriptExtension; |
— | — | @@ -2980,8 +2989,8 @@ |
2981 | 2990 | * Convenience function converts boolean values into "true" |
2982 | 2991 | * or "false" (string) values |
2983 | 2992 | * |
2984 | | - * @param bool $value |
2985 | | - * @return string |
| 2993 | + * @param $value Boolean |
| 2994 | + * @return String |
2986 | 2995 | */ |
2987 | 2996 | function wfBoolToStr( $value ) { |
2988 | 2997 | return $value ? 'true' : 'false'; |
— | — | @@ -3009,9 +3018,9 @@ |
3010 | 3019 | /** |
3011 | 3020 | * Displays a maxlag error |
3012 | 3021 | * |
3013 | | - * @param string $host Server that lags the most |
3014 | | - * @param int $lag Maxlag (actual) |
3015 | | - * @param int $maxLag Maxlag (requested) |
| 3022 | + * @param $host String: server that lags the most |
| 3023 | + * @param $lag Integer: maxlag (actual) |
| 3024 | + * @param $maxLag Integer: maxlag (requested) |
3016 | 3025 | */ |
3017 | 3026 | function wfMaxlagError( $host, $lag, $maxLag ) { |
3018 | 3027 | global $wgShowHostnames; |
— | — | @@ -3028,7 +3037,7 @@ |
3029 | 3038 | |
3030 | 3039 | /** |
3031 | 3040 | * Throws a warning that $function is deprecated |
3032 | | - * @param string $function |
| 3041 | + * @param $function String |
3033 | 3042 | * @return null |
3034 | 3043 | */ |
3035 | 3044 | function wfDeprecated( $function ) { |
— | — | @@ -3074,7 +3083,7 @@ |
3075 | 3084 | * that effect (and then sleep for a little while), so it's probably not best |
3076 | 3085 | * to use this outside maintenance scripts in its present form. |
3077 | 3086 | * |
3078 | | - * @param int $maxLag |
| 3087 | + * @param $maxLag Integer |
3079 | 3088 | * @return null |
3080 | 3089 | */ |
3081 | 3090 | function wfWaitForSlaves( $maxLag ) { |
— | — | @@ -3127,7 +3136,8 @@ |
3128 | 3137 | } |
3129 | 3138 | |
3130 | 3139 | /** Generate a random 32-character hexadecimal token. |
3131 | | - * @param mixed $salt Some sort of salt, if necessary, to add to random characters before hashing. |
| 3140 | + * @param $salt Mixed: some sort of salt, if necessary, to add to random |
| 3141 | + * characters before hashing. |
3132 | 3142 | */ |
3133 | 3143 | function wfGenerateToken( $salt = '' ) { |
3134 | 3144 | $salt = serialize($salt); |
— | — | @@ -3137,7 +3147,7 @@ |
3138 | 3148 | |
3139 | 3149 | /** |
3140 | 3150 | * Replace all invalid characters with - |
3141 | | - * @param mixed $title Filename to process |
| 3151 | + * @param $name Mixed: filename to process |
3142 | 3152 | */ |
3143 | 3153 | function wfStripIllegalFilenameChars( $name ) { |
3144 | 3154 | $name = wfBaseName( $name ); |
— | — | @@ -3146,11 +3156,11 @@ |
3147 | 3157 | } |
3148 | 3158 | |
3149 | 3159 | /** |
3150 | | - * Insert array into another array after the specified *KEY* |
3151 | | - * @param array $array The array. |
3152 | | - * @param array $insert The array to insert. |
3153 | | - * @param mixed $after The key to insert after |
3154 | | - */ |
| 3160 | + * Insert array into another array after the specified *KEY* |
| 3161 | + * @param $array Array: The array. |
| 3162 | + * @param $insert Array: The array to insert. |
| 3163 | + * @param $after Mixed: The key to insert after |
| 3164 | + */ |
3155 | 3165 | function wfArrayInsertAfter( $array, $insert, $after ) { |
3156 | 3166 | // Find the offset of the element to insert after. |
3157 | 3167 | $keys = array_keys($array); |