@@ -25,17 +25,17 @@ discard block |
||
| 25 | 25 | public function run() |
| 26 | 26 | { |
| 27 | 27 | ini_set('memory_limit', '256M'); |
| 28 | - Capsule::transaction(function () { |
|
| 28 | + Capsule::transaction(function() { |
|
| 29 | 29 | $response = []; |
| 30 | 30 | $offset = 0; |
| 31 | 31 | $arrCities = []; |
| 32 | - $regions = Capsule::table(config('geography.nameTable.regions'))->get()->pluck('id', 'title')->toArray(); |
|
| 33 | - $country = Capsule::table(config('geography.nameTable.country'))->get(); |
|
| 32 | + $regions = Capsule::table(config('geography.nameTable.regions'))->get()->pluck('id', 'title')->toArray(); |
|
| 33 | + $country = Capsule::table(config('geography.nameTable.country'))->get(); |
|
| 34 | 34 | |
| 35 | 35 | foreach ($country as $concreteCountry) |
| 36 | 36 | { |
| 37 | 37 | do { |
| 38 | - $body = file_get_contents( |
|
| 38 | + $body = file_get_contents( |
|
| 39 | 39 | 'https://api.vk.com/method/database.getCities?v=5.5&country_id=' |
| 40 | 40 | . $concreteCountry->id |
| 41 | 41 | . '&need_all=1&count=1000&offset=' |
@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | ]; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - $response = array_merge($response, $responseArray['response']['items']); |
|
| 56 | + $response = array_merge($response, $responseArray['response']['items']); |
|
| 57 | 57 | $offset += 1000; |
| 58 | 58 | |
| 59 | 59 | Capsule::table('cities')->insert($arrCities); |
| 60 | 60 | $arrCities = []; |
| 61 | - } while( ( count($responseArray['response']['items']) > 0) ); |
|
| 61 | + } while ((count($responseArray['response']['items']) > 0)); |
|
| 62 | 62 | } |
| 63 | 63 | }); |
| 64 | 64 | } |