I am encountering the following errors with PHP 7:

Deprecated function: Methods with the same name as their class will not be constructors in a future version of PHP; Whois has a deprecated constructor in include_once() (line 83 of .../sites/all/modules/domain_finder/domain_finder.module).

Deprecated function: Methods with the same name as their class will not be constructors in a future version of PHP; WhoisClient has a deprecated constructor in require_once() (line 28 of .../sites/all/libraries/phpwhois/whois.main.php).

Deprecated function: Methods with the same name as their class will not be constructors in a future version of PHP; idna_convert has a deprecated constructor in require_once() (line 29 of .../sites/all/libraries/phpwhois/whois.main.php).

Ay help please to resolve this problem?

Thanks in advance.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pburst created an issue. See original summary.

ljgra’s picture

Title: eprecated function: Methods with the same name as their class will not be constructors in a future version of PHP » deprecated function: Methods with the same name as their class will not be constructors in a future version of PHP
dj1999’s picture

Status: Active » Needs review
FileSize
2.23 KB

Here is a patch for php 7 version but have to change phpwhois library to https://github.com/jsmitty12/phpWhois
Install:

cd sites/all/libraries
rm -r phpwhois
mkdir phpwhois
cd phpwhois
php composer.phar require "jsmitty12/phpwhois":"^5.0"

Apply the patch.

ljgra’s picture

Thank you so much for this great module. I installed a newer version of domain finder (patch applied already)/problem above is solved. But now I get the message: No phpWhois library found in %path folder.

I am a php noob. If this bug could be patched?

Again, thanks so much in advance.

dj1999’s picture

Where did you run composer command?
Correct place is:
sites/all/libraries/phpwhois

The modul checks that the autoload.php is exist in sites/all/libraries/phpwhois/vendor folder.

If you run the composer require command in sites/all/libraries/phpwhois than composer generate the vendor folder and all required components.

ljgra’s picture

Thanks much for the kind reply. Out of ignorance, I ran composer.phar (after installing composer) just to get some error because I missed some steps. So I did the patch manually, however this did not work, resulting on the %path problem. So for those who are like me, How I fixed this and sharing this may help:

I used Centos 7. Following dj1999's first four steps in #3 above:

cd sites/all/libraries
rm -r phpwhois
mkdir phpwhois
cd phpwhois

Next, enter the following commands:

php -r "readfile('https://getcomposer.org/installer');" | php

Return:

All settings correct for using Composer
Downloading...

Composer (version 1.7.3) successfully installed to:
.... /public_html/studio/sites/all/libraries/phpwhois/composer.phar
Use it: php composer.phar

Now you can run successfully:

php composer.phar require "jsmitty12/phpwhois":"^5.0"

That's it. Thanks dj1999!

ljgra’s picture

Status: Needs review » Fixed
dj1999’s picture

Status: Fixed » Closed (fixed)