dpodium / yii2-geoip

Yii2 Component to allow for easy usage of the MaxMind Free dbs.
GNU General Public License v3.0
8 stars 3 forks source link

Where should be the database file putted? #2

Open cufano opened 5 years ago

cufano commented 5 years ago

Hello, I installed the extension and download updated Geolite2 database. But where should I put the updated database file? There's a method to indicate the directory for this file.

No information about that in the readme.

darrenng-dpodium commented 5 years ago

Good day! The database is already included in the package. It is located at components/db. It is periodically updated with new database from Maxmind. If you need to use your own database, you can overwrite the path when you declare the component in yii2 main, like so:

return [
    'components' => [
    ...
        'geoip' => [
                   'class' => 'dpodium\yii2\geoip\components\CGeoIP',
                   'countryDbPath' => '/absolute/path/to/GeoLite2-Country.mmdb'
               ],
        ...
    ],
    ...
];
cufano commented 5 years ago

Thanks for the info! I can use the component declaration for configure the exact database folder. We need to update the database each month.