when use phpwhois in cakephp show me Error: Class 'phpWhois\WhoisClient' not found

505 Views Asked by At

I downloaded phpwhois from here, and copied it in vendor folder in cakephp.

But when I load whois class in controller :

App::import('Vendor', 'phpWhois\Whois', array('file' => 'phpWhois/Whois.php'));

It shows me this error :

Error: Class 'phpWhois\WhoisClient' not found
File: \app\Vendor\phpWhois\Whois.php

Since whois class extend WhoisClient. What should I do?

1

There are 1 best solutions below

0
On

install using following composer command

php composer.phar require "phpwhois/phpwhois":"~4.0"

Add following line in bootstrap.php

require APP . 'Vendor/autoload.php';

spl_autoload_unregister(array('App', 'load'));

spl_autoload_register(array('App', 'load'), true, true);

and add this before before controller's class definition

use phpWhois\Whois;