Skip to content

Commit

Permalink
Merge pull request #25 from dotkernel/issue-24
Browse files Browse the repository at this point in the history
Issue: #24: Unable to synch database files.
  • Loading branch information
alexmerlin authored Aug 3, 2023
2 parents 2aee640 + c38a4ed commit ce2b898
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/Service/LocationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use Dot\GeoIP\Data\OrganizationData;
use Exception;
use GeoIp2\Database\Reader;
use MaxMind\Db\Reader\InvalidDatabaseException;
use MaxMind\Db\Reader\Metadata;
use Throwable;

Expand All @@ -33,6 +32,7 @@ class LocationService implements LocationServiceInterface
protected Reader $countryReader;
protected Reader $cityReader;
protected Reader $asnReader;
protected array $config = [];
public const DATABASE_ALL = 'all';
public const DATABASE_ASN = 'asn';
public const DATABASE_CITY = 'city';
Expand All @@ -42,17 +42,10 @@ class LocationService implements LocationServiceInterface
self::DATABASE_CITY => 'GeoLite2-City.mmdb',
self::DATABASE_COUNTRY => 'GeoLite2-Country.mmdb',
];
protected array $config = [];

/**
* @throws InvalidDatabaseException
*/
public function __construct(array $config)
{
$this->config = $config;
$this->countryReader = $this->getDatabaseReader(self::DATABASE_COUNTRY);
$this->cityReader = $this->getDatabaseReader(self::DATABASE_COUNTRY);
$this->asnReader = $this->getDatabaseReader(self::DATABASE_ASN);
$this->config = $config;
}

public function getConfigs(): array
Expand Down

0 comments on commit ce2b898

Please sign in to comment.