Shared code for the MaxMind Web Service PHP client APIs

Overview

Common Code for MaxMind Web Service Clients

This is not intended for direct use by third parties. Rather, it is for shared code between MaxMind's various web service client APIs.

Requirements

The library requires PHP 7.2 or greater.

There are several other dependencies as defined in the composer.json file.

Contributing

Patches and pull requests are encouraged. All code should follow the PSR-2 style guidelines. Please include unit tests whenever possible.

Versioning

This API uses Semantic Versioning.

Copyright and License

This software is Copyright (c) 2015-2020 by MaxMind, Inc.

This is free software, licensed under the Apache License, Version 2.0.

Comments
  • Support timeout as float values.

    Support timeout as float values.

    This needs at least cURL 7.16.2. The Constants were introduced in PHP 5.2.x so it's safe to use them here. cURL automatically ignores the integer value when the MS value is understood.

    I have tried to add a unit test but didn't know how to put it - you could do it along the lines of https://github.com/yellowtree/wp-geoip-detect/blob/master/tests/test-source-precision.php#L104

    opened by benjaminpick 4
  • Ensure the curl handle is always set when attempting to use it

    Ensure the curl handle is always set when attempting to use it

    We were using this client in a Laravel Job (queue worker), but constructing it already when scheduling the job. When our class, containing the reference, was resolved from the service container when executing the job it had lost its reference to cUrl. Though we sh/could fix it on our side, this PR should make things a bit more robust. Tests didn't work for me with the old regexes (even before my changes), updated the regex.

    opened by aphofstede 3
  • Test enhancement

    Test enhancement

    Changed log

    • Defining multiple PHPUnit versions to support different PHP versions because of compatibility.
    • Add the -n option to ignore warning message output during phpcs coding style check.
    • Using the class-based namespace to be compatible with all PHPUnit verions.
    • Remove the @expectedExceptionMessage annotation because every cURL version have different error message.
    • The MaxMind\\WebService\\Http\\Request class constructor has the arguments and it adds missing arguments.
    opened by peter279k 2
  • Re-use the cURL handle when doing multiple requests to the Maxmind API

    Re-use the cURL handle when doing multiple requests to the Maxmind API

    See https://github.com/maxmind/minfraud-api-php/issues/59.

    This re-uses the cURL handle between requests, improving performance by keeping the socket alive if possible and allowing SSL session resumption.

    It also enables compression (gzip) on the response by telling the server what type of encoding is supported.

    opened by willemstuursma 2
  • Update friendsofphp/php-cs-fixer requirement from 2.* to 2.* || 3.*

    Update friendsofphp/php-cs-fixer requirement from 2.* to 2.* || 3.*

    Updates the requirements on friendsofphp/php-cs-fixer to permit the latest version.

    Release notes

    Sourced from friendsofphp/php-cs-fixer's releases.

    v3.0.0 Constitution

    The easiest way to update from v2.x is:

    • install v2.19 and run in verbose mode (php-cs-fixer fix -v) or in future mode (PHP_CS_FIXER_FUTURE_MODE=1 php-cs-fixer fix) to identify and fix deprecations
    • install v3.0 and follow upgrade guide

    • bug #5164 Differ - surround file name with double quotes if it contains spacing. (SpacePossum)
    • bug #5560 PSR2: require visibility only for properties and methods (kubawerlos)
    • bug #5576 ClassAttributesSeparationFixer: do not allow using v2 config (kubawerlos)
    • feature #4979 Pass file to differ (paulhenri-l, SpacePossum)
    • minor #3374 show-progress option: drop run-in and estimating, rename estimating-max to dots (keradus)
    • minor #3375 Fixers - stop exposing extra properties/consts (keradus)
    • minor #3376 Tokenizer - remove deprecations and legacy mode (keradus)
    • minor #3377 rules - change default options (keradus)
    • minor #3378 SKIP_LINT_TEST_CASES - drop env (keradus)
    • minor #3379 MethodArgumentSpaceFixer - fixSpace is now private (keradus)
    • minor #3380 rules - drop rootless configurations (keradus)
    • minor #3381 rules - drop deprecated configurations (keradus)
    • minor #3382 DefinedFixerInterface - incorporate into FixerInterface (keradus)
    • minor #3383 FixerDefinitionInterface - drop getConfigurationDescription and getDefaultConfiguration (keradus)
    • minor #3384 diff-format option: drop sbd diff, use udiffer by default, drop SebastianBergmannDiffer and SebastianBergmannShortDiffer classes (keradus)
    • minor #3385 ConfigurableFixerInterface::configure - param is now not nullable and not optional (keradus)
    • minor #3386 ConfigurationDefinitionFixerInterface - incorporate into ConfigurableFixerInterface (keradus)
    • minor #3387 FixCommand - forbid passing 'config' and 'rules' options together (keradus)
    • minor #3388 Remove Helpers (keradus)
    • minor #3389 AccessibleObject - drop class (keradus)
    • minor #3390 Drop deprecated rules: blank_line_before_return, hash_to_slash_comment, method_separation, no_extra_consecutive_blank_lines, no_multiline_whitespace_before_semicolons and pre_increment (keradus)
    • minor #3456 AutoReview - drop references to removed rule (keradus)
    • minor #3659 use php-cs-fixer/diff ^2.0 (SpacePossum)
    • minor #3681 CiIntegrationTest - fix incompatibility from 2.x line (keradus)
    • minor #3740 NoUnusedImportsFixer - remove SF exception (SpacePossum)
    • minor #3771 UX: always set error_reporting in entry file, not Application (keradus)
    • minor #3922 Make some more classes final (ntzm, SpacePossum)
    • minor #3995 Change default config of native_function_invocation (dunglas, SpacePossum)
    • minor #4432 DX: remove empty sets from RuleSet (kubawerlos)
    • minor #4489 Fix ruleset @​PHPUnit50Migration:risky (kubawerlos)
    • minor #4620 DX: cleanup additional, not used parameters (keradus)
    • minor #4666 Remove deprecated rules: lowercase_constants, php_unit_ordered_covers, silenced_deprecation_error (keradus)
    • minor #4697 Remove deprecated no_short_echo_tag rule (julienfalque)
    • minor #4851 fix phpstan on 3.0 (SpacePossum)
    • minor #4901 Fix SCA (SpacePossum)
    • minor #5069 Fixed failing tests on 3.0 due to unused import after merge (GrahamCampbell)
    • minor #5096 NativeFunctionInvocationFixer - BacktickToShellExecFixer - fix integration test (SpacePossum)
    • minor #5171 Fix test (SpacePossum)
    • minor #5245 Fix CI for 3.0 line (keradus)
    • minor #5351 clean ups (SpacePossum)
    • minor #5364 DX: Do not display runtime twice on 3.0 line (keradus)
    • minor #5412 3.0 - cleanup (SpacePossum, keradus)
    • minor #5417 Further BC cleanup for 3.0 (keradus)

    ... (truncated)

    Changelog

    Sourced from friendsofphp/php-cs-fixer's changelog.

    Changelog for v3.0.0

    • bug #5164 Differ - surround file name with double quotes if it contains spacing. (SpacePossum)
    • bug #5560 PSR2: require visibility only for properties and methods (kubawerlos)
    • bug #5576 ClassAttributesSeparationFixer: do not allow using v2 config (kubawerlos)
    • feature #4979 Pass file to differ (paulhenri-l, SpacePossum)
    • minor #3374 show-progress option: drop run-in and estimating, rename estimating-max to dots (keradus)
    • minor #3375 Fixers - stop exposing extra properties/consts (keradus)
    • minor #3376 Tokenizer - remove deprecations and legacy mode (keradus)
    • minor #3377 rules - change default options (keradus)
    • minor #3378 SKIP_LINT_TEST_CASES - drop env (keradus)
    • minor #3379 MethodArgumentSpaceFixer - fixSpace is now private (keradus)
    • minor #3380 rules - drop rootless configurations (keradus)
    • minor #3381 rules - drop deprecated configurations (keradus)
    • minor #3382 DefinedFixerInterface - incorporate into FixerInterface (keradus)
    • minor #3383 FixerDefinitionInterface - drop getConfigurationDescription and getDefaultConfiguration (keradus)
    • minor #3384 diff-format option: drop sbd diff, use udiffer by default, drop SebastianBergmannDiffer and SebastianBergmannShortDiffer classes (keradus)
    • minor #3385 ConfigurableFixerInterface::configure - param is now not nullable and not optional (keradus)
    • minor #3386 ConfigurationDefinitionFixerInterface - incorporate into ConfigurableFixerInterface (keradus)
    • minor #3387 FixCommand - forbid passing 'config' and 'rules' options together (keradus)
    • minor #3388 Remove Helpers (keradus)
    • minor #3389 AccessibleObject - drop class (keradus)
    • minor #3390 Drop deprecated rules: blank_line_before_return, hash_to_slash_comment, method_separation, no_extra_consecutive_blank_lines, no_multiline_whitespace_before_semicolons and pre_increment (keradus)
    • minor #3456 AutoReview - drop references to removed rule (keradus)
    • minor #3659 use php-cs-fixer/diff ^2.0 (SpacePossum)
    • minor #3681 CiIntegrationTest - fix incompatibility from 2.x line (keradus)
    • minor #3740 NoUnusedImportsFixer - remove SF exception (SpacePossum)
    • minor #3771 UX: always set error_reporting in entry file, not Application (keradus)
    • minor #3922 Make some more classes final (ntzm, SpacePossum)
    • minor #3995 Change default config of native_function_invocation (dunglas, SpacePossum)
    • minor #4432 DX: remove empty sets from RuleSet (kubawerlos)
    • minor #4489 Fix ruleset @​PHPUnit50Migration:risky (kubawerlos)
    • minor #4620 DX: cleanup additional, not used parameters (keradus)
    • minor #4666 Remove deprecated rules: lowercase_constants, php_unit_ordered_covers, silenced_deprecation_error (keradus)
    • minor #4697 Remove deprecated no_short_echo_tag rule (julienfalque)
    • minor #4851 fix phpstan on 3.0 (SpacePossum)
    • minor #4901 Fix SCA (SpacePossum)
    • minor #5069 Fixed failing tests on 3.0 due to unused import after merge (GrahamCampbell)
    • minor #5096 NativeFunctionInvocationFixer - BacktickToShellExecFixer - fix integration test (SpacePossum)
    • minor #5171 Fix test (SpacePossum)
    • minor #5245 Fix CI for 3.0 line (keradus)
    • minor #5351 clean ups (SpacePossum)
    • minor #5364 DX: Do not display runtime twice on 3.0 line (keradus)
    • minor #5412 3.0 - cleanup (SpacePossum, keradus)
    • minor #5417 Further BC cleanup for 3.0 (keradus)
    • minor #5418 Drop src/Test namespace (keradus)
    • minor #5436 Drop mapping of strings to boolean option other than yes/no (keradus)
    • minor #5440 Change default ruleset to PSR-12 (keradus)
    • minor #5477 Drop diff-format (keradus)

    ... (truncated)

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Remove development stuff from releases

    Remove development stuff from releases

    composer require currently downloads all the contents of the repository, but for production usage the development stuff is not required (and it could may be harmful if it contains executable files).

    What about removing this development stuff from releases?

    This affects only installing releases: git-cloning is not touched, so that people that want to run tests/build phars can perform a git clone

    opened by mlocati 1
  • Bump actions/checkout from 2 to 3

    Bump actions/checkout from 2 to 3

    Bumps actions/checkout from 2 to 3.

    Release notes

    Sourced from actions/checkout's releases.

    v3.0.0

    • Updated to the node16 runtime by default
      • This requires a minimum Actions Runner version of v2.285.0 to run, which is by default available in GHES 3.4 or later.

    v2.4.2

    What's Changed

    Full Changelog: https://github.com/actions/checkout/compare/v2...v2.4.2

    v2.4.1

    • Fixed an issue where checkout failed to run in container jobs due to the new git setting safe.directory

    v2.4.0

    • Convert SSH URLs like org-<ORG_ID>@github.com: to https://github.com/ - pr

    v2.3.5

    Update dependencies

    v2.3.4

    v2.3.3

    v2.3.2

    Add Third Party License Information to Dist Files

    v2.3.1

    Fix default branch resolution for .wiki and when using SSH

    v2.3.0

    Fallback to the default branch

    v2.2.0

    Fetch all history for all tags and branches when fetch-depth=0

    v2.1.1

    Changes to support GHES (here and here)

    v2.1.0

    ... (truncated)

    Changelog

    Sourced from actions/checkout's changelog.

    Changelog

    v3.0.2

    v3.0.1

    v3.0.0

    v2.3.1

    v2.3.0

    v2.2.0

    v2.1.1

    • Changes to support GHES (here and here)

    v2.1.0

    v2.0.0

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 0
  • Create Dependabot config file

    Create Dependabot config file

    :wave: Dependabot is moving natively into GitHub! This pull request migrates your configuration from Dependabot.com to a config file, using the new syntax. When you merge this pull request, we'll swap out dependabot-preview (me) for a new dependabot app, and you'll be all set!

    With this change, you'll now use the Dependabot page in GitHub, rather than the Dependabot dashboard, to monitor your version updates. Dependabot is now configured exclusively using config files.

    If you've got any questions or feedback for us, please let us know by creating an issue in the dependabot/dependabot-core repository.

    Learn more about the relaunch of Dependabot

    Please note that regular @dependabot commands do not work on this pull request.

    :robot::yellow_heart:

    dependencies 
    opened by dependabot-preview[bot] 0
  • set CURLOPT_TCP_NODELAY if available

    set CURLOPT_TCP_NODELAY if available

    The CURLOPT_TCP_NODELAY is available for versions compiled with libcurl 7.11.2 or greater disable TCP's Nagle algorithm, which tries to minimize the number of small packets on the network.

    opened by rmccullagh 1
Releases(v0.9.0)
Owner
MaxMind
MaxMind
A laravel service provider for the netsuite-php library service

netsuite-laravel A PHP supplemental package to the ryanwinchester/netsuite-php package to add the NetSuite service client to the service container of

NetsuitePHP 6 Nov 9, 2022
PHP client library for reCAPTCHA, a free service to protect your website from spam and abuse.

reCAPTCHA PHP client library reCAPTCHA is a free CAPTCHA service that protects websites from spam and abuse. This is a PHP library that wraps up the s

Google 3.3k Dec 23, 2022
Laravel 4.* and 5.* service providers to handle PHP errors, dump variables, execute PHP code remotely in Google Chrome

Laravel 4.* service provider for PHP Console See https://github.com/barbushin/php-console-laravel/releases/tag/1.2.1 Use "php-console/laravel-service-

Sergey 73 Jun 1, 2022
MediaDB is a web-based media streaming service written in Laravel and Vue.

MediaDB (API) MediaDB is a web-based media streaming service written in Laravel and Vue. The nginx-vod-module is used for on-the-fly repackaging of MP

François M. 53 Sep 3, 2022
Ebansos (Electronic Social Assistance) is a web application that provides citizen data management who will receive social assistance to avoid misdirection assistance from public service/government.

E Bansos Ebansos (Electronic Social Assistance) is a web application that provides citizen data management who will receive social assistance to avoid

Azvya Erstevan I 12 Oct 12, 2022
Project C2 (Laravel 8.x) - Pemograman Web Service (Semester 5)

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Shaynendra Dika Destyawan 0 Dec 26, 2021
Get info from any web service or page

Embed PHP library to get information from any web page (using oembed, opengraph, twitter-cards, scrapping the html, etc). It's compatible with any web

Oscar Otero 1.9k Jan 4, 2023
Easily Integrate PingPing APIs in your Laravel Project

PingPing This composer package allows us to easily integrate PingPing APIs in your Laravel project. What is PingPing ? PingPing is the simplest uptime

Bhushan Gaikwad 15 Mar 22, 2022
A Laravel 8 Project Implement with GraphQL With Sanctum APIs Authentications Which utilized in Any Frontend or Any Mobile Application Programs.

A Laravel 8 Project Implement with GraphQL With Sanctum APIs Authentications Which utilized in Any Frontend or Any Mobile Application Programs.

Vikas Ukani 3 Jan 6, 2022
A package to access messari apis for laravel

Messari API - Laravel Laravel wrapper for messari.io API Full API documentation could be found on messari.io Installation PHP 7.2+ and Composer are re

Seyyed Ahmad Mousavi 2 Apr 13, 2022
Get started using SELCOM APIs with Laravel framework

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Bruno 2 Jan 13, 2022
Builds nice, normalized and easy to consume REST JSON responses for Laravel powered APIs.

REST API Response Builder for Laravel Master branch: Development branch: Table of contents Introduction Why should I use it? Usage examples Features E

Marcin Orlowski 614 Dec 26, 2022
Laravel Backend API for the tutorial (Granular permissions with Laravel APIs & React frontend)

Laravel Granular Permissions Backend Getting Started Clone the repository. Install the dependencies composer install Update .env database credentials

Munaf Aqeel Mahdi 4 May 10, 2022
Laravel-api - crud and login/signup apis

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Maaz Ali Khan 2 Jan 2, 2022
A simple API wrapper to Gigapay's APIs for Laravel Framework

Laravel-Gigapay A simple API wrapper for Gigapay's APIs. It gives you helper methods that will make your work with gigapay's API easy, fast and effici

Asif Patel 3 May 23, 2022
Backend application using Laravel 9.x REST APIs for games topup from digiflazz.com and payment gateway using xendit.co

TOPUP - Laravel 9.x REST API Documentation is still on progress. For now, you can fork this postman collection Installation Clone this project git clo

Muhammad Athhar Kautsar 46 Dec 17, 2022
Execute Laravel Artisan commands via REST APIs and HTTP requests safely.

Artisan Api There might be some times you wanted to execute an Artisan command, but you did not have access to shell or SSH. Here we brought REST API

Alireza 11 Sep 7, 2022
Easy-to-use SDK for implementing Neshan APIs in your Laravel projects.

Neshan Laravel SDK Easy-to-use SDK for implementing Neshan APIs in your Laravel projects. Install The easiest way to install is by using Composer: com

null 1 Oct 22, 2022
Laravel Abdal Detector - Find info about IP , OS and web browser from your client

Laravel Abdal Detector - Find info about IP , OS and web browser from your client

 Abdal Security Group 1 Mar 24, 2022