Skip to content

Commit

Permalink
fix files path
Browse files Browse the repository at this point in the history
  • Loading branch information
igaster committed Mar 11, 2017
1 parent 9cbfdc5 commit b93c472
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ What you dont get:
# Instructions

- Download & unzip "hieararcy.txt" & "allCountries.txt" from geonames.org (http://download.geonames.org/export/dump)
- Save to your app's storage folder ('\storage')


[Tip] Download on your remote server with:
```
wget http://download.geonames.org/export/dump/allCountries.zip && unzip allCountries.zip && rm allCountries.zip
wget http://download.geonames.org/export/dump/hierarchy.zip && unzip hierarchy.zip && rm hierarchy.zip
```

- Save to your app's storage folder ('\storage')
- Install with copmoser. Run:

```
Expand All @@ -44,7 +45,7 @@ composer require igaster/laravel_cities

```
artisan migrate
artisan geo:load
artisan geo:seed
```

Note: If you don't want all the countries, you can download only country specific files (eg US.txt) and import each one of them with:
Expand Down
4 changes: 2 additions & 2 deletions src/commands/parseGeoFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class parseGeoFile extends Command
{
protected $signature = 'geo:load {country?} {--append}';
protected $signature = 'geo:seed {country?} {--append}';
protected $description = 'Load + Parse + Save to DB a geodata file.';

private $pdo;
Expand Down Expand Up @@ -96,7 +96,7 @@ public function handle() {
$this->info(" Finished Reading File. $count items loaded</info>");

// Read hierarchy
$fileName = realpath(__DIR__.'/../../data/hierarchy.txt');
$fileName = storage_path('allCountries.txt');
$this->info("Opening File '$fileName'</info>");
$handle = fopen($fileName, 'r');
$filesize = filesize($fileName);
Expand Down

0 comments on commit b93c472

Please sign in to comment.