-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Automatic TLDs update for Zend\Validator\Hostname #7307
Automatic TLDs update for Zend\Validator\Hostname #7307
Conversation
My only reservation is that this script only inserts new TLDs, there is no mechanism if a gTLD is removed from the list. Might it be better to generate the entire list and simply replace $validTLDs? Of course if you want to spend the time, you could also look into the Zend\Code\Generator classes and see of that might help. |
A ha! I found what I was looking for. The Root Zone Database is also available as a daily-generated text file, though only with A names - https://data.iana.org/TLD/tlds-alpha-by-domain.txt Which would be best to pull from? The Validator class does have its home-grown |
Hello,
I don't make a diff. Zend\Code has so less document. Can't figure out how to use it. Patrick |
Very nice !
I will push a new PR using this method. Patrick |
@moderndeveloperllc
BTW, I don't understand why Besides, I use Patrick |
Sorry about the code generation misunderstanding. It was too late last night when I was trying to mentally parse your code! I remember when I was thinking about rewriting the validator last year I too noticed that the text list had more than the HTML list. The I imagine that @weierophinney will want you to write a unit test for this. |
@moderndeveloperllc Otherwise, I have break a testcase :
For me, What do you think ? Patrick |
I would say that is not a valid TLD. The root domain database page for that TLD indicates, "This domain is not present in the root zone at this time." |
FYI, The last Tracis failed build is not due to my PR
|
…tomatic-update Automatic TLDs update for Zend\Validator\Hostname
…e/hostname-validator-tld-automatic-update Automatic TLDs update for Zend\Validator\Hostname
Hi,
I improve the update script provided in #7303 :
bin/
directory$validTlds
definition in filelibrary/Zend/Validator/Hostname.php
usage :
php ./bin/update_hostname_validator.php
Is the script name ok ?
Patrick