S1lentium / IPTools

PHP Library for manipulating network addresses (IPv4 and IPv6)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

missing function

baszoetekouw opened this issue · comments

Great library! Quite easy to use and works perfectly!
There a a few functions to make life easier that are currently not implemented:

  • instantiate a Range from a Network
  • a contains() method for Network
  • a __toString() method for Range (perhaps by storing its original parse() string)

Any chance you could add these to the library?

Lately, I have not enough time to work with personal projects. If you want, you can send pull requests with tests, that can be merged with 'v2'-branch.

instantiate a Range from a Network

$network->getHosts() already returns a Range object. Is that what you need?

a contains() method for Network

As a work-around you could use $network->getHosts()->contains(...)