@@ -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; |
@@ -42,7 +42,8 @@ |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | for ($n = 1; $n < count($instances); ++ $n) { |
45 | - if ($instances[$n]['filesize'] !== false) {// ensure that pic is stored locally |
|
45 | + if ($instances[$n]['filesize'] !== false) { |
|
46 | +// ensure that pic is stored locally |
|
46 | 47 | for ($nn = $n - 1; $nn >= 0; -- $nn) { |
47 | 48 | if ($instances[$nn]['filesize'] === $instances[$n]['filesize']) { |
48 | 49 | if (file_get_contents($instances[$nn]['pic']->getFilename()) |
@@ -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( |
@@ -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 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | ORDER BY `free_wp` ASC |
57 | 57 | LIMIT 250", |
58 | 58 | $opt['logic']['waypoint_pool']['prefix'], |
59 | - '^' . $opt['logic']['waypoint_pool']['prefix'] . '[' . $opt['logic']['waypoint_pool']['valid_chars'] . ']{1,}$' |
|
59 | + '^'.$opt['logic']['waypoint_pool']['prefix'].'['.$opt['logic']['waypoint_pool']['valid_chars'].']{1,}$' |
|
60 | 60 | ); |
61 | 61 | } else { |
62 | 62 | // query the last used waypoint |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | SELECT MAX(WPTODEC(`wp_oc`, '&2')) AS dec_wp |
71 | 71 | FROM `cache_waypoint_pool` |
72 | 72 | ) AS tbl", |
73 | - '^' . $opt['logic']['waypoint_pool']['prefix'] . '[' . $opt['logic']['waypoint_pool']['valid_chars'] . ']{1,}$', |
|
73 | + '^'.$opt['logic']['waypoint_pool']['prefix'].'['.$opt['logic']['waypoint_pool']['valid_chars'].']{1,}$', |
|
74 | 74 | $opt['logic']['waypoint_pool']['prefix'] |
75 | 75 | ); |
76 | 76 | } |
@@ -78,16 +78,16 @@ discard block |
||
78 | 78 | while (($rStartWp = sql_fetch_assoc($rsStartWp)) && ($nInsertCount < $max_inserts_count)) { |
79 | 79 | $free_wp = $rStartWp['free_wp']; |
80 | 80 | if ($free_wp == '') { |
81 | - $free_wp = $opt['logic']['waypoint_pool']['prefix'] . '0001'; |
|
81 | + $free_wp = $opt['logic']['waypoint_pool']['prefix'].'0001'; |
|
82 | 82 | } |
83 | 83 | $nInsertCount += $this->fill_turn($free_wp, $max_inserts_count - $nInsertCount); |
84 | - $rowCount ++; |
|
84 | + $rowCount++; |
|
85 | 85 | } |
86 | 86 | sql_free_result($rsStartWp); |
87 | 87 | |
88 | 88 | if ($rowCount == 0) { |
89 | 89 | // new database ... |
90 | - $nInsertCount += $this->fill_turn($opt['logic']['waypoint_pool']['prefix'] . '0001', $max_inserts_count); |
|
90 | + $nInsertCount += $this->fill_turn($opt['logic']['waypoint_pool']['prefix'].'0001', $max_inserts_count); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | return $nInsertCount; |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | FROM `cache_waypoint_pool` |
112 | 112 | WHERE WPTODEC(`wp_oc`, '&3')>WPTODEC('&1', '&3') |
113 | 113 | ) AS tbl", |
114 | - $opt['logic']['waypoint_pool']['prefix'] . '100000', |
|
114 | + $opt['logic']['waypoint_pool']['prefix'].'100000', |
|
115 | 115 | $start_wp, |
116 | - '^' . $opt['logic']['waypoint_pool']['prefix'] . '[' . $opt['logic']['waypoint_pool']['valid_chars'] . ']{1,}$', |
|
116 | + '^'.$opt['logic']['waypoint_pool']['prefix'].'['.$opt['logic']['waypoint_pool']['valid_chars'].']{1,}$', |
|
117 | 117 | $opt['logic']['waypoint_pool']['prefix'] |
118 | 118 | ); |
119 | 119 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $nWaypointsGenerated = 0; |
122 | 122 | while (($nWaypointsGenerated < $max_inserts_count) && ($start_wp != $end_wp)) { |
123 | 123 | sql("INSERT INTO `cache_waypoint_pool` (`wp_oc`) VALUES ('&1')", $start_wp); |
124 | - $nWaypointsGenerated ++; |
|
124 | + $nWaypointsGenerated++; |
|
125 | 125 | $start_wp = $this->increment_waypoint($start_wp, $opt['logic']['waypoint_pool']['prefix']); |
126 | 126 | } |
127 | 127 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | $wp_value = substr($wp, 2); |
144 | 144 | $b36_value = ''; |
145 | - for ($i = 0; $i < strlen($wp_value); $i ++) { |
|
145 | + for ($i = 0; $i < strlen($wp_value); $i++) { |
|
146 | 146 | $b36_value .= substr($b36_chars, strpos($wp_chars, substr($wp_value, $i, 1)), 1); |
147 | 147 | } |
148 | 148 | |
@@ -150,14 +150,14 @@ discard block |
||
150 | 150 | $b36_value = strtoupper(base_convert($dec_value, 10, strlen($wp_chars))); |
151 | 151 | |
152 | 152 | $wp_value = ''; |
153 | - for ($i = 0; $i < strlen($b36_value); $i ++) { |
|
153 | + for ($i = 0; $i < strlen($b36_value); $i++) { |
|
154 | 154 | $wp_value .= substr($wp_chars, strpos($b36_chars, substr($b36_value, $i, 1)), 1); |
155 | 155 | } |
156 | 156 | |
157 | 157 | if (strlen($wp_value) < 4) { |
158 | - return $prefix . substr('0000' . $wp_value, - 4); |
|
158 | + return $prefix.substr('0000'.$wp_value, - 4); |
|
159 | 159 | } else { |
160 | - return $prefix . $wp_value; |
|
160 | + return $prefix.$wp_value; |
|
161 | 161 | } |
162 | 162 | } |
163 | 163 | } |
@@ -11,16 +11,16 @@ discard block |
||
11 | 11 | * |
12 | 12 | ***************************************************************************/ |
13 | 13 | |
14 | -$opt['rootpath'] = __DIR__ . '/../../'; |
|
15 | -require $opt['rootpath'] . 'lib2/cli.inc.php'; |
|
14 | +$opt['rootpath'] = __DIR__.'/../../'; |
|
15 | +require $opt['rootpath'].'lib2/cli.inc.php'; |
|
16 | 16 | |
17 | 17 | // test for user who runs the cronjob |
18 | 18 | $processUser = posix_getpwuid(posix_geteuid()); |
19 | 19 | if ($processUser['name'] != $opt['cron']['username']) { |
20 | 20 | die( |
21 | - "ERROR: runcron must be run by '" . $opt['cron']['username'] |
|
22 | - . "' but was called by '" . $processUser['name'] . "'\n" . |
|
23 | - "Try something like 'sudo -u " . $opt['cron']['username'] . " php runcron.php'.\n"); |
|
21 | + "ERROR: runcron must be run by '".$opt['cron']['username'] |
|
22 | + . "' but was called by '".$processUser['name']."'\n". |
|
23 | + "Try something like 'sudo -u ".$opt['cron']['username']." php runcron.php'.\n"); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | // ensure that we do not run concurrently |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | } |
35 | 35 | } |
36 | 36 | |
37 | - $modules_dir = $opt['rootpath'] . 'util2/cron/modules/'; |
|
37 | + $modules_dir = $opt['rootpath'].'util2/cron/modules/'; |
|
38 | 38 | $param = count($argv) > 1 ? $argv[1] : ''; |
39 | 39 | |
40 | 40 | if ($param != '' && substr($param, 0, 1) != '-' && !strstr('/', $param)) { |
41 | 41 | // run one job manually for debugging purpose |
42 | 42 | $ignore_interval = true; |
43 | - require $modules_dir . $argv[1] . '.class.php'; |
|
43 | + require $modules_dir.$argv[1].'.class.php'; |
|
44 | 44 | } else { |
45 | 45 | if (cronjobs_enabled()) { |
46 | 46 | $ignore_interval = false; |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | while (false !== ($file = readdir($hDir))) { |
49 | 49 | if (substr($file, -10) == '.class.php') { |
50 | 50 | if ($param == '--show') { |
51 | - echo 'running ' . $file . "\n"; |
|
51 | + echo 'running '.$file."\n"; |
|
52 | 52 | } |
53 | - require $modules_dir . $file; |
|
53 | + require $modules_dir.$file; |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | } |