WhoisParser
WhoisParser copied to clipboard
Fatal error: Class 'Novutec\WhoisParser\Result\AbstractResult' not found in D:\xampp\htdocs\WhoisParser\Result\Result.php on line 36
composer is installeld globally, symfony/yaml as well. Would appreciate if a senior coder jumps in and schools me on this one Thanks
same here.
same here..
WhoisParser now seems to require composers autoloader. By using this with composer then it should work normally.
@wearelogik and how to do that exactly?
@eflyjason https://getcomposer.org
@wearelogik I sudo composer install
and add require 'vendor/autoload.php';
to Parser.php and it's now showing: Fatal error: Call to undefined method Novutec\DomainParser\Parser::setCustomDomainGroups() in WhoisParser/Parser.php on line 273
Hello,
Don't include the autoloader inside Parser.php, remove your inclusion of Parser.php and include the autoloader instead.
@wearelogik it's loading properly, but every domain just display Array ( [0] => % IANA WHOIS server % for more information on IANA, visit http://www.iana.org % % Error: Invalid query )
...
Code:
require_once 'DomainParser/vendor/autoload.php';
require_once 'WhoisParser/vendor/autoload.php';
$Parser = new Novutec\WhoisParser\Parser();
$result = $Parser->lookup("arefly.com");
print_r($result->rawdata);
@eflyjason
Try it without array but use json instead. I'm not exactly sure whats going on there, most likely due to your environment and setup and the information your giving doesnt tell me much.
https://whois.apitruck.com/hello.org This is a live current version of this script with composer using json.
@wearelogik so you are sure the code is correct? I will try another environment then
@eflyjason I don't have anything to do with this beside being a user just like you. All i'm saying is that i setup a working version when i used composer earlier today after i had struggled and given up for a while with the same problem.
@wearelogik ok thank you very much :)
Note that this error appears to occur any time the classes aren't autoloaded. Make sure the paths to the required classes are correct. In my case, path is case sensitive on Unix:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
//spl_autoload_extensions('.php'); // Only Autoload PHP Files
spl_autoload_register(function($className){
//var_dump($className);
//
//Find the position of the first occurrence of a \ in $classname (All Namespaced Classes)
if ( strpos($className,'\\') !== false )
{
// Reverse delimiter to convert to a path
//$classFile = strtolower(str_replace('\\','/',$className)); // Fails on Unix
$classFile = str_replace('\\','/',$className);
if($className[0] !== '/'){
$classFile = APPPATH.'third_party/'.$classFile.'.php';
}
//var_dump($classFile);
if (file_exists($classFile)) require($classFile);
}
});
@diddykong how can I do that exactly?
Above is autoloader.php. I have the following in the Constructor of my model that uses WhoisParser.
require_once(dirname(__FILE__).'/../third_party/Novutec/autoloader.php'); require_once(dirname(__FILE__).'/../third_party/Novutec/DomainParser/Parser.php'); require_once(dirname(__FILE__).'/../third_party/Novutec/WhoisParser/Parser.php');
spl_autoload_register() takes the namespace, converts it to a path, and then autoloads the class.
Remove this line: "require_once 'DomainParser/vendor/autoload.php';" and keep only "require_once 'WhoisParser/vendor/autoload.php';" in your script.
how to run the parser so?
@abra2015 are you still having an issue? if so, please submit an issue at https://github.com/Whoisdoma/WhoisParser