Skip to content

Releases: rlanvin/php-ip

v3.0.0

02 Mar 09:05
Compare
Choose a tag to compare

Backward Compatibility Breaking Changes

  • Dropped support for PHP 7.0
  • Deprecated auto-detection of binary strings for IPv6 #57
    This means you can't directly pass the result of inet_pton to construct an IPv6 instance anymore, because it is
    impossible to reliability distinguish some IPv6 human-readable representation from their binary string representation.
    Instead, you need to use the explicit factory method IPv6::createFromBinaryString if you want to work with inet_pton.
    Note: this is still supported for IPv4.
  • IPBlock::getMask() renamed to IPBlock::getNetmask()
  • IPBlock::getPrefix() renamed to IPBlock::getPrefixLength()
  • IPBlock::getMaxPrefix() renamed to IPBlock::getMaxPrefixLength()
  • IPBlock::getGivenIpWithPrefixLen() renamed to IPBlock::getGivenIpWithPrefixLength()
  • Separate "private" from other "reserved" IP addresses.
    This changes the behaviour of IP::isPrivate() and IPBlock::getPrivateBlocks() to be more narrow in scope.
    The previous behaviour has been moved to new methods: IP::isReserved() and IPBlock::getReservedBlocks().
  • IP::isPrivate() renamed to IP::isReserved()
  • IPBlock::getPrivateBlocks() renamed to IPBlock::getReservedBlocks()
  • IP::isPrivate() now only tests if an IP is in a forwardable and non globally reachable IP Block as defined in the IANA special-purpose address registry
  • IPBlock::getPrivateBlocks() now returns only the forwardable and non globally reachable IP Blocks as defined in the IANA special-purpose address registry

Added

  • Support for PHP 8.1
  • Support for PHP 8.0
  • Added explicit factory methods for IPv4/IPv6 classes:
    createFromInt, createFromFloat, createFromString, createFromBinaryString, createFromNumericString and createFromGmp
  • IPBlock::plus() and IpBlock::minus() now accept numeric strings and GMP instances
  • IPBlockIterator now implements ArrayAccess which means you can write e.g. IPBlock::create('192.168.0.0/24')->getSubBlocks('/25')[1]
  • New methods for IPv4Block/IPv6Block: getPrivateBlocks(), getLoopbackBlock(), getLinkLocalBlock()

Changed

  • Optimise performance of IP::isPrivate()

Fixed

  • IPBlock::contains now always throws an InvalidArgumentException if mixing IP versions

Removed

  • Removed deprecated method IPBlock::getSuper

v3.0.0-rc2

22 Jul 19:04
Compare
Choose a tag to compare
v3.0.0-rc2 Pre-release
Pre-release

Backward Compatibility Breaking Changes

  • Separate "private" from other "reserved" IP addresses.
    This changes the behaviour of IP::isPrivate() and IPBlock::getPrivateBlocks() to be more narrow in scope.
    The previous behaviour has been moved to new methods: IP::isReserved() and IPBlock::getReservedBlocks().
  • IP::isPrivate() renamed to IP::isReserved()
  • IPBlock::getPrivateBlocks() renamed to IPBlock::getReservedBlocks()
  • IP::isPrivate() now only tests if an IP is in a forwardable and non globally reachable IP Block as defined in the IANA special-purpose address registry
  • IPBlock::getPrivateBlocks() now returns only the forwardable and non globally reachable IP Blocks as defined in the IANA special-purpose address registry

v3.0.0-rc1

18 Apr 09:57
Compare
Choose a tag to compare
v3.0.0-rc1 Pre-release
Pre-release

Backward Compatibility Breaking Changes

  • Deprecated auto-detection of binary strings for IPv6 #57
    This means you can't directly pass the result of inet_pton to construct an IPv6 instance anymore, because it is
    impossible to reliability distinguish some IPv6 human-readable representation from their binary string representation.
    Instead, you need to use the explicit factory method IPv6::createFromBinaryString if you want to work with inet_pton.
    Note: this is still supported for IPv4.
  • IPBlock::getMask() renamed to IPBlock::getNetmask()
  • IPBlock::getPrefix() renamed to IPBlock::getPrefixLength()
  • IPBlock::getMaxPrefix() renamed to IPBlock::getMaxPrefixLength()
  • IPBlock::getGivenIpWithPrefixLen() renamed to IPBlock::getGivenIpWithPrefixLength()

Added

  • Support for PHP 8.0
  • Added explicit factory methods for IPv4/IPv6 classes:
    createFromInt, createFromFloat, createFromString, createFromBinaryString, createFromNumericString and createFromGmp
  • IPBlock::plus() and IpBlock::minus() now accept numeric strings and GMP instances
  • IPBlockIterator now implements ArrayAccess which means you can write e.g. IPBlock::create('192.168.0.0/24')->getSubBlocks('/25')[1]
  • New methods for IPv4Block/IPv6Block: getPrivateBlocks(), getLoopbackBlock(), getLinkLocalBlock()

Changed

  • Optimise performance of IP::isPrivate()

Fixed

  • IPBlock::contains now always throws an InvalidArgumentException if mixing IP versions

Removed

  • Removed deprecated method IPBlock::getSuper

v2.1.0

31 Oct 12:35
Compare
Choose a tag to compare

Added

  • New method IP::matches($ip, $mask) to perform wildcard mask matching common in network Access Control Lists and OSPF dynamic routing #51
  • IPv4Block: Allow to specify the prefix also as an old-style netmask #53
  • Support for PHP 7.4

v2.0.0

01 Sep 09:38
Compare
Choose a tag to compare

Same as v2.0.0-rc1

v2.0.0-rc1

04 May 10:18
Compare
Choose a tag to compare
v2.0.0-rc1 Pre-release
Pre-release

Added

  • New method isLoopback() #37
  • New method isLinkLocal() #43
  • New method reversePointer() #44
  • New method IpBlock::getGivenIp to return the IP used in the constructor #6

Removed

  • Drop support for PHP 5 #8

v1.0.1

26 Jun 19:20
Compare
Choose a tag to compare

Fix compatibility issues with PHP 5.4, 5.5 and 5.6.

v1.0.0

03 Apr 15:40
Compare
Choose a tag to compare

First release, so you don't have to use dev-master on Composer.

{
    "require": {
        "rlanvin/php-ip": "1.*"
    }
}