Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

update TLD list #7303

Conversation

Tauop
Copy link
Contributor

@Tauop Tauop commented Mar 8, 2015

Hi,

This is an update of TLD list in Hostname Validator.

BTW, I've made this little code to generate it.
Can we add it somewhere ?

Patrick

<?php
include 'init_autoloader.php';
use Zend\Dom\Query as DomQuery;
use Zend\Http\ClientStatic;

$response = ClientStatic::get('http://www.iana.org/domains/root/db');
if (!$response->isSuccess()) {
    echo "Error: can't get www.iana.org/domains/root/db".PHP_EOL;
    exit(1);
}

$dom = new DomQuery($response->getBody());
foreach ($dom->execute('span.domain.tld > a') as $node) {
    echo  "'".substr($node->nodeValue, 1)."',".PHP_EOL;
}

@sasezaki
Copy link
Contributor

sasezaki commented Mar 9, 2015

👍

Can we add it somewhere ?

I think bin dir is good appropriate place. please make another Pull Request.

@moderndeveloperllc
Copy link
Contributor

@Tauop Having it in bin/ would be nice. I had thought about doing something like this, but your solution is better than what I could have done. One of these days I'm actually gonna rewrite the validator to only work on the A names of domains (the punycode version) so that the file isn't a mismash of several different scripts and text directions. All the length restrictions, etc are on the A name not the composed U name anyways.

@malukenho
Copy link
Member

I think bin dir is good appropriate place. please make another Pull Request

👍

@weierophinney weierophinney added this to the 2.4.0 milestone Mar 10, 2015
@weierophinney weierophinney merged commit ba2e562 into zendframework:develop Mar 10, 2015
weierophinney added a commit that referenced this pull request Mar 10, 2015
weierophinney added a commit that referenced this pull request Mar 10, 2015
@weierophinney
Copy link
Member

BTW, I've made this little code to generate it.
Can we add it somewhere ?

As others have suggested, I'd love to see this in the bin/ dir; we can then run it for each new maintenance release. Please submit it as a separate pull request.

@Tauop
Copy link
Contributor Author

Tauop commented Mar 11, 2015

Thanks for all your feedback.
new PR => #7307

weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
…e/validator-hostname-tld-update

update TLD list
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants