Giter VIP home page Giter VIP logo

php's People

Contributors

abu-usama avatar adeel-usmani avatar alexbilbie avatar assertchris avatar awaismslm avatar barryvdh avatar bcrowe avatar browner12 avatar coderholic avatar colinodell avatar dragoonis avatar emanueleminotto avatar frankdejonge avatar hansott avatar hassankhan avatar jclyons52 avatar jhtimmins avatar jotaelesalinas avatar kdubuc avatar marcqualie avatar noamanahmed avatar philsturgeon avatar ravage84 avatar reinink avatar rm-umar avatar robloach avatar rvalitov avatar samuel-gill avatar st-polina avatar umanshahzad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php's Issues

Features of extracting json Not working

There are some features like directly getting Lattitude with $details->lattitude or $details['lattitude'] is not working, and for ipinfo.io/43.241.71.120/privacy?token=$TOKEN This part of feature is not working or I'm unable to get the result using simple php command.

Can I use downloaded Geolocation API database to initialize this client?

As far as I understand, this client makes api requests ещ ipinfo.io. I was wondering if I purchase a geolocation database (I need it for other purposes as well), can I somehow initialize the client with data from the database. So that it does not make any requests over the network and works only with local data?

Does not work with Guzzle7

If I use this library in a project with Guzzle7, then the following error is displayed by composer:

ipinfo/ipinfo v1.1.1 requires guzzlehttp/guzzle ^6.3 -> satisfiable by guzzlehttp/guzzle[6.3.0, 6.3.1, 6.3.2, 6.3.3, 6.4.0, 6.4.1, 6.5.0, 6.5.1, 6.5.2, 6.5.3, 6.5.4, 6.5.5, 6.5.x-dev] but these conflict with your requirements or minimum-stability.

PHP 8 Support

Unable to download if you have PHP 8

Output below:

Problem 1
- ipinfo/ipinfo[dev-master, v2.0.0] require php ~7.0 -> your php version (8.0.0) does not satisfy that requirement.
- ipinfo/ipinfo 2.0.x-dev is an alias of ipinfo/ipinfo dev-master and thus requires it to be installed too.
- Root composer.json requires ipinfo/ipinfo ^2.0.0 -> satisfiable by ipinfo/ipinfo[v2.0.0, 2.0.x-dev (alias of dev-master)].

Retrieving your public IPv6 address

I am trying to retrieve my public IPv6 address but the getDetails() function, with $ip_address paramater set to null, only returns the IPv4 address. i have tried changing the const API_URL of the IPinfo class to 'https://v6.ipinfo.io' but somehow that leads to an curl error 7 which i do not understand. because if i use curl directly it works.

curl ipinfo.io/?token=mytoken

returns json with ip as ipv4 address

curl ipinfo.io/ip/?token=mytoken

returns string ip as ipv4 address

curl v6.ipinfo.io/ip/?token=mytoken

returns string ip as ipv6 address

curl https://v6.ipinfo.io/ip/?token=mytoken

returns string ip as ipv6 address

any idea why the curl error?

Add optional IP selection handler

Add an optional IP selection handler to the SDK client initialization step which accepts the request context and expects returning an IP.

Add a default handler for this which looks at the X-Forwarded-For header and falls back to the source IP.

The resulting IP is the IP for which details are fetched.

Token Referrer restriction with PHP Lib

When using a Domainname Referrer restriction on my token, the PHP library fails to fetch user details with an error

400 Bad Request

I assume this is because my script runs Serverside hence not having a referrer http header.

Any ideas how to overcome this? Like can I force pass a referrer serverside to the IPinfo Library?

guzzlehttp/guzzle v7.2

HI,

I want to use this package into my project and my project using guzzlehttp/guzzle v7.2 and your package is require a guzzlehttp/guzzle v ^6.3 so I am unable to import package via composer

can you please update your package at packagist?

thanks

Inline all data files

We have several files like eu.json, countries.json, continents.json and so on, which are loaded during initialization / startup of the client.

Instead of loading these as such, which has risks such as the asset not appearing in a production environment properly, and has a performance penalty during init of loading an on-disk file, we should inline the files into a static, in-memory map / dictionary or similar.

Does not work with PHP 8.2+

It seems that it does not work with PHP 8.2+. Creating a dynamic property is deprecated.

Deprecated: Creation of dynamic property ipinfo\ipinfo\Details::$carrier is deprecated in XXX/vendor/ipinfo/ipinfo/src/Details.php on line 40 PHP Deprecated: Creation of dynamic property ipinfo\ipinfo\Details::$carrier is deprecated in XXX/vendor/ipinfo/ipinfo/src/Details.php on line 40

This failure cost us 817.487 api calls :-(

Retrieving an IPV6 throw an exception

When you retrieve an ipv6 via getDetails for example, it throws Symfony\Component\Cache\Exception\InvalidArgumentException Cache key "xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx_v1" contains reserved characters "{}()/\@:".

Use versioned cache key

Make sure the cache key contains a number to indicate the version of the cached data. Data changes that change what's expected in cached data require a version change.

Request: New Map feature to be added

Hello!

I really love IP info and recently you guys launched: Map IPs: https://ipinfo.io/map

Would it be possible to get this in the library? I was thinking of PRing it but unsure if it's more of an "experimental/fun" thing at the moment or if it's something that will stick around and is production ready.

Kind Regards!

More info on why response object can be null when calling IPinfo::getDetails()

Hi, I am using the package to get info about a specific ip, and sometimes, in a context I do not understand yet, I get empty (null) response when calling IPinfo::getDetails(). I would like to know why it can return null (is it because the API throttle, server error, or any other reason?).

Not that no IPinfoException is thrown, I just get null as a result.

Also not that when I retry a few moment later the same request, it gets the result without issues.

If I know the reason I can take required measures to mitigate the issue. Thank you.

Add timeout

Please, add timeout option, so that we can control how long the request may work.

Not working with ipv6

Hello,

I found that it is not working with ipv6. As I am not getting location for ipv6 please update it as soon as posible

use this library without composer

Hi
I want to use it without the composer. I tried to add files with require_once function nut it does not work. example: require_once('ipinfo/src/IPinfo.php')
can you help me?

The php api does not work on the server but it does on the localhost

The problem is that it returns a 400 error, but in the local environment it works correctly, I already configured Whitelist Referring Domains.

`
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require_once FCPATH.'vendor/autoload.php';

      use ipinfo\ipinfo\IPinfo;
      use ipinfo\ipinfo\IPinfoException;
      ...
      
      $access_token = 'xxx';
      $client = new IPinfo($access_token); 
      $ip_address = '190.129.164.188';
      $details = $client->getDetails($this->ip());
      echo "<pre>";
      var_dump($details);
      echo "</pre>";

`

ERROR

An uncaught Exception was encountered
Type: ipinfo\ipinfo\IPinfoException

Message: Exception: {"status":400,"reason":"Bad Request"}

Filename: /home3/antraxse/public_html/vendor/ipinfo/ipinfo/src/IPinfo.php

Line Number: 209

Backtrace:

Make caching more easily optional

Right now caching can be modified by a settings key to choose your own cache implementation.

However it should be easier to disable caching (it should really default to disabling, but that would be a breaking change); currently that requires creating a custom cache implementation which simply does nothing.

We can either create such an implementation that does nothing, or have a new key like cache_disabled and update cache-using code to check if the cache exists before using it.

PSR-4 non-compliance warning by composer

Here is the error I get every time I run composer update.

Deprecation Notice: Class ipinfo\ipinfo\cache\CacheInterface located in ./vendor/ipinfo/ipinfo/src/cache/Interface.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:185
Deprecation Notice: Class ipinfo\ipinfo\cache\DefaultCache located in ./vendor/ipinfo/ipinfo/src/cache/Default.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:185

Error with cache key

I tried for the first time the API, with a simple symfony code I get the error:

Cache key "xxxx:1" contains reserved characters "{}()/\@:"

With xxxx being the ip adress of my server.

$client = new IPinfo($access_token);
$details = $client->getDetails($_SERVER["REMOTE_ADDR"]);

I tried setting the ip_address myself, and always the same result, the code add a ":1" at the end of my IP.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.