Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geoip not being correctly constructed #64

Open
gobfrey opened this issue Dec 3, 2014 · 2 comments
Open

geoip not being correctly constructed #64

gobfrey opened this issue Dec 3, 2014 · 2 comments

Comments

@gobfrey
Copy link

gobfrey commented Dec 3, 2014

Results in error message:

Argument "/opt/eprints3/lib/geoip/GeoIP.dat" isn't numeric in subroutine entry at /opt/eprints3/lib/plugins/EPrints/Plugin/Stats/Processor/Access/Country.pm line 36

According to:

http://search.cpan.org/~borisz/Geo-IP-PurePerl-1.25/lib/Geo/IP/PurePerl.pm#CLASS_METHODS

...we should be using the 'open' method rather than the 'new' method.

@sebastfr
Copy link
Contributor

sebastfr commented Dec 3, 2014

you'll find that many people still use an older version and will need to support both constructors.

@goetzk
Copy link
Contributor

goetzk commented Jan 11, 2021

The current implementation was changed by Rory McNicholl late 2015 to support both.

  {
    if( EPrints::Utils::require_if_exists( $pkg ) )
    {
      if($pkg !~ /PurePerl/){
        $self->{geoip} = $pkg->open( $dat_file );
      }else{
        $self->{geoip} = $pkg->new( $dat_file );
      }
      last if( defined $self->{geoip} );
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants