wikimedia / ip-utils
Functions and constants to play with IP addresses and ranges
4.0.0
2022-01-29 17:36 UTC
Requires
- php: >=7.2.9
- wikimedia/base-convert: ^2.0.0
- wikimedia/ip-set: ^2.0.0|^3.0.0
Requires (Dev)
- mediawiki/mediawiki-codesniffer: 38.0.0
- mediawiki/mediawiki-phan-config: 0.11.1
- mediawiki/minus-x: 1.1.1
- ockcyp/covers-validator: 1.3.3
- php-parallel-lint/php-console-highlighter: 0.5.0
- php-parallel-lint/php-parallel-lint: 1.3.1
- phpunit/phpunit: ^8.5
README
IPUtils
A series of utilities for working with IP addresses, both IPv4 and IPv6.
Additional documentation about the library can be found on MediaWiki.org.
Usage
use Wikimedia\IPUtils; IPUtils::isIPAddress( '::1' ); IPUtils::isIPv4( '124.24.52.13' );
Running tests
composer install --prefer-dist
composer test
History
This library was first introduced in MediaWiki 1.7 (r15572). It was split out of the MediaWiki codebase and published as an independent library during the MediaWiki 1.34 development cycle.