@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * ANY METHOD mountpoint/ |
68 | 68 | * ANY METHOD mountpoint/index |
69 | 69 | * |
70 | - */ |
|
70 | + */ |
|
71 | 71 | // public function indexActionGet() |
72 | 72 | // { |
73 | 73 | // // $request = $this->di->get("request"); |
@@ -199,12 +199,12 @@ discard block |
||
199 | 199 | |
200 | 200 | public function jsonVaderActionPost() : object |
201 | 201 | { |
202 | - // $session = $this->di->session; |
|
203 | - // $ipHandler = new \Malm18\IPChecker\IpHandler(); |
|
204 | - $request = $this->di->get("request"); |
|
205 | - $response = $this->di->get("response"); |
|
206 | - $theIP = $request->getPost("ip1"); |
|
207 | - $pastOrFuture = $request->getPost("pastOrFuture"); |
|
202 | + // $session = $this->di->session; |
|
203 | + // $ipHandler = new \Malm18\IPChecker\IpHandler(); |
|
204 | + $request = $this->di->get("request"); |
|
205 | + $response = $this->di->get("response"); |
|
206 | + $theIP = $request->getPost("ip1"); |
|
207 | + $pastOrFuture = $request->getPost("pastOrFuture"); |
|
208 | 208 | |
209 | 209 | // if (!is_null($theIP)) { |
210 | 210 | // $ipInfo = $ipHandler->checkIP($theIP); |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | // // $session->set("type", $ipInfo['type']); |
214 | 214 | // } |
215 | 215 | |
216 | - return $response->redirect("json-vader?ip=$theIP&pastOrFuture=$pastOrFuture"); |
|
216 | + return $response->redirect("json-vader?ip=$theIP&pastOrFuture=$pastOrFuture"); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | // public function jsonResultPageActionGet() : object |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $apiKey = $keys["darkskyKey"]; |
114 | 114 | $endStuff = '?exclude=minutely,hourly,currently,alerts,flags&extend=daily&lang=sv&units=si'; |
115 | 115 | |
116 | - if ($pastOrFuture=="future") { |
|
116 | + if ($pastOrFuture == "future") { |
|
117 | 117 | $requestUrl = $url1 . $apiKey . "/" . $latitude . "," . $longitude . $endStuff; |
118 | 118 | // $requestUrl = 'https://nominatim.openstreetmap.org/?format=json&addressdetails=1&q=bakery+in+berlin+wedding&format=json&limit=1&[email protected]'; |
119 | 119 | $curl = curl_init($requestUrl); |
@@ -150,16 +150,16 @@ discard block |
||
150 | 150 | |
151 | 151 | |
152 | 152 | |
153 | - for ($i=0; $i < 30; $i++) { |
|
153 | + for ($i = 0; $i < 30; $i++) { |
|
154 | 154 | $unixTime = time() - ($i * 24 * 60 * 60); |
155 | - $requestUrl = $url1 . $apiKey . "/" . $latitude . "," . $longitude . ','. $unixTime . $endStuff; |
|
155 | + $requestUrl = $url1 . $apiKey . "/" . $latitude . "," . $longitude . ',' . $unixTime . $endStuff; |
|
156 | 156 | $multiCurl[$i] = curl_init(); |
157 | 157 | curl_setopt($multiCurl[$i], CURLOPT_URL, $requestUrl); |
158 | 158 | curl_setopt($multiCurl[$i], CURLOPT_HEADER, 0); |
159 | 159 | curl_setopt($multiCurl[$i], CURLOPT_RETURNTRANSFER, 1); |
160 | 160 | curl_multi_add_handle($mhbutlonger, $multiCurl[$i]); |
161 | 161 | } |
162 | - $index=null; |
|
162 | + $index = null; |
|
163 | 163 | do { |
164 | 164 | curl_multi_exec($mhbutlonger, $index); |
165 | 165 | } while ($index > 0); |
@@ -177,12 +177,12 @@ discard block |
||
177 | 177 | // $anArray = []; |
178 | 178 | // $data = []; |
179 | 179 | $data2 = []; |
180 | - $i=0; |
|
180 | + $i = 0; |
|
181 | 181 | foreach ($response as $item) { |
182 | 182 | $data = json_decode($item, true); |
183 | 183 | $data2[$i] = $data['daily']['data'][0]; |
184 | 184 | // $data[$i] = $item; |
185 | - $i=$i+1; |
|
185 | + $i = $i + 1; |
|
186 | 186 | } |
187 | 187 | // $daily['data'] = $data; |
188 | 188 | // $anArray['daily'] = $daily; |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $weather2 = []; |
237 | 237 | $locale = 'sv_SE.utf8'; |
238 | 238 | setlocale(LC_TIME, $locale); |
239 | - $i=0; |
|
239 | + $i = 0; |
|
240 | 240 | foreach ($weather as $day) { |
241 | 241 | // array_push($weather2, $day['time']); |
242 | 242 | $unixTimestamp = $day['time']; |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | $weather2[$i]['windSpeed'] = round($day['windSpeed']); |
259 | 259 | $weather2[$i]['windBearing'] = $day['windBearing']; |
260 | 260 | // array_push($weather2, $datetime2); |
261 | - $i=$i+1; |
|
261 | + $i = $i + 1; |
|
262 | 262 | } |
263 | 263 | return $weather2; |
264 | 264 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * ANY METHOD mountpoint/ |
68 | 68 | * ANY METHOD mountpoint/index |
69 | 69 | * |
70 | - */ |
|
70 | + */ |
|
71 | 71 | // public function indexActionGet() |
72 | 72 | // { |
73 | 73 | // // $request = $this->di->get("request"); |
@@ -181,11 +181,11 @@ discard block |
||
181 | 181 | |
182 | 182 | public function ipJsonCheckerActionPost() : object |
183 | 183 | { |
184 | - // $session = $this->di->session; |
|
185 | - // $ipHandler = new IpHandler(); |
|
186 | - $request = $this->di->get("request"); |
|
187 | - $response = $this->di->get("response"); |
|
188 | - $theIP = $request->getPost("ip1"); |
|
184 | + // $session = $this->di->session; |
|
185 | + // $ipHandler = new IpHandler(); |
|
186 | + $request = $this->di->get("request"); |
|
187 | + $response = $this->di->get("response"); |
|
188 | + $theIP = $request->getPost("ip1"); |
|
189 | 189 | |
190 | 190 | // if (!is_null($theIP)) { |
191 | 191 | // $ipInfo = $ipHandler->checkIP($theIP); |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | // // $session->set("type", $ipInfo['type']); |
196 | 196 | // } |
197 | 197 | |
198 | - return $response->redirect("ip-json-checker?ip=$theIP"); |
|
198 | + return $response->redirect("ip-json-checker?ip=$theIP"); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | // public function jsonResultPageActionGet() : object |