@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$GLOBALS['rootpath'] = __DIR__.'/../'; |
|
3 | +$GLOBALS['rootpath'] = __DIR__ . '/../'; |
|
4 | 4 | |
5 | 5 | require_once __DIR__ . '/../vendor/autoload.php'; |
6 | 6 | |
7 | -require_once __DIR__ .'/../vendor/opencaching/okapi/okapi/index.php'; |
|
7 | +require_once __DIR__ . '/../vendor/opencaching/okapi/okapi/index.php'; |
@@ -140,19 +140,19 @@ discard block |
||
140 | 140 | $gpxTimeFormat = 'Y-m-d\TH:i:s\Z'; |
141 | 141 | |
142 | 142 | $gpxStatus[0] = 'available="False" archived="False"'; // other (unavailable, not archived) |
143 | - $gpxStatus[1] = 'available="True" archived="False"'; // available, not archived |
|
143 | + $gpxStatus[1] = 'available="True" archived="False"'; // available, not archived |
|
144 | 144 | $gpxStatus[2] = 'available="False" archived="False"'; // unavailable, not archived |
145 | - $gpxStatus[3] = 'available="False" archived="True"'; // unavailable, archived |
|
146 | - $gpxStatus[6] = 'available="False" archived="True"'; // locked, visible |
|
145 | + $gpxStatus[3] = 'available="False" archived="True"'; // unavailable, archived |
|
146 | + $gpxStatus[6] = 'available="False" archived="True"'; // locked, visible |
|
147 | 147 | |
148 | 148 | $gpxContainer[1] = 'Other'; |
149 | 149 | $gpxContainer[2] = 'Micro'; |
150 | 150 | $gpxContainer[3] = 'Small'; |
151 | 151 | $gpxContainer[4] = 'Regular'; |
152 | 152 | $gpxContainer[5] = 'Large'; |
153 | - $gpxContainer[6] = 'Large'; // very large |
|
154 | - $gpxContainer[7] = 'Virtual'; // no container |
|
155 | - $gpxContainer[8] = 'Micro'; // nano |
|
153 | + $gpxContainer[6] = 'Large'; // very large |
|
154 | + $gpxContainer[7] = 'Virtual'; // no container |
|
155 | + $gpxContainer[8] = 'Micro'; // nano |
|
156 | 156 | |
157 | 157 | $gpxOcSize[1] = 'Other'; |
158 | 158 | $gpxOcSize[2] = 'Micro'; |
@@ -169,10 +169,10 @@ discard block |
||
169 | 169 | $gpxType[4] = 'Virtual Cache'; |
170 | 170 | $gpxType[5] = 'Webcam Cache'; |
171 | 171 | $gpxType[6] = 'Event Cache'; |
172 | - $gpxType[7] = 'Unknown Cache'; // quiz cache |
|
173 | - $gpxType[8] = 'Unknown Cache'; // maths/physics cache |
|
174 | - $gpxType[9] = 'Unknown Cache'; // moving cache |
|
175 | - $gpxType[10] = 'Traditional Cache'; // drive-in cache |
|
172 | + $gpxType[7] = 'Unknown Cache'; // quiz cache |
|
173 | + $gpxType[8] = 'Unknown Cache'; // maths/physics cache |
|
174 | + $gpxType[9] = 'Unknown Cache'; // moving cache |
|
175 | + $gpxType[10] = 'Traditional Cache'; // drive-in cache |
|
176 | 176 | |
177 | 177 | $gpxOcType[1] = 'Other Cache'; |
178 | 178 | $gpxOcType[2] = 'Traditional Cache'; |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $gpxOcType[5] = 'Webcam Cache'; |
182 | 182 | $gpxOcType[6] = 'Event Cache'; |
183 | 183 | $gpxOcType[7] = 'Quiz Cache'; |
184 | - $gpxOcType[8] = 'Quiz Cache'; // maths/physics cache |
|
184 | + $gpxOcType[8] = 'Quiz Cache'; // maths/physics cache |
|
185 | 185 | $gpxOcType[9] = 'Moving Cache'; |
186 | 186 | $gpxOcType[10] = 'Traditional Cache'; // drive-in cache |
187 | 187 | |
@@ -194,8 +194,8 @@ discard block |
||
194 | 194 | $gpxLogType[9] = 'Archive'; |
195 | 195 | $gpxLogType[10] = 'Owner Maintenance'; |
196 | 196 | $gpxLogType[11] = 'Temporarily Disable Listing'; |
197 | - $gpxLogType[13] = 'Archive'; // locked |
|
198 | - $gpxLogType[14] = 'Archive'; // locked/invisible |
|
197 | + $gpxLogType[13] = 'Archive'; // locked |
|
198 | + $gpxLogType[14] = 'Archive'; // locked/invisible |
|
199 | 199 | |
200 | 200 | $gpxSymNormal = 'Geocache'; |
201 | 201 | $gpxSymFound = 'Geocache Found'; |
@@ -524,9 +524,9 @@ discard block |
||
524 | 524 | $thisline = mb_ereg_replace('{oc_logs}', $oc_logentries, $thisline); |
525 | 525 | |
526 | 526 | // attributes |
527 | - $addAttributes = [-1]; // dummy |
|
527 | + $addAttributes = [-1]; // dummy |
|
528 | 528 | if ($r['type'] == 10) { // Drive-in |
529 | - $addAttributes[] = 24; // near the car / park and grab |
|
529 | + $addAttributes[] = 24; // near the car / park and grab |
|
530 | 530 | } |
531 | 531 | $rsAttributes = sql_slave( |
532 | 532 | " |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | $thiswp = mb_ereg_replace('{type}', text_xmlentities($wp_typename), $thiswp); |
632 | 632 | $thiswp = mb_ereg_replace('{parent}', $r['waypoint'], $thiswp); |
633 | 633 | $thiswp = mb_ereg_replace('{cacheid}', $r['cacheid'], $thiswp); |
634 | - $waypoints .= $thiswp. "\n"; |
|
634 | + $waypoints .= $thiswp . "\n"; |
|
635 | 635 | ++$n; |
636 | 636 | } |
637 | 637 |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | if (count($where) > 0) { |
52 | 52 | foreach ($where as $column => $value) { |
53 | - $queryBuilder->andWhere($column . ' = ' . $queryBuilder->createNamedParameter($value)); |
|
53 | + $queryBuilder->andWhere($column . ' = ' . $queryBuilder->createNamedParameter($value)); |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $databaseArray |
94 | 94 | ); |
95 | 95 | |
96 | - $entity->id = (int) $this->connection->lastInsertId(); |
|
96 | + $entity->id = (int)$this->connection->lastInsertId(); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | ['id' => $entity->id] |
120 | 120 | ); |
121 | 121 | |
122 | - $entity->id = (int) $this->connection->lastInsertId(); |
|
122 | + $entity->id = (int)$this->connection->lastInsertId(); |
|
123 | 123 | |
124 | 124 | return $entity; |
125 | 125 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | 'page_id' => $entity->pageId, |
167 | 167 | 'title' => $entity->title, |
168 | 168 | 'html' => $entity->html, |
169 | - 'position' => (int) $entity->position, |
|
169 | + 'position' => (int)$entity->position, |
|
170 | 170 | 'updated_at' => $entity->updatedAt->format(DateTime::ATOM), |
171 | 171 | 'active' => $entity->active |
172 | 172 | ]; |
@@ -182,13 +182,13 @@ discard block |
||
182 | 182 | public function getEntityFromDatabaseArray(array $data) |
183 | 183 | { |
184 | 184 | $entity = new BlockEntity(); |
185 | - $entity->id = (int) $data['id']; |
|
186 | - $entity->pageId = (int) $data['page_id']; |
|
187 | - $entity->title = (string) $data['title']; |
|
188 | - $entity->html = (string) $data['html']; |
|
189 | - $entity->position = (int) $data['position']; |
|
185 | + $entity->id = (int)$data['id']; |
|
186 | + $entity->pageId = (int)$data['page_id']; |
|
187 | + $entity->title = (string)$data['title']; |
|
188 | + $entity->html = (string)$data['html']; |
|
189 | + $entity->position = (int)$data['position']; |
|
190 | 190 | $entity->updatedAt = new DateTime($data['updated_at']); |
191 | - $entity->active = (bool) $data['active']; |
|
191 | + $entity->active = (bool)$data['active']; |
|
192 | 192 | |
193 | 193 | return $entity; |
194 | 194 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | if (count($where) > 0) { |
54 | 54 | foreach ($where as $column => $value) { |
55 | - $queryBuilder->andWhere($column . ' = ' . $queryBuilder->createNamedParameter($value)); |
|
55 | + $queryBuilder->andWhere($column . ' = ' . $queryBuilder->createNamedParameter($value)); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $databaseArray |
90 | 90 | ); |
91 | 91 | |
92 | - $entity->id = (int) $this->connection->lastInsertId(); |
|
92 | + $entity->id = (int)$this->connection->lastInsertId(); |
|
93 | 93 | |
94 | 94 | return $entity; |
95 | 95 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | ['id' => $entity->id] |
118 | 118 | ); |
119 | 119 | |
120 | - $entity->id = (int) $this->connection->lastInsertId(); |
|
120 | + $entity->id = (int)$this->connection->lastInsertId(); |
|
121 | 121 | |
122 | 122 | return $entity; |
123 | 123 | } |
@@ -180,13 +180,13 @@ discard block |
||
180 | 180 | public function getEntityFromDatabaseArray(array $data) |
181 | 181 | { |
182 | 182 | $entity = new PageEntity(); |
183 | - $entity->id = (int) $data['id']; |
|
184 | - $entity->slug = (string) $data['slug']; |
|
185 | - $entity->metaKeywords = (string) $data['meta_keywords']; |
|
186 | - $entity->metaDescription = (string) $data['meta_description']; |
|
187 | - $entity->metaSocial = (string) $data['meta_social']; |
|
183 | + $entity->id = (int)$data['id']; |
|
184 | + $entity->slug = (string)$data['slug']; |
|
185 | + $entity->metaKeywords = (string)$data['meta_keywords']; |
|
186 | + $entity->metaDescription = (string)$data['meta_description']; |
|
187 | + $entity->metaSocial = (string)$data['meta_social']; |
|
188 | 188 | $entity->updatedAt = new DateTime($data['updated_at']); |
189 | - $entity->active = (bool) $data['active']; |
|
189 | + $entity->active = (bool)$data['active']; |
|
190 | 190 | |
191 | 191 | return $entity; |
192 | 192 | } |
@@ -175,15 +175,15 @@ |
||
175 | 175 | public function getEntityFromDatabaseArray(array $data) |
176 | 176 | { |
177 | 177 | $entity = new CountryEntity(); |
178 | - $entity->short = (string) $data['short']; |
|
179 | - $entity->name = (string) $data['name']; |
|
180 | - $entity->de = (string) $data['de']; |
|
181 | - $entity->en = (string) $data['en']; |
|
182 | - $entity->translationId = (int) $data['trans_id']; |
|
183 | - $entity->listDefaultDe = (bool) $data['list_default_de']; |
|
184 | - $entity->listDefaultEn = (bool) $data['list_default_en']; |
|
185 | - $entity->sortDe = (string) $data['sort_de']; |
|
186 | - $entity->sortEn = (string) $data['sort_en']; |
|
178 | + $entity->short = (string)$data['short']; |
|
179 | + $entity->name = (string)$data['name']; |
|
180 | + $entity->de = (string)$data['de']; |
|
181 | + $entity->en = (string)$data['en']; |
|
182 | + $entity->translationId = (int)$data['trans_id']; |
|
183 | + $entity->listDefaultDe = (bool)$data['list_default_de']; |
|
184 | + $entity->listDefaultEn = (bool)$data['list_default_en']; |
|
185 | + $entity->sortDe = (string)$data['sort_de']; |
|
186 | + $entity->sortEn = (string)$data['sort_en']; |
|
187 | 187 | |
188 | 188 | return $entity; |
189 | 189 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $databaseArray |
104 | 104 | ); |
105 | 105 | |
106 | - $entity->id = (int) $this->connection->lastInsertId(); |
|
106 | + $entity->id = (int)$this->connection->lastInsertId(); |
|
107 | 107 | |
108 | 108 | return $entity; |
109 | 109 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | ['id' => $entity->id] |
132 | 132 | ); |
133 | 133 | |
134 | - $entity->id = (int) $this->connection->lastInsertId(); |
|
134 | + $entity->id = (int)$this->connection->lastInsertId(); |
|
135 | 135 | |
136 | 136 | return $entity; |
137 | 137 | } |
@@ -216,16 +216,16 @@ discard block |
||
216 | 216 | public function getEntityFromDatabaseArray(array $data) |
217 | 217 | { |
218 | 218 | $entity = new UserEntity(); |
219 | - $entity->id = (int) $data['user_id']; |
|
220 | - $entity->username = (string) $data['username']; |
|
221 | - $entity->password = (string) $data['password']; |
|
222 | - $entity->email = (string) $data['email']; |
|
223 | - $entity->latitude = (double) $data['latitude']; |
|
224 | - $entity->longitude = (double) $data['longitude']; |
|
225 | - $entity->isActive = (bool) $data['is_active_flag']; |
|
226 | - $entity->firstname = (string) $data['first_name']; |
|
227 | - $entity->lastname = (string) $data['last_name']; |
|
228 | - $entity->country = (string) $data['country']; |
|
219 | + $entity->id = (int)$data['user_id']; |
|
220 | + $entity->username = (string)$data['username']; |
|
221 | + $entity->password = (string)$data['password']; |
|
222 | + $entity->email = (string)$data['email']; |
|
223 | + $entity->latitude = (double)$data['latitude']; |
|
224 | + $entity->longitude = (double)$data['longitude']; |
|
225 | + $entity->isActive = (bool)$data['is_active_flag']; |
|
226 | + $entity->firstname = (string)$data['first_name']; |
|
227 | + $entity->lastname = (string)$data['last_name']; |
|
228 | + $entity->country = (string)$data['country']; |
|
229 | 229 | $entity->language = strtolower($data['language']); |
230 | 230 | |
231 | 231 | return $entity; |
@@ -211,15 +211,15 @@ |
||
211 | 211 | public function getEntityFromDatabaseArray(array $data) |
212 | 212 | { |
213 | 213 | $entity = new LanguageEntity(); |
214 | - $entity->short = (string) strtolower($data['short']); |
|
215 | - $entity->name = (string) $data['name']; |
|
216 | - $entity->nativeName = (string) $data['native_name']; |
|
217 | - $entity->de = (string) $data['de']; |
|
218 | - $entity->en = (string) $data['en']; |
|
219 | - $entity->translationId = (int) $data['trans_id']; |
|
220 | - $entity->listDefaultDe = (bool) $data['list_default_de']; |
|
221 | - $entity->listDefaultEn = (bool) $data['list_default_en']; |
|
222 | - $entity->isTranslated = (bool) $data['is_translated']; |
|
214 | + $entity->short = (string)strtolower($data['short']); |
|
215 | + $entity->name = (string)$data['name']; |
|
216 | + $entity->nativeName = (string)$data['native_name']; |
|
217 | + $entity->de = (string)$data['de']; |
|
218 | + $entity->en = (string)$data['en']; |
|
219 | + $entity->translationId = (int)$data['trans_id']; |
|
220 | + $entity->listDefaultDe = (bool)$data['list_default_de']; |
|
221 | + $entity->listDefaultEn = (bool)$data['list_default_en']; |
|
222 | + $entity->isTranslated = (bool)$data['is_translated']; |
|
223 | 223 | |
224 | 224 | return $entity; |
225 | 225 | } |