PHPackages                             matomo/network - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. matomo/network

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

matomo/network
==============

2.0.2(7mo ago)21897.4k↓11.6%10[1 issues](https://github.com/matomo-org/component-network/issues)3LGPL-3.0PHPPHP &gt;=7.2CI passing

Since Oct 23Pushed 7mo ago13 watchersCompare

[ Source](https://github.com/matomo-org/component-network)[ Packagist](https://packagist.org/packages/matomo/network)[ RSS](/packages/matomo-network/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (1)Versions (7)Used By (3)

Matomo/Network
==============

[](#matomonetwork)

Component providing Network tools.

[![PHPUnit](https://github.com/matomo-org/component-network/actions/workflows/phpunit.yml/badge.svg)](https://github.com/matomo-org/component-network/actions/workflows/phpunit.yml)

Installation
------------

[](#installation)

With Composer:

```
{
    "require": {
        "matomo/network": "*"
    }
}
```

Usage
-----

[](#usage)

### IP

[](#ip)

To manipulate an IP address, you can use the `Matomo\Network\IP` class:

```
$ip = IP::fromStringIP('127.0.0.1');
// IPv6
$ip = IP::fromStringIP('::1');
// In binary format:
$ip = IP::fromBinaryIP("\x7F\x00\x00\x01");

echo $ip->toString(); // 127.0.0.1
echo $ip->toBinary();

// IPv4 & IPv6
if ($ip instanceof IPv4) {}
if ($ip instanceof IPv6) {}

// Hostname reverse lookup
echo $ip->getHostname();

if ($ip->isInRange('192.168.1.1/32')) {}
if ($ip->isInRange('192.168.*.*')) {}

// Anonymize an IP by setting X bytes to null bytes
$ip->anonymize(2);
```

The `Matomo\Network\IPUtils` class provides utility methods:

```
echo IPUtils::binaryToStringIP("\x7F\x00\x00\x01");
echo IPUtils::stringToBinaryIP('127.0.0.1');

// Sanitization methods
$sanitizedIp = IPUtils::sanitizeIp($_GET['ip']);
$sanitizedIpRange = IPUtils::sanitizeIpRange($_GET['ipRange']);

// IP range
$bounds = IPUtils::getIPRangeBounds('192.168.1.*');
echo $bounds[0]; // 192.168.1.0
echo $bounds[1]; // 192.168.1.255
```

License
-------

[](#license)

The Network component is released under the [LGPL v3.0](http://choosealicense.com/licenses/lgpl-3.0/).

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance63

Regular maintenance activity

Popularity50

Moderate usage in the ecosystem

Community29

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor3

3 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~800 days

Recently: every ~842 days

Total

6

Last Release

222d ago

Major Versions

0.2.1 → 2.0.02020-01-01

PHP version history (3 changes)0.1.0PHP &gt;=5.3.2

0.2.1PHP &gt;=5.4

2.0.2PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/80e09d9121023df96ecb1fc20edac8c3d9b724b50dbd3815fa264ae1a6adc58b?d=identicon)[matomo](/maintainers/matomo)

---

Top Contributors

[![sgiehl](https://avatars.githubusercontent.com/u/1579355?v=4)](https://github.com/sgiehl "sgiehl (28 commits)")[![mnapoli](https://avatars.githubusercontent.com/u/720328?v=4)](https://github.com/mnapoli "mnapoli (27 commits)")[![robocoder](https://avatars.githubusercontent.com/u/922051?v=4)](https://github.com/robocoder "robocoder (25 commits)")[![mattab](https://avatars.githubusercontent.com/u/466765?v=4)](https://github.com/mattab "mattab (14 commits)")[![tsteur](https://avatars.githubusercontent.com/u/273120?v=4)](https://github.com/tsteur "tsteur (9 commits)")[![halfdan](https://avatars.githubusercontent.com/u/176576?v=4)](https://github.com/halfdan "halfdan (8 commits)")[![craue](https://avatars.githubusercontent.com/u/800119?v=4)](https://github.com/craue "craue (2 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (2 commits)")[![michalkleiner](https://avatars.githubusercontent.com/u/233342?v=4)](https://github.com/michalkleiner "michalkleiner (1 commits)")[![kevinoid](https://avatars.githubusercontent.com/u/336433?v=4)](https://github.com/kevinoid "kevinoid (1 commits)")[![williamdes](https://avatars.githubusercontent.com/u/7784660?v=4)](https://github.com/williamdes "williamdes (1 commits)")

---

Tags

ipmatomonetworkphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/matomo-network/health.svg)

```
[![Health](https://phpackages.com/badges/matomo-network/health.svg)](https://phpackages.com/packages/matomo-network)
```

###  Alternatives

[breadlesscode/neos-nodetypes-folder

Folder nodetype for Neos CMS

1088.5k1](/packages/breadlesscode-neos-nodetypes-folder)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
