@@ -12,8 +12,8 @@ discard block |
||
12 | 12 | * Unicode Reminder メモ |
13 | 13 | ***************************************************************************/ |
14 | 14 | |
15 | -$opt['rootpath'] = __DIR__ . '/../../htdocs/'; |
|
16 | -require $opt['rootpath'] . 'lib2/cli.inc.php'; |
|
15 | +$opt['rootpath'] = __DIR__.'/../../htdocs/'; |
|
16 | +require $opt['rootpath'].'lib2/cli.inc.php'; |
|
17 | 17 | |
18 | 18 | $rs = sql( |
19 | 19 | "SELECT `id`, `cache_id`, `latitude`, `longitude` |
@@ -41,14 +41,14 @@ discard block |
||
41 | 41 | |
42 | 42 | if ($duplicates) { |
43 | 43 | if ($argc == 2 && $argv[1] == 'go') { |
44 | - echo 'deleting ' . count($duplicates) . " duplicate coordinate records\n"; |
|
44 | + echo 'deleting '.count($duplicates)." duplicate coordinate records\n"; |
|
45 | 45 | sql( |
46 | 46 | "DELETE FROM `cache_coordinates` |
47 | - WHERE `id` IN (" . implode(',', $duplicates) . ")" |
|
47 | + WHERE `id` IN (" . implode(',', $duplicates).")" |
|
48 | 48 | ); |
49 | 49 | } else { |
50 | 50 | echo |
51 | - count($duplicates) . ' duplicate coordinates found. ' . |
|
51 | + count($duplicates).' duplicate coordinates found. '. |
|
52 | 52 | "Add parameter 'go' to delete them.\n"; |
53 | 53 | } |
54 | 54 | } else { |
@@ -7,8 +7,8 @@ discard block |
||
7 | 7 | |
8 | 8 | header('Content-type: text/html; charset=utf-8'); |
9 | 9 | |
10 | -$opt['rootpath'] = __DIR__ . '/../../htdocs/'; |
|
11 | -require $opt['rootpath'] . 'lib2/web.inc.php'; |
|
10 | +$opt['rootpath'] = __DIR__.'/../../htdocs/'; |
|
11 | +require $opt['rootpath'].'lib2/web.inc.php'; |
|
12 | 12 | |
13 | 13 | $rs = sql( |
14 | 14 | 'SELECT email FROM `user` |
@@ -18,6 +18,6 @@ discard block |
||
18 | 18 | ORDER BY user_id DESC' |
19 | 19 | ); |
20 | 20 | while ($r = sql_fetch_assoc($rs)) { |
21 | - echo $r['email'] . "\n"; |
|
21 | + echo $r['email']."\n"; |
|
22 | 22 | } |
23 | 23 | sql_free_result($rs); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | $total = count($sendto); |
34 | 34 | $n = 0; |
35 | -echo 'sending email to ' . $total . ' of ' . count($addresses) . " recipients\n\n"; |
|
35 | +echo 'sending email to '.$total.' of '.count($addresses)." recipients\n\n"; |
|
36 | 36 | |
37 | 37 | $subject = '....'; |
38 | 38 | $from_adr = '[email protected]'; |
@@ -41,18 +41,18 @@ discard block |
||
41 | 41 | |
42 | 42 | foreach ($sendto as $receiver) { |
43 | 43 | $receiver = trim($receiver); |
44 | - echo ++ $n . "/$total: $receiver"; |
|
44 | + echo ++$n."/$total: $receiver"; |
|
45 | 45 | mail( |
46 | 46 | $receiver, |
47 | 47 | $subject, |
48 | 48 | $message, |
49 | - "From: $from_adr\r\n" . |
|
50 | - "MIME-Version: 1.0\r\n" . |
|
51 | - "Content-Type: text/plain; charset=iso-8859-1\r\n" . |
|
49 | + "From: $from_adr\r\n". |
|
50 | + "MIME-Version: 1.0\r\n". |
|
51 | + "Content-Type: text/plain; charset=iso-8859-1\r\n". |
|
52 | 52 | 'Content-Transfer-Encoding: 8bit' |
53 | 53 | ); |
54 | 54 | echo "\n"; |
55 | 55 | file_put_contents('sent.txt', "$receiver\n", FILE_APPEND); |
56 | 56 | } |
57 | 57 | |
58 | -echo 'Time needed: ' . (microtime(true) - $starttime) . "s\n"; |
|
58 | +echo 'Time needed: '.(microtime(true) - $starttime)."s\n"; |
@@ -9,12 +9,12 @@ discard block |
||
9 | 9 | * Unicode Reminder メモ |
10 | 10 | ***************************************************************************/ |
11 | 11 | |
12 | -$opt['rootpath'] = __DIR__ . '/../../htdocs/'; |
|
13 | -require_once $opt['rootpath'] . 'okapi-update-settings.inc.php'; |
|
12 | +$opt['rootpath'] = __DIR__.'/../../htdocs/'; |
|
13 | +require_once $opt['rootpath'].'okapi-update-settings.inc.php'; |
|
14 | 14 | |
15 | 15 | function git($args) |
16 | 16 | { |
17 | - return exec('git ' . $args); |
|
17 | + return exec('git '.$args); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | } |
40 | 40 | $changes = git('log upstream/master..master'); |
41 | 41 | if ($changes) { |
42 | - die("[okapi-update] there are unpushed local commits:\n" . $changes); |
|
42 | + die("[okapi-update] there are unpushed local commits:\n".$changes); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | echo "[okapi-update] ok.\n"; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | // fetch current OKAPI revision |
49 | 49 | |
50 | 50 | echo "[okapi-update] pulling and replicating OKAPI master\n"; |
51 | -echo git('pull ' . OKAPI_REMOTE . ' master') . "\n"; |
|
51 | +echo git('pull '.OKAPI_REMOTE.' master')."\n"; |
|
52 | 52 | $okapi_version_number = git('rev-list HEAD --count') + 318; |
53 | 53 | $okapi_git_revision = git('rev-parse HEAD'); |
54 | 54 | echo "OKAPI ver. $okapi_version_number\n"; |
@@ -59,26 +59,26 @@ discard block |
||
59 | 59 | passthru( |
60 | 60 | str_replace( |
61 | 61 | '%source', |
62 | - OKAPI_SOURCE_PATH . '/okapi', |
|
63 | - str_replace('%dest', $opt['rootpath'] . 'okapi', DIRECTORY_TREE_REPLICATOR) |
|
62 | + OKAPI_SOURCE_PATH.'/okapi', |
|
63 | + str_replace('%dest', $opt['rootpath'].'okapi', DIRECTORY_TREE_REPLICATOR) |
|
64 | 64 | ) |
65 | 65 | ); |
66 | -$core = file_get_contents($opt['rootpath'] . 'okapi/core.php'); |
|
66 | +$core = file_get_contents($opt['rootpath'].'okapi/core.php'); |
|
67 | 67 | $core = str_replace( |
68 | 68 | "\$version_number = null", |
69 | - "\$version_number = " . $okapi_version_number, |
|
69 | + "\$version_number = ".$okapi_version_number, |
|
70 | 70 | str_replace( |
71 | 71 | "\$git_revision = null", |
72 | - "\$git_revision = '" . $okapi_git_revision . "'", |
|
72 | + "\$git_revision = '".$okapi_git_revision."'", |
|
73 | 73 | $core |
74 | 74 | ) |
75 | 75 | ); |
76 | -file_put_contents($opt['rootpath'] . 'okapi/core.php', $core); |
|
76 | +file_put_contents($opt['rootpath'].'okapi/core.php', $core); |
|
77 | 77 | chdir($opt['rootpath']); |
78 | 78 | passthru('git status'); |
79 | 79 | |
80 | 80 | // commit changes to OC code |
81 | 81 | |
82 | 82 | echo "[okapi-update] committing to local OC Git repo\n"; |
83 | -echo git('add .') . "\n"; |
|
84 | -echo git('commit -m "OKAPI r' . $okapi_version_number . '"') . "\n"; |
|
83 | +echo git('add .')."\n"; |
|
84 | +echo git('commit -m "OKAPI r'.$okapi_version_number.'"')."\n"; |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | 'htdocs/vendor', |
35 | 35 | ); |
36 | 36 | |
37 | -chdir(__DIR__ . '/../..'); |
|
37 | +chdir(__DIR__.'/../..'); |
|
38 | 38 | |
39 | 39 | $cleanup = new StyleCleanup(); |
40 | 40 | $cleanup->run('.', $exclude); |
41 | 41 | |
42 | 42 | echo |
43 | - $cleanup->getLinesModified() . ' lines in ' . $cleanup->getFilesModified() . ' files' |
|
43 | + $cleanup->getLinesModified().' lines in '.$cleanup->getFilesModified().' files' |
|
44 | 44 | . " have been cleaned up\n"; |
45 | 45 | |
46 | 46 | |
@@ -80,8 +80,8 @@ discard block |
||
80 | 80 | # process files in $path |
81 | 81 | |
82 | 82 | $files = array_merge( |
83 | - glob($path . '/*.php'), |
|
84 | - glob($path . '/*.tpl') |
|
83 | + glob($path.'/*.php'), |
|
84 | + glob($path.'/*.tpl') |
|
85 | 85 | ); |
86 | 86 | |
87 | 87 | foreach ($files as $filepath) { |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | if (count($lines) && preg_match('/^(.+?)\<\?/', $lines[0], $matches)) { |
95 | 95 | self::warn( |
96 | - 'invalid character(s) "' . $matches[1] . '" at start of ' . $display_filepath |
|
96 | + 'invalid character(s) "'.$matches[1].'" at start of '.$display_filepath |
|
97 | 97 | ); |
98 | 98 | } |
99 | 99 | |
@@ -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 | - self::warn('short open tag in line ' . $n . ' of ' . $display_filepath); |
|
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,23 +131,23 @@ 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 | - echo 'cleaned ' . substr($filepath, 2) . "\n"; |
|
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 | |
148 | 148 | # process subdirectories in $path |
149 | 149 | |
150 | - $dirs = glob($path . '/*', GLOB_ONLYDIR); |
|
150 | + $dirs = glob($path.'/*', GLOB_ONLYDIR); |
|
151 | 151 | foreach ($dirs as $dir) { |
152 | 152 | if ($dir != '.' && $dir != '..') { |
153 | 153 | $this->cleanup($dir); |
@@ -170,6 +170,6 @@ discard block |
||
170 | 170 | |
171 | 171 | private static function warn($msg) |
172 | 172 | { |
173 | - echo '! ' . $msg . "\n"; |
|
173 | + echo '! '.$msg."\n"; |
|
174 | 174 | } |
175 | 175 | } |
@@ -117,7 +117,8 @@ |
||
117 | 117 | ++ $this->lines_modified; |
118 | 118 | } |
119 | 119 | } |
120 | - if (preg_match('/\<\?\s/', $line)) { # relies on \n at EOL |
|
120 | + if (preg_match('/\<\?\s/', $line)) { |
|
121 | +# relies on \n at EOL |
|
121 | 122 | self::warn('short open tag in line ' . $n . ' of ' . $display_filepath); |
122 | 123 | } |
123 | 124 | ++ $n; |
@@ -9,15 +9,15 @@ discard block |
||
9 | 9 | * Unicode Reminder メモ |
10 | 10 | ***************************************************************************/ |
11 | 11 | |
12 | -$opt['rootpath'] = __DIR__ . '/../../htdocs/'; |
|
13 | -require $opt['rootpath'] . 'lib2/cli.inc.php'; |
|
12 | +$opt['rootpath'] = __DIR__.'/../../htdocs/'; |
|
13 | +require $opt['rootpath'].'lib2/cli.inc.php'; |
|
14 | 14 | |
15 | 15 | if (!($opt['debug'] & DEBUG_DEVELOPER)) { |
16 | 16 | die("This script deletes lot of data and must be run only on development systems.\n"); |
17 | 17 | } |
18 | 18 | if ($argc != 2 || $argv[1] != 'go') { |
19 | 19 | die( |
20 | - "This script deletes lot of data. Make sure that you really want to dos this,\n" . |
|
20 | + "This script deletes lot of data. Make sure that you really want to dos this,\n". |
|
21 | 21 | "and confirm it by adding the parameter 'go'.\n" |
22 | 22 | ); |
23 | 23 | } |
@@ -63,11 +63,11 @@ discard block |
||
63 | 63 | echo "clearing user data\n"; |
64 | 64 | sql('TRUNCATE `cache_adoption`'); |
65 | 65 | sql('TRUNCATE `cache_ignore`'); |
66 | -sql('DELETE FROM `cache_lists` WHERE `is_public`<2'); // trigger deletes dependent data |
|
66 | +sql('DELETE FROM `cache_lists` WHERE `is_public`<2'); // trigger deletes dependent data |
|
67 | 67 | sql('TRUNCATE `cache_list_bookmarks`'); |
68 | 68 | sql('TRUNCATE `cache_list_watches`'); |
69 | 69 | sql('TRUNCATE `cache_watches`'); |
70 | -sql('DELETE FROM `coordinates` WHERE `type`=2'); // personal cache notes and coords |
|
70 | +sql('DELETE FROM `coordinates` WHERE `type`=2'); // personal cache notes and coords |
|
71 | 71 | sql('TRUNCATE `queries`'); |
72 | 72 | sql('TRUNCATE `user_options`'); |
73 | 73 | sql( |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | echo "\n"; |
113 | 113 | mysql_free_result($rs); |
114 | 114 | |
115 | -echo "clearing OKAPI data\n";; |
|
115 | +echo "clearing OKAPI data\n"; ; |
|
116 | 116 | if (sql_table_exists('okapi_vars')) { |
117 | 117 | echo "clearing OKAPI data\n"; |
118 | 118 | sql('TRUNCATE `okapi_authorizations`'); |
@@ -132,10 +132,10 @@ discard block |
||
132 | 132 | |
133 | 133 | echo "clearing other nonpublic data\n"; |
134 | 134 | sql('TRUNCATE `news`'); |
135 | -$rs = sql("SHOW TABLES WHERE `Tables_in_" . $opt['db']['placeholder']['db'] . "` LIKE '\_%'"); |
|
135 | +$rs = sql("SHOW TABLES WHERE `Tables_in_".$opt['db']['placeholder']['db']."` LIKE '\_%'"); |
|
136 | 136 | $tables = sql_fetch_column($rs); |
137 | 137 | foreach ($tables as $table) { |
138 | - sql('DROP TABLE ' . $table); |
|
138 | + sql('DROP TABLE '.$table); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | echo "done.\n"; |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $zipper['bzip2'] = 'nice --adjustment=19 bzip2 -1 -c {src} > {dst}'; |
21 | 21 | |
22 | 22 | if ($argv[1] == '--help') { |
23 | - echo $argv[0] . " --type=<ziptype> --src=<source> --dst=<destination> |
|
23 | + echo $argv[0]." --type=<ziptype> --src=<source> --dst=<destination> |
|
24 | 24 | --type can be zip, gzip or bzip2 |
25 | 25 | --src relative* path to source file |
26 | 26 | --dst relative* path to destination file |
@@ -36,11 +36,11 @@ discard block |
||
36 | 36 | 6 |
37 | 37 | ) != '--dst=') |
38 | 38 | ) { |
39 | - die("wrong paramter\nuse " . $argv[0] . " --help\n"); |
|
39 | + die("wrong paramter\nuse ".$argv[0]." --help\n"); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | if (isset($argv[4])) { |
43 | - die("wrong paramter\nuse " . $argv[0] . " --help\n"); |
|
43 | + die("wrong paramter\nuse ".$argv[0]." --help\n"); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | $type = substr($argv[1], 7); |
@@ -48,26 +48,26 @@ discard block |
||
48 | 48 | $dst = substr($argv[3], 6); |
49 | 49 | |
50 | 50 | if (!isset($zipper[$type])) { |
51 | - die("invaild zip type\nuse " . $argv[0] . " --help\n"); |
|
51 | + die("invaild zip type\nuse ".$argv[0]." --help\n"); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | if (checkpath($src) == false) { |
55 | - die("invaild src\nuse " . $argv[0] . " --help\n"); |
|
55 | + die("invaild src\nuse ".$argv[0]." --help\n"); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | if (checkpath($dst) == false) { |
59 | - die("invaild dst\nuse " . $argv[0] . " --help\n"); |
|
59 | + die("invaild dst\nuse ".$argv[0]." --help\n"); |
|
60 | 60 | } |
61 | 61 | |
62 | -$src = $basedir . $src; |
|
63 | -$dst = $basedir . $dst; |
|
62 | +$src = $basedir.$src; |
|
63 | +$dst = $basedir.$dst; |
|
64 | 64 | |
65 | 65 | if (!file_exists($src)) { |
66 | - die("error: source not exist\nuse " . $argv[0] . " --help\n"); |
|
66 | + die("error: source not exist\nuse ".$argv[0]." --help\n"); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | if (file_exists($dst)) { |
70 | - die("error: destination already exists\nuse " . $argv[0] . " --help\n"); |
|
70 | + die("error: destination already exists\nuse ".$argv[0]." --help\n"); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | $cmd = $zipper[$type]; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | return false; |
85 | 85 | } |
86 | 86 | |
87 | - for ($i = 0; $i < count($parts); $i ++) { |
|
87 | + for ($i = 0; $i < count($parts); $i++) { |
|
88 | 88 | if (($parts[$i] == '..') || ($parts[$i] == '.')) { |
89 | 89 | return false; |
90 | 90 | } |
@@ -43,7 +43,7 @@ |
||
43 | 43 | $rLastLog = mysql_fetch_array($rs); |
44 | 44 | mysql_free_result($rs); |
45 | 45 | |
46 | - mysql_query("PURGE MASTER LOGS TO '" . mysql_real_escape_string($rLastLog[0], $dblink) . "'", $dblink); |
|
46 | + mysql_query("PURGE MASTER LOGS TO '".mysql_real_escape_string($rLastLog[0], $dblink)."'", $dblink); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | mysql_close($dblink); |
@@ -22,12 +22,12 @@ |
||
22 | 22 | |
23 | 23 | // Bilder downloaden? |
24 | 24 | $opt['pictures']['download'] = 1; |
25 | -$opt['pictures']['directory'] = $rootpath . 'images/uploads/'; |
|
25 | +$opt['pictures']['directory'] = $rootpath.'images/uploads/'; |
|
26 | 26 | $opt['pictures']['url'] = 'http://www.so-komm-ich-uebers-web-da.hin/www.opencaching.de/html/images/uploads/'; |
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; |