@@ -41,7 +41,7 @@ |
||
| 41 | 41 | |
| 42 | 42 | function test_encoding($path) |
| 43 | 43 | { |
| 44 | - static $ur_exclude = [ // no unicode reminder needed |
|
| 44 | + static $ur_exclude = [// no unicode reminder needed |
|
| 45 | 45 | 'lang/de/ocstyle/search1/search.result.caches', |
| 46 | 46 | 'lib2/b2evo-captcha', |
| 47 | 47 | 'lib2/HTMLPurifier', |
@@ -39,6 +39,9 @@ |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
| 42 | +/** |
|
| 43 | + * @param string $path |
|
| 44 | + */ |
|
| 42 | 45 | function testforbom($path) |
| 43 | 46 | { |
| 44 | 47 | $filestart = file_get_contents($path, false, null, 0, 2); |
@@ -108,19 +108,19 @@ discard block |
||
| 108 | 108 | && !preg_match("/^ *(\\*|\/\/|#) *\n$/", $line)) { |
| 109 | 109 | |
| 110 | 110 | $old_line = $line; |
| 111 | - $line = rtrim($line); # trims " \t\n\r\0\x0B" |
|
| 111 | + $line = rtrim($line); # trims " \t\n\r\0\x0B" |
|
| 112 | 112 | $line = $this->expandTabs($line); |
| 113 | 113 | $line .= "\n"; |
| 114 | 114 | |
| 115 | 115 | if ($line != $old_line) { |
| 116 | 116 | $file_modified = true; |
| 117 | - ++ $this->lines_modified; |
|
| 117 | + ++$this->lines_modified; |
|
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | if (preg_match('/\<\?\s/', $line)) { # relies on \n at EOL |
| 121 | 121 | self::warn('short open tag in line ' . $n . ' of ' . $display_filepath); |
| 122 | 122 | } |
| 123 | - ++ $n; |
|
| 123 | + ++$n; |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | # remove PHP close tags and empty lines from end of file |
@@ -131,17 +131,17 @@ discard block |
||
| 131 | 131 | if ($trimmed_line == '?>' || $trimmed_line == '') { |
| 132 | 132 | unset($lines[$l]); |
| 133 | 133 | $file_modified = true; |
| 134 | - ++ $this->lines_modified; |
|
| 134 | + ++$this->lines_modified; |
|
| 135 | 135 | } else { |
| 136 | 136 | break; |
| 137 | 137 | } |
| 138 | - -- $l; |
|
| 138 | + --$l; |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | if ($file_modified) { |
| 142 | 142 | echo 'cleaned ' . substr($filepath, 2) . "\n"; |
| 143 | 143 | file_put_contents($filepath, implode('', $lines)); |
| 144 | - ++ $this->files_modified; |
|
| 144 | + ++$this->files_modified; |
|
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | 147 | |
@@ -31,9 +31,9 @@ |
||
| 31 | 31 | $lang |
| 32 | 32 | ); |
| 33 | 33 | } |
| 34 | - ++ $set; |
|
| 34 | + ++$set; |
|
| 35 | 35 | } |
| 36 | - if (++ $processed % 1000 == 0) { |
|
| 36 | + if (++$processed % 1000 == 0) { |
|
| 37 | 37 | echo "$set of $processed " . ($write ? '' : 'would be ') . "set\n"; |
| 38 | 38 | } |
| 39 | 39 | } |
@@ -101,7 +101,7 @@ |
||
| 101 | 101 | "SELECT COUNT(*) |
| 102 | 102 | FROM `" . $table . "` |
| 103 | 103 | WHERE " . $this->getDateCondition($table, $dateField) . |
| 104 | - ($andWhere ? ' AND (' . $andWhere . ')' : ''), |
|
| 104 | + ($andWhere ? ' AND (' . $andWhere . ')' : ''), |
|
| 105 | 105 | 0 |
| 106 | 106 | ); |
| 107 | 107 | self::message(1, $objectCount . ' ' . $description); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $er->resendActivationCodes(); |
| 53 | 53 | break; |
| 54 | 54 | default: |
| 55 | - die('invalid option: '. $option . "\n"); |
|
| 55 | + die('invalid option: ' . $option . "\n"); |
|
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | while ($r = sql_fetch_assoc($rs)) { |
| 298 | 298 | $user = new user($r['user_id']); |
| 299 | 299 | $user->sendRegistrationCode(); |
| 300 | - ++ $n; |
|
| 300 | + ++$n; |
|
| 301 | 301 | } |
| 302 | 302 | sql_free_result($rs); |
| 303 | 303 | self::message(0, $n . ' users have been re-sent the activation code'); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | $year = substr($cache['date_created'], 0, 4); |
| 27 | 27 | if ($year >= 2005 && $year <= date("Y") && ($lat != 0 || $long != 0)) { |
| 28 | 28 | $years[$year] = true; |
| 29 | - $liste[$lat][$long]["caches"][$year] ++; |
|
| 29 | + $liste[$lat][$long]["caches"][$year]++; |
|
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | mysql_free_result($rs); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $year = substr($cache["date"], 0, 4); |
| 51 | 51 | if ($year >= 2005 && $year <= date("Y") && ($lat != 0 || $long != 0)) { |
| 52 | 52 | $years[$year] = true; |
| 53 | - $liste[$lat][$long]["logs"][$year] ++; |
|
| 53 | + $liste[$lat][$long]["logs"][$year]++; |
|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | mysql_free_result($rs); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | while ($cache = sql_fetch_assoc($rs)) { |
| 68 | 68 | $lat = floor($cache["latitude"] / $grid); |
| 69 | 69 | $long = floor($cache["longitude"] / $grid); |
| 70 | - $liste[$lat][$long]["caches"]["all"] ++; |
|
| 70 | + $liste[$lat][$long]["caches"]["all"]++; |
|
| 71 | 71 | $liste[$lat][$long]["logs"]["all"] += $cache["logs"]; |
| 72 | 72 | } |
| 73 | 73 | mysql_free_result($rs); |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | |
| 28 | 28 | // Sessions verwenden? |
| 29 | 29 | $opt['session'] = 1; |
| 30 | -$opt['zip'] = 'gzip'; // 0; zip; bzip2; gzip |
|
| 30 | +$opt['zip'] = 'gzip'; // 0; zip; bzip2; gzip |
|
| 31 | 31 | |
| 32 | 32 | // Gebietsauswahl nach Land |
| 33 | 33 | $opt['bycountry'] = 0; |
@@ -203,6 +203,9 @@ |
||
| 203 | 203 | return $str; |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | +/** |
|
| 207 | + * @param string $str |
|
| 208 | + */ |
|
| 206 | 209 | function lf2crlf($str) |
| 207 | 210 | { |
| 208 | 211 | return str_replace("\r\r\n", "\r\n", str_replace("\n", "\r\n", $str)); |
@@ -35,6 +35,9 @@ discard block |
||
| 35 | 35 | $this->init(0, 0); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | + /** |
|
| 39 | + * @param boolean $request |
|
| 40 | + */ |
|
| 38 | 41 | private function initRequest($request) |
| 39 | 42 | { |
| 40 | 43 | if ($request) { |
@@ -44,6 +47,9 @@ discard block |
||
| 44 | 47 | return new RequestHttp(); |
| 45 | 48 | } |
| 46 | 49 | |
| 50 | + /** |
|
| 51 | + * @param boolean $translator |
|
| 52 | + */ |
|
| 47 | 53 | private function initTranslator($translator) |
| 48 | 54 | { |
| 49 | 55 | if ($translator) { |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | |
| 19 | 19 | // database names |
| 20 | 20 | $dbname = 'opencaching'; |
| 21 | -$tmpdbname = 'octmp'; // empty db with CREATE and DROP privileges |
|
| 21 | +$tmpdbname = 'octmp'; // empty db with CREATE and DROP privileges |
|
| 22 | 22 | |
| 23 | 23 | // common developer system settings |
| 24 | 24 | require 'settings-dev.inc.php'; |