@@ -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"; |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * Searches for Unicode byte order marks in code and template files |
8 | 8 | ***************************************************************************/ |
9 | 9 | |
10 | -chdir(__DIR__ . '/../../htdocs'); |
|
10 | +chdir(__DIR__.'/../../htdocs'); |
|
11 | 11 | require_once 'lib2/cli.inc.php'; |
12 | 12 | |
13 | 13 | |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $hDir = opendir($dir); |
26 | 26 | if ($hDir !== false) { |
27 | 27 | while (($file = readdir($hDir)) !== false) { |
28 | - $path = $dir . '/' . $file; |
|
28 | + $path = $dir.'/'.$file; |
|
29 | 29 | if (is_dir($path) && substr($file, 0, 1) !== '.' && $subdirs) { |
30 | 30 | scan($path, $subdirs); |
31 | 31 | } else { |
@@ -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 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * Searches for files which are no longer Unicode-encoded |
8 | 8 | ***************************************************************************/ |
9 | 9 | |
10 | -chdir(__DIR__ . '/../../htdocs'); |
|
10 | +chdir(__DIR__.'/../../htdocs'); |
|
11 | 11 | require_once 'lib2/cli.inc.php'; |
12 | 12 | |
13 | 13 | |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $hDir = opendir($dir); |
26 | 26 | if ($hDir !== false) { |
27 | 27 | while (($file = readdir($hDir)) !== false) { |
28 | - $path = $dir . '/' . $file; |
|
28 | + $path = $dir.'/'.$file; |
|
29 | 29 | if (is_dir($path) && substr($file, 0, 1) !== '.' && $subdirs) { |
30 | 30 | scan($path, $subdirs); |
31 | 31 | } else { |
@@ -41,7 +41,7 @@ discard block |
||
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', |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | if (mb_trim(mb_substr($contents, $ur + 17, 2)) != "メモ") { |
58 | 58 | $ur = mb_stripos($contents, "Unicode Reminder"); |
59 | 59 | if (mb_trim(mb_substr($contents, $ur + 17, 2)) != "メモ") { |
60 | - echo "Bad Unicode Reminder found in $path: " . mb_trim(mb_substr($contents, $ur + 17, 2)) . "\n"; |
|
60 | + echo "Bad Unicode Reminder found in $path: ".mb_trim(mb_substr($contents, $ur + 17, 2))."\n"; |
|
61 | 61 | } else { |
62 | 62 | echo "Unexpected non-ASCII chars (BOMs?) in header of $path\n"; |
63 | 63 | } |
@@ -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; |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | * - Test mit aktuellem OC.de-Stand |
28 | 28 | ***************************************************************************/ |
29 | 29 | |
30 | -$rootpath = __DIR__ . '/../../htdocs/'; |
|
30 | +$rootpath = __DIR__.'/../../htdocs/'; |
|
31 | 31 | |
32 | 32 | // chdir to proper directory (needed for cronjobs) |
33 | 33 | chdir(substr(realpath($_SERVER['PHP_SELF']), 0, strrpos(realpath($_SERVER['PHP_SELF']), '/'))); |
34 | 34 | |
35 | -require_once $rootpath . 'lib/clicompatbase.inc.php'; |
|
35 | +require_once $rootpath.'lib/clicompatbase.inc.php'; |
|
36 | 36 | require_once 'xml2array.inc.php'; |
37 | 37 | require_once 'settings.php'; |
38 | 38 | |
@@ -67,16 +67,16 @@ discard block |
||
67 | 67 | $nFileNr = 0; |
68 | 68 | $rs = sql('SELECT `id`, `url` FROM `pictures` WHERE `local`=0'); |
69 | 69 | while ($r = sql_fetch_array($rs)) { |
70 | - $nFileNr ++; |
|
70 | + $nFileNr++; |
|
71 | 71 | $fileparts = mb_split('/', $r['url']); |
72 | 72 | $filename = $fileparts[count($fileparts) - 1]; |
73 | 73 | |
74 | - echo 'Downloading file ' . $nFileNr . ' of ' . $rCount['c'] . ': ' . $filename . "\n"; |
|
74 | + echo 'Downloading file '.$nFileNr.' of '.$rCount['c'].': '.$filename."\n"; |
|
75 | 75 | |
76 | 76 | $success = true; |
77 | - if (!file_exists($opt['pictures']['directory'] . $filename)) { |
|
78 | - if (!@copy($r['url'], $opt['pictures']['directory'] . $filename)) { |
|
79 | - echo 'error: Download nicht erfolgreich' . "\n"; |
|
77 | + if (!file_exists($opt['pictures']['directory'].$filename)) { |
|
78 | + if (!@copy($r['url'], $opt['pictures']['directory'].$filename)) { |
|
79 | + echo 'error: Download nicht erfolgreich'."\n"; |
|
80 | 80 | $success = false; |
81 | 81 | } |
82 | 82 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | if ($success == true) { |
85 | 85 | sql( |
86 | 86 | "UPDATE `pictures` SET `local`=1, `url`='&1' WHERE `id`='&2'", |
87 | - $opt['pictures']['url'] . $filename, |
|
87 | + $opt['pictures']['url'].$filename, |
|
88 | 88 | $r['id'] |
89 | 89 | ); |
90 | 90 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | |
197 | 197 | if ($opt['session'] == 1) { |
198 | 198 | // records abfragen |
199 | - $sessionfile = $opt['tmpdir'] . 'session.xml'; |
|
199 | + $sessionfile = $opt['tmpdir'].'session.xml'; |
|
200 | 200 | if (file_exists($sessionfile)) { |
201 | 201 | unlink($sessionfile); |
202 | 202 | } |
@@ -215,21 +215,21 @@ discard block |
||
215 | 215 | $recordscount += $session['OCXMLSESSION']['RECORDS']['PICTURE']; |
216 | 216 | $recordscount += $session['OCXMLSESSION']['RECORDS']['REMOVEOBJECT']; |
217 | 217 | |
218 | - echo 'Abruf seit ' . $lastUpdate . "\n"; |
|
218 | + echo 'Abruf seit '.$lastUpdate."\n"; |
|
219 | 219 | echo "------------------------\n"; |
220 | - echo 'Session-Id: ' . $sessionid . "\n"; |
|
221 | - echo 'User: ' . $session['OCXMLSESSION']['RECORDS']['USER'] . "\n"; |
|
222 | - echo 'Cache: ' . $session['OCXMLSESSION']['RECORDS']['CACHE'] . "\n"; |
|
223 | - echo 'Cachdesc: ' . $session['OCXMLSESSION']['RECORDS']['CACHEDESC'] . "\n"; |
|
224 | - echo 'Cachelog: ' . $session['OCXMLSESSION']['RECORDS']['CACHELOG'] . "\n"; |
|
225 | - echo 'Picture: ' . $session['OCXMLSESSION']['RECORDS']['PICTURE'] . "\n"; |
|
226 | - echo 'Removedobject: ' . $session['OCXMLSESSION']['RECORDS']['REMOVEOBJECT'] . "\n"; |
|
220 | + echo 'Session-Id: '.$sessionid."\n"; |
|
221 | + echo 'User: '.$session['OCXMLSESSION']['RECORDS']['USER']."\n"; |
|
222 | + echo 'Cache: '.$session['OCXMLSESSION']['RECORDS']['CACHE']."\n"; |
|
223 | + echo 'Cachdesc: '.$session['OCXMLSESSION']['RECORDS']['CACHEDESC']."\n"; |
|
224 | + echo 'Cachelog: '.$session['OCXMLSESSION']['RECORDS']['CACHELOG']."\n"; |
|
225 | + echo 'Picture: '.$session['OCXMLSESSION']['RECORDS']['PICTURE']."\n"; |
|
226 | + echo 'Removedobject: '.$session['OCXMLSESSION']['RECORDS']['REMOVEOBJECT']."\n"; |
|
227 | 227 | echo "------------------------\n"; |
228 | - echo 'Summe: ' . $recordscount . "\n"; |
|
228 | + echo 'Summe: '.$recordscount."\n"; |
|
229 | 229 | |
230 | 230 | $filescount = ($recordscount + (500 - $recordscount % 500)) / 500; |
231 | 231 | |
232 | - echo 'Anzahl der Pakete: ' . $filescount . "\n"; |
|
232 | + echo 'Anzahl der Pakete: '.$filescount."\n"; |
|
233 | 233 | echo "\n"; |
234 | 234 | |
235 | 235 | if ($recordscount == 0) { |
@@ -237,20 +237,20 @@ discard block |
||
237 | 237 | exit; |
238 | 238 | } |
239 | 239 | |
240 | - for ($i = 1; $i <= $filescount; $i ++) { |
|
241 | - echo "Download Paket: " . $i . ' von ' . $filescount . "\n"; |
|
240 | + for ($i = 1; $i <= $filescount; $i++) { |
|
241 | + echo "Download Paket: ".$i.' von '.$filescount."\n"; |
|
242 | 242 | |
243 | 243 | $fileurl = $opt['url_getsession']; |
244 | 244 | $fileurl = mb_ereg_replace('{sessionid}', $sessionid, $fileurl); |
245 | 245 | $fileurl = mb_ereg_replace('{file}', $i, $fileurl); |
246 | 246 | $fileurl = mb_ereg_replace('{zip}', $opt['zip'], $fileurl); |
247 | - $target = $opt['tmpdir'] . $sessionid . '-' . sprintf('%04d', $i) . $fileext; |
|
247 | + $target = $opt['tmpdir'].$sessionid.'-'.sprintf('%04d', $i).$fileext; |
|
248 | 248 | |
249 | 249 | copy($fileurl, $target); |
250 | 250 | } |
251 | 251 | } else { |
252 | - echo 'Download ...' . "\n"; |
|
253 | - $target = $opt['tmpdir'] . date('YmdHis') . $fileext; |
|
252 | + echo 'Download ...'."\n"; |
|
253 | + $target = $opt['tmpdir'].date('YmdHis').$fileext; |
|
254 | 254 | copy($url, $target); |
255 | 255 | } |
256 | 256 | } |
@@ -262,24 +262,24 @@ discard block |
||
262 | 262 | // alle zips entpacken |
263 | 263 | $hDir = opendir($opt['tmpdir']); |
264 | 264 | while (false !== ($file = readdir($hDir))) { |
265 | - if (is_file($opt['tmpdir'] . $file)) { |
|
265 | + if (is_file($opt['tmpdir'].$file)) { |
|
266 | 266 | $bCopy = false; |
267 | 267 | if (mb_substr($file, mb_strrpos($file, '.')) == '.zip') { |
268 | - echo 'Unzipping file ' . $file . "\n"; |
|
268 | + echo 'Unzipping file '.$file."\n"; |
|
269 | 269 | system( |
270 | - $opt['unzip'] . ' --type=zip --src="' . $opt['rel_tmpdir'] . '/' . $file . '" --dst="' . $opt['rel_tmpdir'] . '"' |
|
270 | + $opt['unzip'].' --type=zip --src="'.$opt['rel_tmpdir'].'/'.$file.'" --dst="'.$opt['rel_tmpdir'].'"' |
|
271 | 271 | ); |
272 | 272 | } else { |
273 | 273 | if (mb_substr($file, mb_strrpos($file, '.')) == '.gz') { |
274 | - echo 'Unzipping file ' . $file . "\n"; |
|
274 | + echo 'Unzipping file '.$file."\n"; |
|
275 | 275 | system( |
276 | - $opt['unzip'] . ' --type=gzip --src="' . $opt['rel_tmpdir'] . '/' . $file . '" --dst="' . $opt['rel_tmpdir'] . '"' |
|
276 | + $opt['unzip'].' --type=gzip --src="'.$opt['rel_tmpdir'].'/'.$file.'" --dst="'.$opt['rel_tmpdir'].'"' |
|
277 | 277 | ); |
278 | 278 | } else { |
279 | 279 | if (mb_substr($file, mb_strrpos($file, '.')) == '.bz2') { |
280 | - echo 'Unzipping file ' . $file . "\n"; |
|
280 | + echo 'Unzipping file '.$file."\n"; |
|
281 | 281 | system( |
282 | - $opt['unzip'] . ' --type=bzip2 --src="' . $opt['rel_tmpdir'] . '/' . $file . '" --dst="' . $opt['rel_tmpdir'] . '"' |
|
282 | + $opt['unzip'].' --type=bzip2 --src="'.$opt['rel_tmpdir'].'/'.$file.'" --dst="'.$opt['rel_tmpdir'].'"' |
|
283 | 283 | ); |
284 | 284 | } else { |
285 | 285 | if (mb_substr($file, mb_strrpos($file, '.')) == '.xml') { |
@@ -291,16 +291,16 @@ discard block |
||
291 | 291 | |
292 | 292 | // und jetzt die gezippte Datei verschieben |
293 | 293 | $archivdir = $opt['archivdir']; |
294 | - $archivdir .= $opt['curdb'] . '/'; |
|
294 | + $archivdir .= $opt['curdb'].'/'; |
|
295 | 295 | |
296 | 296 | if (!is_dir($archivdir)) { |
297 | 297 | mkdir($archivdir); |
298 | 298 | } |
299 | 299 | |
300 | 300 | if ($bCopy == true) { |
301 | - copy($opt['tmpdir'] . $file, $archivdir . '/' . $file); |
|
301 | + copy($opt['tmpdir'].$file, $archivdir.'/'.$file); |
|
302 | 302 | } else { |
303 | - rename($opt['tmpdir'] . $file, $archivdir . '/' . $file); |
|
303 | + rename($opt['tmpdir'].$file, $archivdir.'/'.$file); |
|
304 | 304 | } |
305 | 305 | } |
306 | 306 | } |
@@ -315,9 +315,9 @@ discard block |
||
315 | 315 | |
316 | 316 | $hDir = opendir($opt['tmpdir']); |
317 | 317 | while (false !== ($file = readdir($hDir))) { |
318 | - if (is_file($opt['tmpdir'] . $file)) { |
|
318 | + if (is_file($opt['tmpdir'].$file)) { |
|
319 | 319 | if ($file != '.cvsignore') { |
320 | - $files[] = $opt['tmpdir'] . $file; |
|
320 | + $files[] = $opt['tmpdir'].$file; |
|
321 | 321 | } |
322 | 322 | } |
323 | 323 | } |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | |
332 | 332 | function importxmlfile($file) |
333 | 333 | { |
334 | - echo 'Importing file ' . $file . "\n"; |
|
334 | + echo 'Importing file '.$file."\n"; |
|
335 | 335 | |
336 | 336 | $xmlReader = new xmlReader(); |
337 | 337 | $xmlReader->open($file); |
@@ -411,11 +411,11 @@ discard block |
||
411 | 411 | if ($sSubElement != '') { |
412 | 412 | // vorheriges element zuerst schlißen |
413 | 413 | $sSubElement = ''; |
414 | - $nRecursionLevel --; |
|
414 | + $nRecursionLevel--; |
|
415 | 415 | } |
416 | 416 | |
417 | 417 | $sSubElement = mb_strtoupper($xmlReader->name); |
418 | - $nRecursionLevel ++; |
|
418 | + $nRecursionLevel++; |
|
419 | 419 | |
420 | 420 | // attribute auslesen |
421 | 421 | if ($xmlReader->moveToFirstAttribute()) { |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | } else { |
433 | 433 | if ($xmlReader->nodeType == XMLReader::END_ELEMENT) { |
434 | 434 | $sSubElement = ''; |
435 | - $nRecursionLevel --; |
|
435 | + $nRecursionLevel--; |
|
436 | 436 | } |
437 | 437 | } |
438 | 438 | } |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | ImportRemovedObjectArray($node['REMOVEDOBJECT']); |
460 | 460 | break; |
461 | 461 | default: |
462 | - echo 'Unknown Element "' . $xmlReader->name . '", skipping' . "\n"; |
|
462 | + echo 'Unknown Element "'.$xmlReader->name.'", skipping'."\n"; |
|
463 | 463 | break; |
464 | 464 | } |
465 | 465 | } |
@@ -481,9 +481,9 @@ discard block |
||
481 | 481 | |
482 | 482 | $hDir = opendir($opt['tmpdir']); |
483 | 483 | while (false !== ($file = readdir($hDir))) { |
484 | - if (is_file($opt['tmpdir'] . $file)) { |
|
484 | + if (is_file($opt['tmpdir'].$file)) { |
|
485 | 485 | if ($file != '.cvsignore') { |
486 | - unlink($opt['tmpdir'] . $file); |
|
486 | + unlink($opt['tmpdir'].$file); |
|
487 | 487 | } |
488 | 488 | } |
489 | 489 | } |
@@ -501,14 +501,14 @@ discard block |
||
501 | 501 | // andere DB connecten? |
502 | 502 | if (mb_substr($arg, 0, 5) == '--db=') { |
503 | 503 | if (!is_numeric(mb_substr($arg, 5))) { |
504 | - die('invalid alternative DB' . "\n"); |
|
504 | + die('invalid alternative DB'."\n"); |
|
505 | 505 | } |
506 | 506 | |
507 | 507 | $nDb = mb_substr($arg, 5); |
508 | 508 | |
509 | 509 | if ($nDb != 0) { |
510 | 510 | if (!isset($opt['db'][$nDb])) { |
511 | - die('invalid alternative DB' . "\n"); |
|
511 | + die('invalid alternative DB'."\n"); |
|
512 | 512 | } |
513 | 513 | |
514 | 514 | mysql_close($dblink); |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | sql("SET NAMES 'utf8'"); |
518 | 518 | sql('USE `&1`', $opt['db'][1]['name']); |
519 | 519 | } else { |
520 | - die('Connect to alternative DB failed' . "\n"); |
|
520 | + die('Connect to alternative DB failed'."\n"); |
|
521 | 521 | } |
522 | 522 | |
523 | 523 | $opt['curdb'] = $nDb; |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | sql("SET NAMES 'utf8'"); |
532 | 532 | sql('USE `&1`', $dbname); |
533 | 533 | } else { |
534 | - die('Connect to alternative DB failed' . "\n"); |
|
534 | + die('Connect to alternative DB failed'."\n"); |
|
535 | 535 | } |
536 | 536 | } |
537 | 537 | } |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | !isset($r['USERNAME']['__DATA']) || |
545 | 545 | !isset($r['LASTMODIFIED']['__DATA']) |
546 | 546 | ) { |
547 | - echo 'warn: ImportUserArray required element not defined' . "\n"; |
|
547 | + echo 'warn: ImportUserArray required element not defined'."\n"; |
|
548 | 548 | |
549 | 549 | return; |
550 | 550 | } |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | !isset($r['DATECREATED']['__DATA']) || |
638 | 638 | !isset($r['LASTMODIFIED']['__DATA']) |
639 | 639 | ) { |
640 | - echo 'warn: ImportCacheArray required element not defined' . "\n"; |
|
640 | + echo 'warn: ImportCacheArray required element not defined'."\n"; |
|
641 | 641 | |
642 | 642 | return; |
643 | 643 | } |
@@ -808,7 +808,7 @@ discard block |
||
808 | 808 | !isset($r['LANGUAGE']['__ATTR']['ID']) || |
809 | 809 | !isset($r['LASTMODIFIED']['__DATA']) |
810 | 810 | ) { |
811 | - echo 'error: ImportCacheDescArray required element not defined' . "\n"; |
|
811 | + echo 'error: ImportCacheDescArray required element not defined'."\n"; |
|
812 | 812 | |
813 | 813 | return; |
814 | 814 | } |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | !isset($r['DATECREATED']['__DATA']) || |
966 | 966 | !isset($r['LASTMODIFIED']['__DATA']) |
967 | 967 | ) { |
968 | - echo 'error: ImportCachelogArray required element not defined' . "\n"; |
|
968 | + echo 'error: ImportCachelogArray required element not defined'."\n"; |
|
969 | 969 | |
970 | 970 | return; |
971 | 971 | } |
@@ -996,7 +996,7 @@ discard block |
||
996 | 996 | |
997 | 997 | // logtype gültig? |
998 | 998 | if (sqlValue( |
999 | - "SELECT COUNT(*) FROM `log_types` WHERE `id`='" . sql_escape($r['LOGTYPE']['__ATTR']['ID']) . "'", |
|
999 | + "SELECT COUNT(*) FROM `log_types` WHERE `id`='".sql_escape($r['LOGTYPE']['__ATTR']['ID'])."'", |
|
1000 | 1000 | 0 |
1001 | 1001 | ) == 0 |
1002 | 1002 | ) { |
@@ -1070,7 +1070,7 @@ discard block |
||
1070 | 1070 | !isset($r['DATECREATED']['__DATA']) || |
1071 | 1071 | !isset($r['LASTMODIFIED']['__DATA']) |
1072 | 1072 | ) { |
1073 | - echo 'error: ImportPictureArray required element not defined ' . "\n"; |
|
1073 | + echo 'error: ImportPictureArray required element not defined '."\n"; |
|
1074 | 1074 | |
1075 | 1075 | return; |
1076 | 1076 | } |
@@ -1171,7 +1171,7 @@ discard block |
||
1171 | 1171 | !isset($r['OBJECT']['__DATA']) || |
1172 | 1172 | !isset($r['REMOVEDDATE']['__DATA']) |
1173 | 1173 | ) { |
1174 | - echo 'error: ImportRemovedObjectArray required element not defined' . "\n"; |
|
1174 | + echo 'error: ImportRemovedObjectArray required element not defined'."\n"; |
|
1175 | 1175 | |
1176 | 1176 | return; |
1177 | 1177 | } |
@@ -1283,12 +1283,12 @@ discard block |
||
1283 | 1283 | |
1284 | 1284 | function importError($recordtype, $uuid, $r, $info) |
1285 | 1285 | { |
1286 | - echo 'error: ' . $recordtype . ' (' . $uuid . '): ' . $info . "\n"; |
|
1286 | + echo 'error: '.$recordtype.' ('.$uuid.'): '.$info."\n"; |
|
1287 | 1287 | } |
1288 | 1288 | |
1289 | 1289 | function importWarn($recordtype, $uuid, $r, $info) |
1290 | 1290 | { |
1291 | - echo 'warn: ' . $recordtype . ' (' . $uuid . '): ' . $info . "\n"; |
|
1291 | + echo 'warn: '.$recordtype.' ('.$uuid.'): '.$info."\n"; |
|
1292 | 1292 | } |
1293 | 1293 | |
1294 | 1294 | function restorevalues() |