From 19887f0ed84938b48d269d58bac65359fea83415 Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Tue, 30 Jul 2019 17:05:44 +0300 Subject: [PATCH 1/4] Add a Symfony Bundle for the Maxmind GeoIP2 API --- gpslab/geoip2/1.1/config/packages/gpslab_geoip.yaml | 9 +++++++++ gpslab/geoip2/1.1/manifest.json | 8 ++++++++ 2 files changed, 17 insertions(+) create mode 100644 gpslab/geoip2/1.1/config/packages/gpslab_geoip.yaml create mode 100644 gpslab/geoip2/1.1/manifest.json diff --git a/gpslab/geoip2/1.1/config/packages/gpslab_geoip.yaml b/gpslab/geoip2/1.1/config/packages/gpslab_geoip.yaml new file mode 100644 index 00000000..6cbebda4 --- /dev/null +++ b/gpslab/geoip2/1.1/config/packages/gpslab_geoip.yaml @@ -0,0 +1,9 @@ +gpslab_geoip: + # Path to download GeoIP database. + cache: '%kernel.cache_dir%/GeoLite2-City.mmdb' + + # URL for download new GeoIP database. + url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz' + + # Get model data in this locale + locales: [ '%locale%' ] diff --git a/gpslab/geoip2/1.1/manifest.json b/gpslab/geoip2/1.1/manifest.json new file mode 100644 index 00000000..6d8910f1 --- /dev/null +++ b/gpslab/geoip2/1.1/manifest.json @@ -0,0 +1,8 @@ +{ + "bundles": { + "GpsLab\\Bundle\\GeoIP2Bundle\\GpsLabGeoIP2Bundle": ["all"] + }, + "composer-scripts": { + "geoip2:update": "symfony-cmd" + } +} From 6934c37489f63a640575e67cd88aba5b6277aef1 Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Tue, 30 Jul 2019 17:21:11 +0300 Subject: [PATCH 2/4] add "copy-from-recipe" section --- gpslab/geoip2/1.1/manifest.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gpslab/geoip2/1.1/manifest.json b/gpslab/geoip2/1.1/manifest.json index 6d8910f1..1dd03011 100644 --- a/gpslab/geoip2/1.1/manifest.json +++ b/gpslab/geoip2/1.1/manifest.json @@ -2,6 +2,9 @@ "bundles": { "GpsLab\\Bundle\\GeoIP2Bundle\\GpsLabGeoIP2Bundle": ["all"] }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/" + }, "composer-scripts": { "geoip2:update": "symfony-cmd" } From a65212083d71f557c27f52da56f3381465107626 Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Tue, 30 Jul 2019 17:34:04 +0300 Subject: [PATCH 3/4] add default parameter "%locale%" --- gpslab/geoip2/1.1/manifest.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gpslab/geoip2/1.1/manifest.json b/gpslab/geoip2/1.1/manifest.json index 1dd03011..0e2950be 100644 --- a/gpslab/geoip2/1.1/manifest.json +++ b/gpslab/geoip2/1.1/manifest.json @@ -2,6 +2,9 @@ "bundles": { "GpsLab\\Bundle\\GeoIP2Bundle\\GpsLabGeoIP2Bundle": ["all"] }, + "container": { + "locale": "en" + }, "copy-from-recipe": { "config/": "%CONFIG_DIR%/" }, From ffb3e9d15695ab09949b8368cf016f6c4645a8fd Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Tue, 30 Jul 2019 17:47:39 +0300 Subject: [PATCH 4/4] remove parameter "%locale%" --- gpslab/geoip2/1.1/config/packages/gpslab_geoip.yaml | 2 +- gpslab/geoip2/1.1/manifest.json | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/gpslab/geoip2/1.1/config/packages/gpslab_geoip.yaml b/gpslab/geoip2/1.1/config/packages/gpslab_geoip.yaml index 6cbebda4..390e9984 100644 --- a/gpslab/geoip2/1.1/config/packages/gpslab_geoip.yaml +++ b/gpslab/geoip2/1.1/config/packages/gpslab_geoip.yaml @@ -6,4 +6,4 @@ gpslab_geoip: url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz' # Get model data in this locale - locales: [ '%locale%' ] + locales: [ 'en' ] diff --git a/gpslab/geoip2/1.1/manifest.json b/gpslab/geoip2/1.1/manifest.json index 0e2950be..1dd03011 100644 --- a/gpslab/geoip2/1.1/manifest.json +++ b/gpslab/geoip2/1.1/manifest.json @@ -2,9 +2,6 @@ "bundles": { "GpsLab\\Bundle\\GeoIP2Bundle\\GpsLabGeoIP2Bundle": ["all"] }, - "container": { - "locale": "en" - }, "copy-from-recipe": { "config/": "%CONFIG_DIR%/" },