@@ -6,7 +6,7 @@ |
||
| 6 | 6 | "services" => [ |
| 7 | 7 | "vader" => [ |
| 8 | 8 | "shared" => true, |
| 9 | - "callback" => function () { |
|
| 9 | + "callback" => function() { |
|
| 10 | 10 | $vader = new \Malm18\Vader\VaderHandler(); |
| 11 | 11 | return $vader; |
| 12 | 12 | }, |
@@ -274,13 +274,13 @@ |
||
| 274 | 274 | // $val['color'] = 'red'; |
| 275 | 275 | // } |
| 276 | 276 | |
| 277 | - // $cars = array |
|
| 278 | - // ( |
|
| 279 | - // array("Volvo",22,18), |
|
| 280 | - // array("BMW",15,13), |
|
| 281 | - // array("Saab",5,2), |
|
| 282 | - // array("Land Rover",17,15) |
|
| 283 | - // ); |
|
| 277 | + // $cars = array |
|
| 278 | + // ( |
|
| 279 | + // array("Volvo",22,18), |
|
| 280 | + // array("BMW",15,13), |
|
| 281 | + // array("Saab",5,2), |
|
| 282 | + // array("Land Rover",17,15) |
|
| 283 | + // ); |
|
| 284 | 284 | |
| 285 | 285 | |
| 286 | 286 | // $unixTimestamp = $_POST['timestamp']; |
@@ -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 | } |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | // $session->set("country_name", $ipInfo['country_name']); |
| 76 | 76 | // var_dump($session); |
| 77 | 77 | } |
| 78 | - return $response->redirect("vader/resultpage"); |
|
| 78 | + return $response->redirect("vader/resultpage"); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
@@ -7,9 +7,9 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | - * Check active. |
|
| 11 | - * |
|
| 12 | - */ |
|
| 10 | + * Check active. |
|
| 11 | + * |
|
| 12 | + */ |
|
| 13 | 13 | // public function checkIP($theIP) |
| 14 | 14 | // { |
| 15 | 15 | // $theIP2 = $theIP . " svansen"; |
@@ -196,32 +196,32 @@ discard block |
||
| 196 | 196 | // } |
| 197 | 197 | // } |
| 198 | 198 | |
| 199 | - // /** |
|
| 200 | - // * mainRoll. |
|
| 201 | - // * |
|
| 202 | - // * @return void , void |
|
| 203 | - // */ |
|
| 204 | - // public function mainRoll($human, $computer) |
|
| 205 | - // { |
|
| 206 | - // if ($computer->getActive() == true) { |
|
| 207 | - // $computer->setActive(false); |
|
| 208 | - // $human->setActive(true); |
|
| 209 | - // } else { |
|
| 210 | - // // $human->setTotalScore($human->getTotalScore + $human->getTurnScore); |
|
| 211 | - // $computer->setActive(true); |
|
| 212 | - // $human->setActive(false); |
|
| 213 | - // } |
|
| 214 | - // $computer->setTotalScore($computer->getTotalScore() + $computer->getTurnScore()); |
|
| 215 | - // $human->setTotalScore($human->getTotalScore() + $human->getTurnScore()); |
|
| 216 | - // $computer->setTurnScore(0); |
|
| 217 | - // $human->setTurnScore(0); |
|
| 218 | - // $computer->setRolls(0); |
|
| 219 | - // $human->setRolls(0); |
|
| 220 | - // $human->setDie1(null); |
|
| 221 | - // $human->setDie2(null); |
|
| 222 | - // $computer->setDie1(null); |
|
| 223 | - // $computer->setDie2(null); |
|
| 224 | - // } |
|
| 199 | + // /** |
|
| 200 | + // * mainRoll. |
|
| 201 | + // * |
|
| 202 | + // * @return void , void |
|
| 203 | + // */ |
|
| 204 | + // public function mainRoll($human, $computer) |
|
| 205 | + // { |
|
| 206 | + // if ($computer->getActive() == true) { |
|
| 207 | + // $computer->setActive(false); |
|
| 208 | + // $human->setActive(true); |
|
| 209 | + // } else { |
|
| 210 | + // // $human->setTotalScore($human->getTotalScore + $human->getTurnScore); |
|
| 211 | + // $computer->setActive(true); |
|
| 212 | + // $human->setActive(false); |
|
| 213 | + // } |
|
| 214 | + // $computer->setTotalScore($computer->getTotalScore() + $computer->getTurnScore()); |
|
| 215 | + // $human->setTotalScore($human->getTotalScore() + $human->getTurnScore()); |
|
| 216 | + // $computer->setTurnScore(0); |
|
| 217 | + // $human->setTurnScore(0); |
|
| 218 | + // $computer->setRolls(0); |
|
| 219 | + // $human->setRolls(0); |
|
| 220 | + // $human->setDie1(null); |
|
| 221 | + // $human->setDie2(null); |
|
| 222 | + // $computer->setDie1(null); |
|
| 223 | + // $computer->setDie2(null); |
|
| 224 | + // } |
|
| 225 | 225 | |
| 226 | 226 | |
| 227 | 227 | // /** |
@@ -69,14 +69,14 @@ discard block |
||
| 69 | 69 | public function minLong($longitude) |
| 70 | 70 | { |
| 71 | 71 | |
| 72 | - $minLong = floatval($longitude)-0.6427; |
|
| 72 | + $minLong = floatval($longitude) - 0.6427; |
|
| 73 | 73 | return $minLong; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | public function maxLong($longitude) |
| 77 | 77 | { |
| 78 | 78 | |
| 79 | - $maxLong = floatval($longitude)+0.6427; |
|
| 79 | + $maxLong = floatval($longitude) + 0.6427; |
|
| 80 | 80 | return $maxLong; |
| 81 | 81 | } |
| 82 | 82 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | public function checkOwnIP() |
| 131 | 131 | { |
| 132 | - $remoteAddr = isset($_SERVER['REMOTE_ADDR'])? $_SERVER['REMOTE_ADDR']:'127.0.0.1'; |
|
| 132 | + $remoteAddr = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '127.0.0.1'; |
|
| 133 | 133 | return $remoteAddr; |
| 134 | 134 | } |
| 135 | 135 | |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | // $session->set("country_name", $ipInfo['country_name']); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - return $response->redirect("ip-checker/resultpage"); |
|
| 71 | + return $response->redirect("ip-checker/resultpage"); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | |
@@ -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 |
@@ -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 |