phpWhois / phpWhois

phpWhois general repository
http://phpwhois.pw
GNU General Public License v2.0
313 stars 194 forks source link

Class 'idna_convert' not found #63

Open SamvelG opened 8 years ago

SamvelG commented 8 years ago

Whois.php on line 78 $idn = new \idna_convert(); should be changed to $idn = new \Mso\IdnaConvert\IdnaConvert();

alexndlm commented 8 years ago

Add to your composer.json "mso/idna-convert": "~0.9"

The latest version mso/idna-convert v1.1.0, that uses namespaces, requires php >=5.6.0, but the min version of php in phpWhois is >=5.3.0

More details - https://github.com/phpWhois/phpWhois/pull/60

mike503 commented 7 years ago

+1

ghost commented 5 years ago

I received the same error, I used the IdnaConvert class provided in the required packages by changing line 78 on vendor/phpwhois/phpwhois/src/Whois.php

The first line is the original code, the second is the updated code

$idn = new \idna_convert();

$idn = new \Algo26\IdnaConvert\IdnaConvert();

vinsik commented 5 years ago

~$ composer require algo26-matthias/idna-convert and patch changing line 78 on vendor/phpwhois/phpwhois/src/Whois.php

The first line is the original code, the second is the updated code $idn = new \idna_convert(); to $idn = new \Algo26\IdnaConvert\IdnaConvert();

e7o-de commented 3 years ago

Came across the same issue. As editing the original code is bad + there was an additional issue, I've put this one into a non-namespaced place:

class idna_convert extends \Algo26\IdnaConvert\ToIdn
{
    public function encode(...$params)
    {
        return $this->convert(...$params);
    }
}

It'll still different errors, but at least it runs :)

kevinoo commented 1 year ago

Dear all,

I think this repo is officially abandoned.

I took this repository by the hand, creating a new fork packagist: kevinoo/phpwhois.