@@ -18,7 +18,7 @@ |
||
18 | 18 | { |
19 | 19 | global $opt; |
20 | 20 | |
21 | - $files = glob($opt['okapi']['var_dir'] . '/garmin*.zip'); |
|
21 | + $files = glob($opt['okapi']['var_dir'].'/garmin*.zip'); |
|
22 | 22 | foreach ($files as $file) { |
23 | 23 | // delete old download files after 24 hours; this large interval filters out any |
24 | 24 | // timezone mismatches in file sysytems (e.g. on unconventional development |
@@ -26,12 +26,12 @@ discard block |
||
26 | 26 | $rsLayers = sql( |
27 | 27 | "SELECT `id`, `type_id`, AsText(`shape`) AS `geometry` |
28 | 28 | FROM `npa_areas` WHERE `exclude`=0 AND MBRWITHIN(GeomFromText('&1'), `shape`)", |
29 | - 'POINT(' . $rCache['longitude'] . ' ' . $rCache['latitude'] . ')' |
|
29 | + 'POINT('.$rCache['longitude'].' '.$rCache['latitude'].')' |
|
30 | 30 | ); |
31 | 31 | while ($rLayers = sql_fetch_assoc($rsLayers)) { |
32 | 32 | if (gis::ptInLineRing( |
33 | 33 | $rLayers['geometry'], |
34 | - 'POINT(' . $rCache['longitude'] . ' ' . $rCache['latitude'] . ')' |
|
34 | + 'POINT('.$rCache['longitude'].' '.$rCache['latitude'].')' |
|
35 | 35 | ) |
36 | 36 | ) { |
37 | 37 | $bExclude = false; |
@@ -44,12 +44,12 @@ discard block |
||
44 | 44 | AND `type_id`='&1' |
45 | 45 | AND MBRWITHIN(GeomFromText('&2'), `shape`)", |
46 | 46 | $rLayers['type_id'], |
47 | - 'POINT(' . $rCache['longitude'] . ' ' . $rCache['latitude'] . ')' |
|
47 | + 'POINT('.$rCache['longitude'].' '.$rCache['latitude'].')' |
|
48 | 48 | ); |
49 | 49 | while (($rExclude = sql_fetch_assoc($rsExclude)) && ($bExclude == false)) { |
50 | 50 | if (gis::ptInLineRing( |
51 | 51 | $rExclude['geometry'], |
52 | - 'POINT(' . $rCache['longitude'] . ' ' . $rCache['latitude'] . ')' |
|
52 | + 'POINT('.$rCache['longitude'].' '.$rCache['latitude'].')' |
|
53 | 53 | ) |
54 | 54 | ) { |
55 | 55 | $bExclude = true; |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | class orphan_cleanup |
14 | 14 | { |
15 | 15 | public $name = 'orphan_cleanup'; |
16 | - public $interval = 86400; // once per day |
|
16 | + public $interval = 86400; // once per day |
|
17 | 17 | |
18 | 18 | public function run() |
19 | 19 | { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | "DELETE FROM `xmlsession_data` |
36 | 36 | WHERE `session_id` IN (SELECT `session_id` FROM &tmpsessiondata)" |
37 | 37 | ); |
38 | - echo 'orphan_cleanup: dropped ' . $count . " record(s) from xmlsession_data\n"; |
|
38 | + echo 'orphan_cleanup: dropped '.$count." record(s) from xmlsession_data\n"; |
|
39 | 39 | } |
40 | 40 | sql_drop_temp_table('tmpsessiondata'); |
41 | 41 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | "DELETE FROM `map2_data` |
58 | 58 | WHERE `result_id` IN (SELECT `result_id` FROM &tmpsessiondata)" |
59 | 59 | ); |
60 | - echo 'orphan_cleanup: dropped ' . $count . " record(s) from map2_data\n"; |
|
60 | + echo 'orphan_cleanup: dropped '.$count." record(s) from map2_data\n"; |
|
61 | 61 | } |
62 | 62 | sql_drop_temp_table('tmpsessiondata'); |
63 | 63 | } |
@@ -49,10 +49,10 @@ |
||
49 | 49 | == file_get_contents($instances[$n]['pic']->getFilename()) |
50 | 50 | ) { |
51 | 51 | $picture = $instances[$n]['pic']; |
52 | - echo 'deleting duplicate picture ' . $picture->getPictureId( |
|
53 | - ) . ' ("' . $picture->getTitle() . '")' . |
|
54 | - ' from log ' . $rDuplicatePic['object_id'] . |
|
55 | - ' of cache ' . $instances[$n]['cache_id'] . "\n"; |
|
52 | + echo 'deleting duplicate picture '.$picture->getPictureId( |
|
53 | + ).' ("'.$picture->getTitle().'")'. |
|
54 | + ' from log '.$rDuplicatePic['object_id']. |
|
55 | + ' of cache '.$instances[$n]['cache_id']."\n"; |
|
56 | 56 | $picture->delete(false); |
57 | 57 | $instances[$n]['filesize'] = false; |
58 | 58 | break; |
@@ -27,15 +27,15 @@ |
||
27 | 27 | $result = 'ok'; |
28 | 28 | } else { |
29 | 29 | $result = @file_get_contents( |
30 | - $opt['cron']['gcwp']['report'] . |
|
31 | - '?ocwp=' . urlencode($r['wp_oc']) . |
|
32 | - '&gcwp=' . urlencode($r['wp_external']) . |
|
33 | - '&source=' . urlencode($r['source']) |
|
30 | + $opt['cron']['gcwp']['report']. |
|
31 | + '?ocwp='.urlencode($r['wp_oc']). |
|
32 | + '&gcwp='.urlencode($r['wp_external']). |
|
33 | + '&source='.urlencode($r['source']) |
|
34 | 34 | ); |
35 | 35 | $result = trim($result); |
36 | 36 | } |
37 | 37 | if ($result != 'ok') { |
38 | - echo "could not push GC waypoint report (id " . $r['report_id'] . "): " . $result . "\n"; |
|
38 | + echo "could not push GC waypoint report (id ".$r['report_id']."): ".$result."\n"; |
|
39 | 39 | break; |
40 | 40 | } else { |
41 | 41 | sql( |
@@ -42,17 +42,17 @@ discard block |
||
42 | 42 | { |
43 | 43 | global $opt; |
44 | 44 | |
45 | - if (!@mkdir(__DIR__ . '/../../../cache2/geokrety')) { |
|
45 | + if (!@mkdir(__DIR__.'/../../../cache2/geokrety')) { |
|
46 | 46 | // die('can\'t create geogrety cache dir'); |
47 | 47 | } |
48 | - $path = __DIR__ . '/../../../cache2/geokrety/import-' . date('Ymd-His') . '.xml'; |
|
48 | + $path = __DIR__.'/../../../cache2/geokrety/import-'.date('Ymd-His').'.xml'; |
|
49 | 49 | |
50 | 50 | // Changed default-value for getSysConfig() from '2005-01-01 00:00:00' to 'NOW - 9d 12h' |
51 | 51 | // to safely stay in api-limit, even when client and server are in different time zones. |
52 | 52 | $modifiedsince = strtotime( |
53 | 53 | getSysConfig('geokrety_lastupdate', date($opt['db']['dateformat'], time() - 60 * 60 * 24 * 9.5)) |
54 | 54 | ); |
55 | - if (!@copy('http://geokrety.org/export.php?modifiedsince=' . date('YmdHis', $modifiedsince - 1), $path)) { |
|
55 | + if (!@copy('http://geokrety.org/export.php?modifiedsince='.date('YmdHis', $modifiedsince - 1), $path)) { |
|
56 | 56 | return false; |
57 | 57 | } |
58 | 58 | |
@@ -81,19 +81,19 @@ discard block |
||
81 | 81 | |
82 | 82 | $xr->read(); |
83 | 83 | if ($xr->nodeType != XMLReader::ELEMENT) { |
84 | - echo 'error: First element expected, aborted' . "\n"; |
|
84 | + echo 'error: First element expected, aborted'."\n"; |
|
85 | 85 | |
86 | 86 | return; |
87 | 87 | } |
88 | 88 | if ($xr->name != 'gkxml') { |
89 | - echo 'error: First element not valid, aborted' . "\n"; |
|
89 | + echo 'error: First element not valid, aborted'."\n"; |
|
90 | 90 | |
91 | 91 | return; |
92 | 92 | } |
93 | 93 | |
94 | 94 | $startupdate = $xr->getAttribute('date'); |
95 | 95 | if ($startupdate == '') { |
96 | - echo 'error: Date attribute not valid, aborted' . "\n"; |
|
96 | + echo 'error: Date attribute not valid, aborted'."\n"; |
|
97 | 97 | |
98 | 98 | return; |
99 | 99 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | break; |
116 | 116 | } |
117 | 117 | |
118 | - $nRecordsCount ++; |
|
118 | + $nRecordsCount++; |
|
119 | 119 | } |
120 | 120 | } while ($xr->next()); |
121 | 121 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | $waypoints = $element->getElementsByTagName('waypoints'); |
254 | 254 | if ($waypoints->length > 0) { |
255 | 255 | $wpItems = $waypoints->item(0)->getElementsByTagName('waypoint'); |
256 | - for ($i = 0; $i < $wpItems->length; $i ++) { |
|
256 | + for ($i = 0; $i < $wpItems->length; $i++) { |
|
257 | 257 | $wp = mb_trim($wpItems->item($i)->nodeValue); |
258 | 258 | if ($wp != '') { |
259 | 259 | sql("INSERT INTO `gk_move_waypoint` (`id`, `wp`) VALUES ('&1', '&2')", $id, $wp); |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | WHERE `id`='&2' AND `wp`!=''", |
286 | 286 | $gkid, |
287 | 287 | $r['id'] |
288 | - ); // "late log" bugfix: replaced $id paramter by $r['id'] |
|
288 | + ); // "late log" bugfix: replaced $id paramter by $r['id'] |
|
289 | 289 | } else { |
290 | 290 | // do nothing |
291 | 291 | } |
@@ -41,12 +41,12 @@ |
||
41 | 41 | "SELECT `level`, `code`, AsText(`shape`) AS `geometry` |
42 | 42 | FROM `nuts_layer` |
43 | 43 | WHERE MBRWITHIN(GeomFromText('&1'), `shape`) ORDER BY `level` DESC", |
44 | - 'POINT(' . $rCache['longitude'] . ' ' . $rCache['latitude'] . ')' |
|
44 | + 'POINT('.$rCache['longitude'].' '.$rCache['latitude'].')' |
|
45 | 45 | ); |
46 | 46 | while ($rLayers = sql_fetch_assoc($rsLayers)) { |
47 | 47 | if (gis::ptInLineRing( |
48 | 48 | $rLayers['geometry'], |
49 | - 'POINT(' . $rCache['longitude'] . ' ' . $rCache['latitude'] . ')' |
|
49 | + 'POINT('.$rCache['longitude'].' '.$rCache['latitude'].')' |
|
50 | 50 | ) |
51 | 51 | ) { |
52 | 52 | $sCode = $rLayers['code']; |
@@ -25,11 +25,11 @@ discard block |
||
25 | 25 | |
26 | 26 | foreach ($opt['db']['slaves'] as $k => $v) { |
27 | 27 | $this->check_slave($k); |
28 | - $known_ids[] = "'" . sql_escape($k) . "'"; |
|
28 | + $known_ids[] = "'".sql_escape($k)."'"; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | if (count($known_ids) > 0) { |
32 | - sql("DELETE FROM `sys_repl_slaves` WHERE `id` NOT IN (" . implode(',', $known_ids) . ")"); |
|
32 | + sql("DELETE FROM `sys_repl_slaves` WHERE `id` NOT IN (".implode(',', $known_ids).")"); |
|
33 | 33 | } else { |
34 | 34 | sql("DELETE FROM `sys_repl_slaves`"); |
35 | 35 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | if ($nOnline != sql_value("SELECT `online` FROM `sys_repl_slaves` WHERE `id`='&1'", 0, $id)) { |
89 | 89 | mail( |
90 | 90 | $opt['db']['error']['mail'], |
91 | - "MySQL Slave Server Id " . $id . " (" . $slave['server'] . ") is now " . (($nOnline != 0) ? 'Online' : 'Offline'), |
|
91 | + "MySQL Slave Server Id ".$id." (".$slave['server'].") is now ".(($nOnline != 0) ? 'Online' : 'Offline'), |
|
92 | 92 | '' |
93 | 93 | ); |
94 | 94 | } |
@@ -24,9 +24,9 @@ |
||
24 | 24 | |
25 | 25 | $hidden_caches = file_get_contents($opt['cron']['replicate']['delete_hidden_caches']['url']); |
26 | 26 | $hc = explode("\n", trim($hidden_caches)); |
27 | - $hc_imploded_and_escaped = "'" . implode("','", array_map('sql_escape', $hc)) . "'"; |
|
27 | + $hc_imploded_and_escaped = "'".implode("','", array_map('sql_escape', $hc))."'"; |
|
28 | 28 | sql("SET @allowdelete = 1"); |
29 | - sql("DELETE FROM `caches` WHERE `wp_oc` IN (" . $hc_imploded_and_escaped . ")"); |
|
29 | + sql("DELETE FROM `caches` WHERE `wp_oc` IN (".$hc_imploded_and_escaped.")"); |
|
30 | 30 | // All dependent data in other tables is deleted via trigger. |
31 | 31 | } |
32 | 32 | } |