Plugin Directory

Changeset 3444439


Ignore:
Timestamp:
01/21/2026 10:33:11 PM (2 months ago)
Author:
ip2location
Message:

Updated to the latest version of IP2Location library.

Location:
ip2location-redirection/trunk
Files:
41 added
7 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • ip2location-redirection/trunk/ip2location-redirection.php

    r3442117 r3444439  
    55 * Plugin URI: https://ip2location.com/resources/wordpress-ip2location-redirection
    66 * Description: Redirect visitors by their country.
    7  * Version: 1.36.1
     7 * Version: 1.37.0
    88 * Requires PHP: 7.4
    99 * Author: IP2Location
  • ip2location-redirection/trunk/readme.txt

    r3442117 r3444439  
    55Requires at least: 4.6
    66Tested up to: 6.9
    7 Stable tag: 1.36.1
     7Stable tag: 1.37.0
    88
    99Redirects visitors to a blog page or a predefined URL based on their country and region geolocated using IP address.
     
    6363
    6464== Changelog ==
     65* 1.37.0 Updated to the latest version of IP2Location library.
    6566* 1.36.1 Fixed implicit conversion of mask to int.
    6667* 1.36.0 Added rule statistics, advance path matching, dialog prompt, and automatically BIN database updates.
  • ip2location-redirection/trunk/vendor/autoload.php

    r2386040 r3444439  
    33// autoload.php @generated by Composer
    44
     5if (PHP_VERSION_ID < 50600) {
     6    if (!headers_sent()) {
     7        header('HTTP/1.1 500 Internal Server Error');
     8    }
     9    $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
     10    if (!ini_get('display_errors')) {
     11        if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
     12            fwrite(STDERR, $err);
     13        } elseif (!headers_sent()) {
     14            echo $err;
     15        }
     16    }
     17    trigger_error(
     18        $err,
     19        E_USER_ERROR
     20    );
     21}
     22
    523require_once __DIR__ . '/composer/autoload_real.php';
    624
    7 return ComposerAutoloaderInit4b9a83d71f3c1c85c2d163d8335d1ad5::getLoader();
     25return ComposerAutoloaderInite0393f7122caeb6588f3264c0dea39ef::getLoader();
  • ip2location-redirection/trunk/vendor/composer/ClassLoader.php

    r2386040 r3444439  
    3838 * @author Fabien Potencier <fabien@symfony.com>
    3939 * @author Jordi Boggiano <j.boggiano@seld.be>
    40  * @see    http://www.php-fig.org/psr/psr-0/
    41  * @see    http://www.php-fig.org/psr/psr-4/
     40 * @see    https://www.php-fig.org/psr/psr-0/
     41 * @see    https://www.php-fig.org/psr/psr-4/
    4242 */
    4343class ClassLoader
    4444{
     45    /** @var \Closure(string):void */
     46    private static $includeFile;
     47
     48    /** @var string|null */
     49    private $vendorDir;
     50
    4551    // PSR-4
     52    /**
     53     * @var array<string, array<string, int>>
     54     */
    4655    private $prefixLengthsPsr4 = array();
     56    /**
     57     * @var array<string, list<string>>
     58     */
    4759    private $prefixDirsPsr4 = array();
     60    /**
     61     * @var list<string>
     62     */
    4863    private $fallbackDirsPsr4 = array();
    4964
    5065    // PSR-0
     66    /**
     67     * List of PSR-0 prefixes
     68     *
     69     * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
     70     *
     71     * @var array<string, array<string, list<string>>>
     72     */
    5173    private $prefixesPsr0 = array();
     74    /**
     75     * @var list<string>
     76     */
    5277    private $fallbackDirsPsr0 = array();
    5378
     79    /** @var bool */
    5480    private $useIncludePath = false;
     81
     82    /**
     83     * @var array<string, string>
     84     */
    5585    private $classMap = array();
     86
     87    /** @var bool */
    5688    private $classMapAuthoritative = false;
     89
     90    /**
     91     * @var array<string, bool>
     92     */
    5793    private $missingClasses = array();
     94
     95    /** @var string|null */
    5896    private $apcuPrefix;
    5997
     98    /**
     99     * @var array<string, self>
     100     */
     101    private static $registeredLoaders = array();
     102
     103    /**
     104     * @param string|null $vendorDir
     105     */
     106    public function __construct($vendorDir = null)
     107    {
     108        $this->vendorDir = $vendorDir;
     109        self::initializeIncludeClosure();
     110    }
     111
     112    /**
     113     * @return array<string, list<string>>
     114     */
    60115    public function getPrefixes()
    61116    {
    62117        if (!empty($this->prefixesPsr0)) {
    63             return call_user_func_array('array_merge', $this->prefixesPsr0);
     118            return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
    64119        }
    65120
     
    67122    }
    68123
     124    /**
     125     * @return array<string, list<string>>
     126     */
    69127    public function getPrefixesPsr4()
    70128    {
     
    72130    }
    73131
     132    /**
     133     * @return list<string>
     134     */
    74135    public function getFallbackDirs()
    75136    {
     
    77138    }
    78139
     140    /**
     141     * @return list<string>
     142     */
    79143    public function getFallbackDirsPsr4()
    80144    {
     
    82146    }
    83147
     148    /**
     149     * @return array<string, string> Array of classname => path
     150     */
    84151    public function getClassMap()
    85152    {
     
    88155
    89156    /**
    90      * @param array $classMap Class to filename map
     157     * @param array<string, string> $classMap Class to filename map
     158     *
     159     * @return void
    91160     */
    92161    public function addClassMap(array $classMap)
     
    103172     * appending or prepending to the ones previously set for this prefix.
    104173     *
    105      * @param string       $prefix  The prefix
    106      * @param array|string $paths   The PSR-0 root directories
    107      * @param bool         $prepend Whether to prepend the directories
     174     * @param string              $prefix  The prefix
     175     * @param list<string>|string $paths   The PSR-0 root directories
     176     * @param bool                $prepend Whether to prepend the directories
     177     *
     178     * @return void
    108179     */
    109180    public function add($prefix, $paths, $prepend = false)
    110181    {
     182        $paths = (array) $paths;
    111183        if (!$prefix) {
    112184            if ($prepend) {
    113185                $this->fallbackDirsPsr0 = array_merge(
    114                     (array) $paths,
     186                    $paths,
    115187                    $this->fallbackDirsPsr0
    116188                );
     
    118190                $this->fallbackDirsPsr0 = array_merge(
    119191                    $this->fallbackDirsPsr0,
    120                     (array) $paths
     192                    $paths
    121193                );
    122194            }
     
    127199        $first = $prefix[0];
    128200        if (!isset($this->prefixesPsr0[$first][$prefix])) {
    129             $this->prefixesPsr0[$first][$prefix] = (array) $paths;
     201            $this->prefixesPsr0[$first][$prefix] = $paths;
    130202
    131203            return;
     
    133205        if ($prepend) {
    134206            $this->prefixesPsr0[$first][$prefix] = array_merge(
    135                 (array) $paths,
     207                $paths,
    136208                $this->prefixesPsr0[$first][$prefix]
    137209            );
     
    139211            $this->prefixesPsr0[$first][$prefix] = array_merge(
    140212                $this->prefixesPsr0[$first][$prefix],
    141                 (array) $paths
     213                $paths
    142214            );
    143215        }
     
    148220     * appending or prepending to the ones previously set for this namespace.
    149221     *
    150      * @param string       $prefix  The prefix/namespace, with trailing '\\'
    151      * @param array|string $paths   The PSR-4 base directories
    152      * @param bool         $prepend Whether to prepend the directories
     222     * @param string              $prefix  The prefix/namespace, with trailing '\\'
     223     * @param list<string>|string $paths   The PSR-4 base directories
     224     * @param bool                $prepend Whether to prepend the directories
    153225     *
    154226     * @throws \InvalidArgumentException
     227     *
     228     * @return void
    155229     */
    156230    public function addPsr4($prefix, $paths, $prepend = false)
    157231    {
     232        $paths = (array) $paths;
    158233        if (!$prefix) {
    159234            // Register directories for the root namespace.
    160235            if ($prepend) {
    161236                $this->fallbackDirsPsr4 = array_merge(
    162                     (array) $paths,
     237                    $paths,
    163238                    $this->fallbackDirsPsr4
    164239                );
     
    166241                $this->fallbackDirsPsr4 = array_merge(
    167242                    $this->fallbackDirsPsr4,
    168                     (array) $paths
     243                    $paths
    169244                );
    170245            }
     
    176251            }
    177252            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
    178             $this->prefixDirsPsr4[$prefix] = (array) $paths;
     253            $this->prefixDirsPsr4[$prefix] = $paths;
    179254        } elseif ($prepend) {
    180255            // Prepend directories for an already registered namespace.
    181256            $this->prefixDirsPsr4[$prefix] = array_merge(
    182                 (array) $paths,
     257                $paths,
    183258                $this->prefixDirsPsr4[$prefix]
    184259            );
     
    187262            $this->prefixDirsPsr4[$prefix] = array_merge(
    188263                $this->prefixDirsPsr4[$prefix],
    189                 (array) $paths
     264                $paths
    190265            );
    191266        }
     
    196271     * replacing any others previously set for this prefix.
    197272     *
    198      * @param string       $prefix The prefix
    199      * @param array|string $paths  The PSR-0 base directories
     273     * @param string              $prefix The prefix
     274     * @param list<string>|string $paths  The PSR-0 base directories
     275     *
     276     * @return void
    200277     */
    201278    public function set($prefix, $paths)
     
    212289     * replacing any others previously set for this namespace.
    213290     *
    214      * @param string       $prefix The prefix/namespace, with trailing '\\'
    215      * @param array|string $paths  The PSR-4 base directories
     291     * @param string              $prefix The prefix/namespace, with trailing '\\'
     292     * @param list<string>|string $paths  The PSR-4 base directories
    216293     *
    217294     * @throws \InvalidArgumentException
     295     *
     296     * @return void
    218297     */
    219298    public function setPsr4($prefix, $paths)
     
    235314     *
    236315     * @param bool $useIncludePath
     316     *
     317     * @return void
    237318     */
    238319    public function setUseIncludePath($useIncludePath)
     
    257338     *
    258339     * @param bool $classMapAuthoritative
     340     *
     341     * @return void
    259342     */
    260343    public function setClassMapAuthoritative($classMapAuthoritative)
     
    277360     *
    278361     * @param string|null $apcuPrefix
     362     *
     363     * @return void
    279364     */
    280365    public function setApcuPrefix($apcuPrefix)
     
    297382     *
    298383     * @param bool $prepend Whether to prepend the autoloader or not
     384     *
     385     * @return void
    299386     */
    300387    public function register($prepend = false)
    301388    {
    302389        spl_autoload_register(array($this, 'loadClass'), true, $prepend);
     390
     391        if (null === $this->vendorDir) {
     392            return;
     393        }
     394
     395        if ($prepend) {
     396            self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
     397        } else {
     398            unset(self::$registeredLoaders[$this->vendorDir]);
     399            self::$registeredLoaders[$this->vendorDir] = $this;
     400        }
    303401    }
    304402
    305403    /**
    306404     * Unregisters this instance as an autoloader.
     405     *
     406     * @return void
    307407     */
    308408    public function unregister()
    309409    {
    310410        spl_autoload_unregister(array($this, 'loadClass'));
     411
     412        if (null !== $this->vendorDir) {
     413            unset(self::$registeredLoaders[$this->vendorDir]);
     414        }
    311415    }
    312416
     
    315419     *
    316420     * @param  string    $class The name of the class
    317      * @return bool|null True if loaded, null otherwise
     421     * @return true|null True if loaded, null otherwise
    318422     */
    319423    public function loadClass($class)
    320424    {
    321425        if ($file = $this->findFile($class)) {
    322             includeFile($file);
     426            $includeFile = self::$includeFile;
     427            $includeFile($file);
    323428
    324429            return true;
    325430        }
     431
     432        return null;
    326433    }
    327434
     
    368475    }
    369476
     477    /**
     478     * Returns the currently registered loaders keyed by their corresponding vendor directories.
     479     *
     480     * @return array<string, self>
     481     */
     482    public static function getRegisteredLoaders()
     483    {
     484        return self::$registeredLoaders;
     485    }
     486
     487    /**
     488     * @param  string       $class
     489     * @param  string       $ext
     490     * @return string|false
     491     */
    370492    private function findFileWithExtension($class, $ext)
    371493    {
     
    433555        return false;
    434556    }
     557
     558    /**
     559     * @return void
     560     */
     561    private static function initializeIncludeClosure()
     562    {
     563        if (self::$includeFile !== null) {
     564            return;
     565        }
     566
     567        /**
     568         * Scope isolated include.
     569         *
     570         * Prevents access to $this/self from included files.
     571         *
     572         * @param  string $file
     573         * @return void
     574         */
     575        self::$includeFile = \Closure::bind(static function($file) {
     576            include $file;
     577        }, null, null);
     578    }
    435579}
    436 
    437 /**
    438  * Scope isolated include.
    439  *
    440  * Prevents access to $this/self from included files.
    441  */
    442 function includeFile($file)
    443 {
    444     include $file;
    445 }
  • ip2location-redirection/trunk/vendor/composer/autoload_classmap.php

    r2386040 r3444439  
    33// autoload_classmap.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
    88return array(
    9     'IP2Location\\Database' => $vendorDir . '/ip2location/ip2location-php/IP2Location.php',
    10     'IP2Location\\WebService' => $vendorDir . '/ip2location/ip2location-php/IP2Location.php',
     9    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
    1110);
  • ip2location-redirection/trunk/vendor/composer/autoload_namespaces.php

    r2386040 r3444439  
    33// autoload_namespaces.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • ip2location-redirection/trunk/vendor/composer/autoload_psr4.php

    r2386040 r3444439  
    33// autoload_psr4.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
    88return array(
     9    'IP2Location\\' => array($vendorDir . '/ip2location/ip2location-php/src'),
    910);
  • ip2location-redirection/trunk/vendor/composer/autoload_real.php

    r2386040 r3444439  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit4b9a83d71f3c1c85c2d163d8335d1ad5
     5class ComposerAutoloaderInite0393f7122caeb6588f3264c0dea39ef
    66{
    77    private static $loader;
     
    2323        }
    2424
    25         spl_autoload_register(array('ComposerAutoloaderInit4b9a83d71f3c1c85c2d163d8335d1ad5', 'loadClassLoader'), true, true);
    26         self::$loader = $loader = new \Composer\Autoload\ClassLoader();
    27         spl_autoload_unregister(array('ComposerAutoloaderInit4b9a83d71f3c1c85c2d163d8335d1ad5', 'loadClassLoader'));
     25        require __DIR__ . '/platform_check.php';
    2826
    29         $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
    30         if ($useStaticLoader) {
    31             require_once __DIR__ . '/autoload_static.php';
     27        spl_autoload_register(array('ComposerAutoloaderInite0393f7122caeb6588f3264c0dea39ef', 'loadClassLoader'), true, true);
     28        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
     29        spl_autoload_unregister(array('ComposerAutoloaderInite0393f7122caeb6588f3264c0dea39ef', 'loadClassLoader'));
    3230
    33             call_user_func(\Composer\Autoload\ComposerStaticInit4b9a83d71f3c1c85c2d163d8335d1ad5::getInitializer($loader));
    34         } else {
    35             $map = require __DIR__ . '/autoload_namespaces.php';
    36             foreach ($map as $namespace => $path) {
    37                 $loader->set($namespace, $path);
    38             }
    39 
    40             $map = require __DIR__ . '/autoload_psr4.php';
    41             foreach ($map as $namespace => $path) {
    42                 $loader->setPsr4($namespace, $path);
    43             }
    44 
    45             $classMap = require __DIR__ . '/autoload_classmap.php';
    46             if ($classMap) {
    47                 $loader->addClassMap($classMap);
    48             }
    49         }
     31        require __DIR__ . '/autoload_static.php';
     32        call_user_func(\Composer\Autoload\ComposerStaticInite0393f7122caeb6588f3264c0dea39ef::getInitializer($loader));
    5033
    5134        $loader->register(true);
  • ip2location-redirection/trunk/vendor/composer/autoload_static.php

    r2386040 r3444439  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit4b9a83d71f3c1c85c2d163d8335d1ad5
     7class ComposerStaticInite0393f7122caeb6588f3264c0dea39ef
    88{
     9    public static $prefixLengthsPsr4 = array (
     10        'I' =>
     11        array (
     12            'IP2Location\\' => 12,
     13        ),
     14    );
     15
     16    public static $prefixDirsPsr4 = array (
     17        'IP2Location\\' =>
     18        array (
     19            0 => __DIR__ . '/..' . '/ip2location/ip2location-php/src',
     20        ),
     21    );
     22
    923    public static $classMap = array (
    10         'IP2Location\\Database' => __DIR__ . '/..' . '/ip2location/ip2location-php/IP2Location.php',
    11         'IP2Location\\WebService' => __DIR__ . '/..' . '/ip2location/ip2location-php/IP2Location.php',
     24        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
    1225    );
    1326
     
    1528    {
    1629        return \Closure::bind(function () use ($loader) {
    17             $loader->classMap = ComposerStaticInit4b9a83d71f3c1c85c2d163d8335d1ad5::$classMap;
     30            $loader->prefixLengthsPsr4 = ComposerStaticInite0393f7122caeb6588f3264c0dea39ef::$prefixLengthsPsr4;
     31            $loader->prefixDirsPsr4 = ComposerStaticInite0393f7122caeb6588f3264c0dea39ef::$prefixDirsPsr4;
     32            $loader->classMap = ComposerStaticInite0393f7122caeb6588f3264c0dea39ef::$classMap;
    1833
    1934        }, null, ClassLoader::class);
  • ip2location-redirection/trunk/vendor/composer/installed.json

    r2387362 r3444439  
    1 [
    2     {
    3         "name": "ip2location/ip2location-php",
    4         "version": "8.2.3",
    5         "version_normalized": "8.2.3.0",
    6         "source": {
    7             "type": "git",
    8             "url": "https://github.com/chrislim2888/IP2Location-PHP-Module.git",
    9             "reference": "532749399c73b664ca8b24770b40b6c479131870"
    10         },
    11         "dist": {
    12             "type": "zip",
    13             "url": "https://api.github.com/repos/chrislim2888/IP2Location-PHP-Module/zipball/532749399c73b664ca8b24770b40b6c479131870",
    14             "reference": "532749399c73b664ca8b24770b40b6c479131870",
    15             "shasum": ""
    16         },
    17         "time": "2020-09-23T23:04:28+00:00",
    18         "type": "library",
    19         "installation-source": "dist",
    20         "autoload": {
    21             "classmap": [
    22                 "IP2Location.php"
    23             ]
    24         },
    25         "notification-url": "https://packagist.org/downloads/",
    26         "license": [
    27             "MIT"
    28         ],
    29         "authors": [
    30             {
    31                 "name": "IP2Location",
    32                 "email": "support@ip2location.com",
    33                 "homepage": "http://www.ip2location.com"
    34             }
    35         ],
    36         "description": "[Official Release] IP2Location PHP API to get location info from IPv4 and IPv6 address.",
    37         "homepage": "http://www.ip2location.com",
    38         "keywords": [
    39             "geolocation",
    40             "ip2location",
    41             "ip2locationlite"
    42         ]
    43     }
    44 ]
     1{
     2    "packages": [
     3        {
     4            "name": "ip2location/ip2location-php",
     5            "version": "9.8.1",
     6            "version_normalized": "9.8.1.0",
     7            "source": {
     8                "type": "git",
     9                "url": "https://github.com/chrislim2888/IP2Location-PHP-Module.git",
     10                "reference": "e18e5372cfa4b57f33d2dc8c15d24cee1ee6d1ce"
     11            },
     12            "dist": {
     13                "type": "zip",
     14                "url": "https://api.github.com/repos/chrislim2888/IP2Location-PHP-Module/zipball/e18e5372cfa4b57f33d2dc8c15d24cee1ee6d1ce",
     15                "reference": "e18e5372cfa4b57f33d2dc8c15d24cee1ee6d1ce",
     16                "shasum": ""
     17            },
     18            "require": {
     19                "ext-bcmath": "*",
     20                "ext-curl": "*",
     21                "ext-json": "*",
     22                "php": ">=7.2"
     23            },
     24            "require-dev": {
     25                "phpunit/phpunit": "^9.5"
     26            },
     27            "time": "2025-12-21T22:28:29+00:00",
     28            "type": "library",
     29            "installation-source": "dist",
     30            "autoload": {
     31                "psr-4": {
     32                    "IP2Location\\": "src"
     33                }
     34            },
     35            "notification-url": "https://packagist.org/downloads/",
     36            "license": [
     37                "MIT"
     38            ],
     39            "authors": [
     40                {
     41                    "name": "IP2Location",
     42                    "email": "support@ip2location.com",
     43                    "homepage": "https://www.ip2location.com"
     44                }
     45            ],
     46            "description": "[Official Release] IP2Location PHP API to get location info from IPv4 and IPv6 address.",
     47            "homepage": "https://www.ip2location.com",
     48            "keywords": [
     49                "area code",
     50                "geolocation",
     51                "ip geolocation",
     52                "ip2location",
     53                "ip2locationlite",
     54                "isp",
     55                "mcc",
     56                "mnc",
     57                "time zone",
     58                "usage type",
     59                "zip code"
     60            ],
     61            "support": {
     62                "issues": "https://github.com/chrislim2888/IP2Location-PHP-Module/issues",
     63                "source": "https://github.com/chrislim2888/IP2Location-PHP-Module/tree/9.8.1"
     64            },
     65            "install-path": "../ip2location/ip2location-php"
     66        }
     67    ],
     68    "dev": true,
     69    "dev-package-names": []
     70}
  • ip2location-redirection/trunk/vendor/ip2location/ip2location-php/LICENSE.TXT

    r2386040 r3444439  
    11MIT License
    22
    3 Copyright (c) 2017 IP2Location.com
     3Copyright (c) 2023 - 2025 IP2Location.com
    44
    55Permission is hereby granted, free of charge, to any person obtaining a copy
  • ip2location-redirection/trunk/vendor/ip2location/ip2location-php/README.md

    r2387362 r3444439  
    66*This is the official release maintained by IP2Location.com*
    77
    8 This PHP module provides fast lookup of country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection speed, IDD code, area code, weather station code, weather station name, MNC, MCC, mobile brand, elevation, and usage type from IP address by using IP2Location database. This module uses a file based database available at IP2Location.com.
     8This PHP module provides fast lookup of country, region, district, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection speed, IDD code, area code, weather station code, weather station name, MNC, MCC, mobile brand, elevation, usage type, address type, IAB category and ASN from IP address by using IP2Location database. This module uses a file based database available at IP2Location.com.
    99
    1010This module can be used in many types of projects such as:
     
    30303. **Comprehensive Information.** There are more than 13 types of information that you can retrieve from an IP address. Please visit [IP2Location.com](https://www.ip2location.com/databases) for details.
    3131
    32 ## INSTALLATION
     32# Developer Documentation
    3333
    34 To install this module, unzip the package and copy the following files to your web folder.
    35 * IP2Location.php
    36 * example.php
    37 * databases/IP2LOCATION-LITE-DB1.BIN
    38 
    39 To test this installation, please browse example.php using web browser.
    40 
    41 ## USAGE
    42 
    43 You can check the **example.php** file to learn more about usage.
    44 
    45 ### Database Class
    46 Below is the description of the functions available in the **Database** class.
    47 
    48 | Function Name | Description |
    49 |---|---|
    50 |Constructor|Expect 2 input parameters:<ol><li>Full path of IP2Location BIN data file.</li><li>File Open Mode<ul><li>   SHARED_MEMORY</li><li>MEMORY_CACHE</li><li>FILE_IO</li></ul></li></ol>For SHARED_MEMORY and MEMORY_CACHE, it will require your server to have sufficient memory to hold the BIN data, otherwise it will raise the errors during the object initialization.|
    51 |getDate|Return the database's compilation date as a string of the form 'YYYY-MM-DD'|
    52 |getType|Return the database's type, 1 to 24 respectively for DB1 to DB24. Please visit https://www.ip2location.com/databases for details.|
    53 |getModuleVersion|Return the version of module|
    54 |getDatabaseVersion|Return the version of database|
    55 |lookup|Return the IP information in array. Below is the information returned:<ul><li>ipNumber</li><li>ipVersion</li><li>ipAddress</li><li>countryCode</li><li>countryName</li><li>regionName</li><li>cityName</li><li>latitude</li><li>longitude</li><li>areaCode</li><li>iddCode</li><li>weatherStationCode</li><li>weatherStationName</li><li>mcc</li><li>mnc</li><li>mobileCarrierName</li><li>usageType</li><li>elevation</li><li>netSpeed</li><li>timeZone</li><li>zipCode</li><li>domainName</li><li>isp</li></ul>You can visit [IP2Location](https://www.ip2location.com/databases/db24-ip-country-region-city-latitude-longitude-zipcode-timezone-isp-domain-netspeed-areacode-weather-mobile-elevation-usagetype) for the description of each field. Note: although the above names are not exactly matched with the names given in this link, but they are self-described.|
    56 |getCidr|Return an array of the complete IP list in CIDR format of the detected row record based on the given IP address.|
    57 
    58 
    59 ### WebService Class
    60 Below is the description of the functions available in the **WebService** class.
    61 
    62 | Function Name | Description                                                  |
    63 | ------------- | ------------------------------------------------------------ |
    64 | Constructor   | Expect 3 input parameters:<ol><li>IP2Location API Key.</li><li>Package (WS1 - WS24)</li><li>Use HTTPS or HTTP</li></ol> |
    65 | lookup        | Return the IP information in array.<ul><li>country_code</li><li>country_name</li><li>region_name</li><li>city_name</li><li>latitude</li><li>longitude</li><li>zip_code</li><li>time_zone</li><li>isp</li><li>domain</li><li>net_speed</li><li>idd_code</li><li>area_code</li><li>weather_station_code</li><li>weather_station_name</li><li>mcc</li><li>mnc</li><li>mobile_brand</li><li>elevation</li><li>usage_type</li><li>continent<ul><li>name</li><li>code</li><li>hemisphere</li><li>translations</li></ul></li><li>country<ul><li>name</li><li>alpha3_code</li><li>numeric_code</li><li>demonym</li><li>flag</li><li>capital</li><li>total_area</li><li>population</li><li>currency<ul><li>code</li><li>name</li><li>symbol</li></ul></li><li>language<ul><li>code</li><li>name</li></ul></li><li>idd_code</li><li>tld</li><li>translations</li></ul></li><li>region<ul><li>name</li><li>code</li><li>translations</li></ul></li><li>city<ul><li>name</li><li>translations</li></ul></li><li>geotargeting<ul><li>metro</li></ul></li><li>country_groupings</li><li>time_zone_info<ul><li>olson</li><li>current_time</li><li>gmt_offset</li><li>is_dst</li><li>sunrise</li><li>sunset</li></ul></li><ul> |
    66 | getCredit     | Return remaining credit of the web service account.          |
    67 
     34To learn more about installation, usage, and code examples, please visit the developer documentation at [https://ip2location-php.readthedocs.io/en/latest/index.html](https://ip2location-php.readthedocs.io/en/latest/index.html).
    6835
    6936
     
    7845You can also sign up for [IP2Location Web Service](https://www.ip2location.com/web-service/ip2location) to lookup by IP2Location API.
    7946
     47## BIN DOWNLOADER SCRIPT
     48```
     49php ip2location_bin_download.php --token DOWNLOAD_TOKEN --file DATABASE_CODE -y
     50```
     51
     52The command above will download the DATABASE_CODE BIN file and unzip the file into *data* folder.
     53
     54| Parameters | Description |
     55|---|---|
     56|token|Download token. You can get your token at your [IP2Location Account Area](https://www.ip2location.com/account) at the Download page.|
     57|file|Database package. (DB1BIN...DB26BIN, DB1BINIPV6...DB26BINIPV6, DB1LITEBIN...DB11LITEBIN or DB1LITEBINIPV6...DB11LITEBINIPV6) You may login to your [IP2Location Account Area](https://www.ip2location.com/account) and get the package code (or download code) at the Download page. |
     58|y|Auto replace the current BIN file without acknowledgement.|
     59
     60You can set the **DOWNLOAD_TOKEN** and **DATABASE_CODE** with values in the .env file (same path as *ip2location_bin_download.php*) and run the command `php ip2location_bin_download.php` for the download.
     61
    8062## IPv4 BIN vs IPv6 BIN
    8163* Use the IPv4 BIN file if you just need to query IPv4 addresses.
     
    8769* [IP2Location CakePHP](https://github.com/ip2location/ip2location-cakephp)
    8870* [IP2Location CodeIgniter](https://github.com/ip2location/codeigniter-ip2location)
     71* [IP2Location Yii](https://github.com/ip2location/ip2location-yii)
     72* [Symfony Framework](https://blog.ip2location.com/knowledge-base/geolocation-lookup-using-symfony-4-and-ip2location-bin-database/). Tutorial on the Symfony implementation.
    8973
    9074## COPYRIGHT AND LICENSE
    9175
    92 Copyright (C) 2005-2020 by IP2Location.com
     76Copyright (C) 2005-2025 by IP2Location.com
    9377
    9478License under MIT
  • ip2location-redirection/trunk/vendor/ip2location/ip2location-php/composer.json

    r2387362 r3444439  
    11{
    2     "name": "ip2location/ip2location-php",
    3     "description": "[Official Release] IP2Location PHP API to get location info from IPv4 and IPv6 address.",
    4     "keywords": ["ip2location", "ip2locationlite", "geolocation"],
    5     "homepage": "http://www.ip2location.com",
    6     "type": "library",
    7     "license": "MIT",
    8     "autoload": {
    9         "classmap": ["IP2Location.php"]
    10     },
    11     "authors": [
    12         {
    13         "name": "IP2Location",
    14         "email": "support@ip2location.com",
    15         "homepage": "http://www.ip2location.com"
    16         }
    17     ]
     2    "name": "ip2location/ip2location-php",
     3    "description": "[Official Release] IP2Location PHP API to get location info from IPv4 and IPv6 address.",
     4    "keywords": ["ip2location", "ip2locationlite", "geolocation", "ip geolocation", "isp", "time zone", "mnc", "mcc", "usage type", "zip code", "area code"],
     5    "homepage": "https://www.ip2location.com",
     6    "type": "library",
     7    "license": "MIT",
     8    "authors": [
     9        {
     10            "name": "IP2Location",
     11            "email": "support@ip2location.com",
     12            "homepage": "https://www.ip2location.com"
     13        }
     14    ],
     15    "require-dev": {
     16        "phpunit/phpunit": "^9.5"
     17    },
     18    "require": {
     19        "php": ">=7.2",
     20        "ext-bcmath": "*",
     21        "ext-curl": "*",
     22        "ext-json": "*"
     23    },
     24    "autoload": {
     25        "psr-4": {
     26            "IP2Location\\": "src"
     27        }
     28    }
    1829}
Note: See TracChangeset for help on using the changeset viewer.