{"id":19664602,"url":"https://github.com/sourcebroker/ip2geo","last_synced_at":"2025-04-28T21:33:46.446Z","repository":{"id":57056095,"uuid":"197375653","full_name":"sourcebroker/ip2geo","owner":"sourcebroker","description":"TYPO3 extension ip2geo. Returns geo data based on IP - uses Maxmind databases (free/commercial).","archived":false,"fork":false,"pushed_at":"2020-04-06T10:46:03.000Z","size":43,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-07-14T02:04:19.854Z","etag":null,"topics":["ip2geo","maxmind","typo3","typo3-cms","typo3-cms-extension"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sourcebroker.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-17T11:24:03.000Z","updated_at":"2020-12-18T21:37:06.000Z","dependencies_parsed_at":"2022-08-24T14:52:53.916Z","dependency_job_id":null,"html_url":"https://github.com/sourcebroker/ip2geo","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcebroker%2Fip2geo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcebroker%2Fip2geo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcebroker%2Fip2geo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcebroker%2Fip2geo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourcebroker","download_url":"https://codeload.github.com/sourcebroker/ip2geo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224133776,"owners_count":17261305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ip2geo","maxmind","typo3","typo3-cms","typo3-cms-extension"],"created_at":"2024-11-11T16:18:18.659Z","updated_at":"2024-11-11T16:18:19.531Z","avatar_url":"https://github.com/sourcebroker.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"TYPO3 Extension ip2geo\n======================\n\n    .. image:: https://poser.pugx.org/sourcebroker/ip2geo/license\n       :target: https://packagist.org/packages/sourcebroker/ip2geo\n\n.. contents:: :local:\n\nWhat does it do?\n----------------\n\nThis extension provides scheduler job to download maxmind database (free or commercial) and some small class with methods\nto get interesting content like country, continent etc.\n\nHow to install?\n---------------\n\n1) Install using composer:\n\n   ::\n\n    composer require sourcebroker/ip2geo\n\n2) Go to Scheduler module and add new job \"Download geolocation database\"\n\n3) While adding scheduler job you need two parameters:\n\n   a) ``Database name``. This can an be any string. Example: \"freeCountry\", \"commercialCountry\". This name will be used\n      later in php code like ``GeoIp::getInstance('freeCountry')`` .\n\n   b) ``Download URL``. Maxmind database download link.\n\n      * For country lite database the url is: https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz\n\n      * For city lite database the url is: https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz\n\n      * If the links above does not work here is the page at maxmind with list databases: https://dev.maxmind.com/geoip/geoip2/geolite2/\n\n4) Run the scheduler and check folder ``/uploads/tx_ip2geo/``. The database should be downloaded there.\n\nHow to use?\n---------------\n\nIn your code get the data with following call:\n\n1) For country database:\n\n   ::\n\n     $countryCode = GeoIp::getInstance('freeCountry')-\u003egetCountryCode(); // assuming you named database with \"freeCountry\" in scheduler task\n\n   For IP 83.97.23.149 you will get \"DE\" as response:\n\n   ::\n\n\n2) For city database:\n\n   ::\n\n     $locationData = GeoIp::getInstance('freeCity')-\u003egetLocation(); // assuming you named database with \"freeCity\" in scheduler task\n\n   For IP 83.97.23.149 you will get following data as response:\n\n   ::\n\n     Array\n     (\n        [continentCode] =\u003e EU\n        [countryCode] =\u003e DE\n        [countryName] =\u003e Germany\n        [city] =\u003e Berlin\n        [postalCode] =\u003e 10178\n        [latitude] =\u003e 52.5196\n        [longitude] =\u003e 13.4069\n     )\n\nAdditional options\n------------------\n\nYou can set some options for this extension in ``$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ip2geo']``. You can use\n``typo3conf/LocalConfiguration`` file to store this values.\n\n1) ``defaultLocalIP``\n   For local development you IP is usually 127.0.0.1 and this IP of course does not exist in Maxmind database. For this\n   situation Maxminf API will return \"The address 127.0.0.1 is not in the database.\". You can fix it by setting default\n   IP if the IP is detected as 127.0.0.1. Example configuration:\n\n    ::\n\n          'EXTCONF' =\u003e [\n            'ip2geo' =\u003e [\n              'defaultLocalIP' =\u003e '83.97.23.149',\n            ],\n          ],\n\n2) ``fakeIpHeaderName``\n   This is a name of header which you can use to overwrite the value of IP. This value must be unique so nobody except you\n   can overwrite IP. TIP: a nice chrome extension for setting headers is \"ModHeader\". Example:\n\n    ::\n\n          'EXTCONF' =\u003e [\n            'ip2geo' =\u003e [\n              'fakeIpHeaderName' =\u003e 'myFakeIpHeader1991718263162831',\n            ],\n          ],\n\n\n``fakeIpHeaderName`` has precedence over ``defaultLocalIP`` when both are set.\n\n\nChangelog\n---------\n\nSee https://github.com/sourcebroker/ip2geo/blob/master/CHANGELOG.rst\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcebroker%2Fip2geo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourcebroker%2Fip2geo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcebroker%2Fip2geo/lists"}