bordeux / geoname-bundle Goto Github PK
View Code? Open in Web Editor NEWGeoname bundle for Symfony 3/4
License: Do What The F*ck You Want To Public License
Geoname bundle for Symfony 3/4
License: Do What The F*ck You Want To Public License
I have a problem with command php bin/console bordeux:geoname:import
Type error: Argument 4 passed to Symfony\Component\Console\Input\InputOption::__construct() must be of the type string, null given, called in /var/www/vendor/symfony/console/Command/Command.php on line 388
but problem was fixed into the master branch but not included to the last version.
It possible to publish new version of bundle?
I quite like Symfony's Intl bundle, which provides data about countries, currency and timezones. https://symfony.com/doc/current/components/intl.html
Geonames provides so much data, and this bundle loads it. My idea is to add a service to the bundle that allows the developer access to administrative data, like "state" and "city". (in quotes because they're not accurate, but easily understandable.)
If the bundle used its own entity manager, it could store the data in SQLite. Of course, there would need to be a step to load the data. So the workflow would be:
Then the service could provider a wrapper to the repository lookups, using either the 2 or 3 letter ISO codes (for the higher level) or the Ascii name or geoname ID for the lower levels.
Thoughts?
An exception occurred while executing 'INSERT INTO geo__country (id, iso, iso3, iso_numeric, fips, name, capital, area, population, tld, currency, currency_name, phone_prefix, postal_format, postal
_regex, languages, geoname_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["6251999", "CA", "CAN", "124", "CA", "Canada", "Ottawa", 9984670, 33679000, ".ca", "CAD", "Do
llar", "1", "@#@ #@#", "^([ABCEGHJKLMNPRSTVXY]\\d[ABCEGHJKLMNPRSTVWXYZ]) ?(\\d[ABCEGHJKLMNPRSTVWXYZ]\\d)$", "[\"en-CA\",\"fr-CA\",\"iu\"]", 6251999]:
SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'postal_regex' at row 1
at master
branch
Hello there,
I'm trying to use the geoname bundle you provide in SF5 application,
Actually, i've installed using composer your package, and updated config/bundles.php with the following :
Bordeux\Bundle\GeoNameBundle\BordeuxGeoNameBundle::class => ['all' => true],
After running a schema update, i'm getting this error :
2021-01-30T19:28:38+01:00 [critical] Uncaught Error: Too few arguments to function Symfony\Component\Config\Definition\Builder\TreeBuilder::__construct(), 0 passed in /home/brawcks/Projects/cowww/code-projet/symfony/vendor/bordeux/geoname-bundle/DependencyInjection/Configuration.php on line 20 and at least 1 expected
Do you have any advice on what should i do ? In case i find what's wrong, i'll close this issue.
Thanks if you can provide some help :)
++
bordeux:geoname:import". Message: "An exception occurred while executing a query: SQLSTATE[22003]: Numeric value out of range: 7 ERREUR: la valeur « 2400000000 » est en dehors des limites pour le type integer" {"exception":"[object] (Doctrine\\DBAL\\Exception\\DriverException(code: 7): An exception occurred while executing a query: SQLSTATE[22003]: Numeric value out of range: 7 ERREUR: la valeur « **2400000000** » est en dehors des limites pour le type integer at /var/www/vendor/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php:87)\n[previous exception] [object] (Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 7): SQLSTATE[22003]: Numeric value out of range: 7 ERREUR: la valeur « 2400000000 » est en dehors des limites pour le type integer at /var/www/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)\n[previous exception] [object] (PDOException(code: 22003): SQLSTATE[22003]: Numeric value out of range: 7 ERREUR: la valeur « 2400000000 » est en dehors des limites pour le type integer at /var/www/vendor/doctrine/dbal/src/Driver/PDO/Statement.php:130)","command":"bordeux:geoname:import","message":"An exception occurred while executing a query: SQLSTATE[22003]: Numeric value out of range: 7 ERREUR: la valeur « 2400000000 » est en dehors des limites pour le type integer"} []
all int4 convert to int8, but... error,
found value 2400000000 in population? (int8) allcountry file
11812257 Commonwealth of Nations Commonwealth of Nations British Commonwealth of Nations 51.50488 -0.13602 A ZN GB AG,AU,BB,BD,BN,BS,BW,BZ,CA,CM,CY,DM,FJ,GB,GD,GH,GY,IN,JM,KE,KI,KN,LC,LK,LS,MT,MU,MW,MY,MZ,NA,NG,NR,NZ,PG,PK,RW,SB,SC,SG,SL,SZ,TO,TT,TV,TZ,UG,VC,VU,WS,ZA,ZM 2400000000 19 Europe/London 2018-09-02
Fails while importing https://download.geonames.org/export/dump/allCountries.zip#allCountries.txt
Environment
Any ideas?
Thank You!
Steps To reproducs:
[WARNING] Not passing the "--complete" option to "doctrine:schema:update" is deprecated and will
not be supported when using doctrine/dbal 4
Updating database schema...
18 queries were executed
[OK] Database schema updated successfully!
php bin/console bordeux:geoname:import --env=prod
Start importing TimeZones from https://download.geonames.org/export/dump/timeZones.txt
100/100 [======================] 100% < 1 sec/< 1 sec Mem: 8.0 MiB Downloading data for TimeZones100/100 [==========================] 100% < 1 sec/< 1 sec Mem: 14.0 MiB Importing data: TimeZones
Finished importing TimeZones
Start importing Administrative from https://download.geonames.org/export/dump/admin1CodesASCII.txt
100/100 [================] 100% < 1 sec/< 1 sec Mem: 14.0 MiB Downloading data for Administrative100/100 [=====================] 100% 1 sec/1 sec Mem: 26.0 MiB Importing data: Administrative
Finished importing Administrative
Start importing Administrative 2 from https://download.geonames.org/export/dump/admin2Codes.txt
100/100 [==============] 100% < 1 sec/< 1 sec Mem: 26.0 MiB Downloading data for Administrative 2100/100 [===================] 100% 4 secs/4 secs Mem: 48.0 MiB Importing data: Administrative 2
Finished importing Administrative 2
Start importing Administrative 2 from https://download.geonames.org/export/dump/admin2Codes.txt
100/100 [==============] 100% < 1 sec/< 1 sec Mem: 48.0 MiB Downloading data for Administrative 2100/100 [===================] 100% 3 secs/3 secs Mem: 48.0 MiB Importing data: Administrative 2
Finished importing Administrative 2
Start importing GeoNames from https://download.geonames.org/export/dump/allCountries.zip#allCountries.txt
100/100 [======================] 100% 19 secs/19 secs Mem: 48.0 MiB Downloading data for GeoNames 0/100 [>--------------------------] 0% < 1 sec/< 1 sec Mem: 48.0 MiB Importing data: GeoNames{"message":"Error thrown while running command "bordeux:geoname:import --env=prod". Message: "An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '>>'geoname_id')::integer,\n (_v.value->>'name'),\n ...' at line 22"","context":{"exception":{"class":"Doctrine\DBAL\Exception\SyntaxErrorException","message":"An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '>>'geoname_id')::integer,\n (_v.value->>'name'),\n ...' at line 22","code":1064,"file":"/Users/pascal/PhpstormProjects/Elektra/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:86","previous":{"class":"Doctrine\DBAL\Driver\PDO\Exception","message":"SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '>>'geoname_id')::integer,\n (_v.value->>'name'),\n ...' at line 22","code":1064,"file":"/Users/pascal/PhpstormProjects/Elektra/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28","previous":{"class":"PDOException","message":"SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '>>'geoname_id')::integer,\n (_v.value->>'name'),\n ...' at line 22","code":42000,"file":"/Users/pascal/PhpstormProjects/Elektra/vendor/doctrine/dbal/src/Driver/PDO/Statement.php:121"}}},"command":"bordeux:geoname:import --env=prod","message":"An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '>>'geoname_id')::integer,\n (_v.value->>'name'),\n ...' at line 22"},"level":500,"level_name":"CRITICAL","channel":"console","datetime":"2023-05-29T13:03:34.151985+00:00","extra":{}}
An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '>>'geoname_id')::integer,
PHP5 and Symfony 2 have been dead for a while. Symfony 3 is at EOL, officially dead in November.
What do you think about bumping the minimum version to PHP 7.4 and Symfony 4.4?
We could type the private vars, and get rid of some mistakes that are in the code now, such as float/string discrepancies:
/**
* @var float
*
* @ORM\Column(name="feature_code", type="string", length=10, nullable=true)
*/
protected $featureCode;
/**
* @var float
*
* @ORM\Column(name="country_code", type="string", length=2, nullable=true)
*/
protected $countryCode;
I've been bumping all my projects to PHP8, and Symfony 6 will require it, so that's an option, too.
Could you please update your code to match symfony 5 compatibility?
`composer require bordeux/geoname-bundle
Using version ^1.5 for bordeux/geoname-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "5.0.*"
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for bordeux/geoname-bundle ^1.5 -> satisfiable by bordeux/geoname-bundle[v1.5].
- bordeux/geoname-bundle v1.5 requires symfony/framework-bundle ~2.7|~3.0|~4.0 -> no matching package found.
Potential causes:
Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.
Installation failed, reverting ./composer.json to its original content.
`
For some reason, the timezone file has been removed.
Is there a way to get names in local or specified locale?
I've create a demo app, that loads the tables using this bundle.
Super-fast setup, of course you have to wait to download the files.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.