Skip to content

Commit

Permalink
Merge pull request #14 from matomo-org/rename
Browse files Browse the repository at this point in the history
Rebrand from Piwik to Matomo
  • Loading branch information
sgiehl committed Jan 1, 2020
2 parents b0510fe + c8a7265 commit 010e496
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 50 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
./tests/ export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
phpunit.xml export-ignore
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ php:
- 7.1
- 7.2
- 7.3
- 7.4

install:
- composer install
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Piwik/Network
# Matomo/Network

Component providing Network tools.

[![Build Status](https://travis-ci.org/matomo-org/component-network.svg?branch=master)](https://travis-ci.org/matomo-org/component-network)
[![Coverage Status](https://coveralls.io/repos/matomo-org/component-network/badge.png?branch=master)](https://coveralls.io/r/matomo-org/component-network?branch=master)

## Installation

Expand All @@ -12,7 +11,7 @@ With Composer:
```json
{
"require": {
"piwik/network": "*"
"matomo/network": "*"
}
}
```
Expand All @@ -21,7 +20,7 @@ With Composer:

### IP

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

```php
$ip = IP::fromStringIP('127.0.0.1');
Expand All @@ -47,7 +46,7 @@ if ($ip->isInRange('192.168.*.*')) {}
$ip->anonymize(2);
```

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

```php
echo IPUtils::binaryToStringIP("\x7F\x00\x00\x01");
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "piwik/network",
"name": "matomo/network",
"type": "library",
"license": "LGPL-3.0",
"autoload": {
"psr-4": {
"Piwik\\Network\\": "src/"
"Matomo\\Network\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\Piwik\\Network\\": "tests/"
"Tests\\Matomo\\Network\\": "tests/"
}
},
"require": {
Expand Down
6 changes: 3 additions & 3 deletions src/IP.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
/**
* Piwik - free/libre analytics platform
* Matomo - free/libre analytics platform
*
* @link http://piwik.org
* @link https://matomo.org
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL v3 or later
*/

namespace Piwik\Network;
namespace Matomo\Network;

/**
* IP address.
Expand Down
6 changes: 3 additions & 3 deletions src/IPUtils.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
/**
* Piwik - free/libre analytics platform
* Matomo - free/libre analytics platform
*
* @link http://piwik.org
* @link https://matomo.org
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL v3 or later
*/

namespace Piwik\Network;
namespace Matomo\Network;

/**
* IP address utilities (for both IPv4 and IPv6).
Expand Down
6 changes: 3 additions & 3 deletions src/IPv4.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
/**
* Piwik - free/libre analytics platform
* Matomo - free/libre analytics platform
*
* @link http://piwik.org
* @link https://matomo.org
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL v3 or later
*/

namespace Piwik\Network;
namespace Matomo\Network;

/**
* IP v4 address.
Expand Down
6 changes: 3 additions & 3 deletions src/IPv6.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
/**
* Piwik - free/libre analytics platform
* Matomo - free/libre analytics platform
*
* @link http://piwik.org
* @link https://matomo.org
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL v3 or later
*/

namespace Piwik\Network;
namespace Matomo\Network;

/**
* IP v6 address.
Expand Down
18 changes: 9 additions & 9 deletions tests/IPTest.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?php
/**
* Piwik - free/libre analytics platform
* Matomo - free/libre analytics platform
*
* @link http://piwik.org
* @link https://matomo.org
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL v3 or later
*/

namespace Tests\Piwik\Network;
namespace Tests\Matomo\Network;

use Piwik\Network\IP;
use Piwik\Network\IPUtils;
use Matomo\Network\IP;
use Matomo\Network\IPUtils;
use PHPUnit\Framework\TestCase;

/**
* @covers \Piwik\Network\IP
* @covers \Matomo\Network\IP
*/
class IPTest extends TestCase
{
Expand Down Expand Up @@ -50,7 +50,7 @@ public function testFromBinaryIP($str, $binary, $class)
{
$ip = IP::fromBinaryIP($binary);

$this->assertInstanceOf('Piwik\Network\\' . $class, $ip);
$this->assertInstanceOf('Matomo\Network\\' . $class, $ip);

$this->assertEquals($binary, $ip->toBinary());
$this->assertEquals($str, $ip->toString());
Expand All @@ -64,7 +64,7 @@ public function testFromBinaryIPOnEmptyAndNull($ipAddress, $expectedBinary, $exp
{
$ip = IP::fromBinaryIP($ipAddress);

$this->assertInstanceOf('Piwik\Network\\IPv4', $ip);
$this->assertInstanceOf('Matomo\Network\\IPv4', $ip);

$this->assertEquals($expectedBinary, $ip->toBinary());
$this->assertEquals($expectedStr, $ip->toString());
Expand All @@ -90,7 +90,7 @@ public function testFromStringIPOnEmptyAndNull($ipAddress, $expectedBinary, $exp
{
$ip = IP::fromStringIP($ipAddress);

$this->assertInstanceOf('Piwik\Network\\IPv4', $ip);
$this->assertInstanceOf('Matomo\Network\\IPv4', $ip);

$this->assertEquals($expectedBinary, $ip->toBinary());
$this->assertEquals($expectedStr, $ip->toString());
Expand Down
10 changes: 5 additions & 5 deletions tests/IPUtilsTest.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?php
/**
* Piwik - free/libre analytics platform
* Matomo - free/libre analytics platform
*
* @link http://piwik.org
* @link https://matomo.org
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL v3 or later
*/

namespace Tests\Piwik\Network;
namespace Tests\Matomo\Network;

use Piwik\Network\IPUtils;
use Matomo\Network\IPUtils;
use PHPUnit\Framework\TestCase;

/**
* @covers Piwik\Network\IPUtils
* @covers Matomo\Network\IPUtils
*/
class IPUtilsTest extends TestCase
{
Expand Down
14 changes: 7 additions & 7 deletions tests/IPv4Test.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?php
/**
* Piwik - free/libre analytics platform
* Matomo - free/libre analytics platform
*
* @link http://piwik.org
* @link https://matomo.org
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL v3 or later
*/

namespace Tests\Piwik\Network;
namespace Tests\Matomo\Network;

use Piwik\Network\IP;
use Matomo\Network\IP;
use PHPUnit\Framework\TestCase;

/**
* @covers \Piwik\Network\IPv4
* @covers \Matomo\Network\IPv4
*/
class IPv4Test extends TestCase
{
Expand All @@ -32,7 +32,7 @@ public function testToIPv4String($stringIp, $expected)
{
$ip = IP::fromStringIP($stringIp);

$this->assertInstanceOf('Piwik\Network\IPv4', $ip);
$this->assertInstanceOf('Matomo\Network\IPv4', $ip);

$this->assertEquals($expected, $ip->toIPv4String(), $stringIp);
}
Expand Down Expand Up @@ -64,7 +64,7 @@ public function testAnonymize($ipString, $expected)
{
$ip = IP::fromStringIP($ipString);

$this->assertInstanceOf('Piwik\Network\IPv4', $ip);
$this->assertInstanceOf('Matomo\Network\IPv4', $ip);

// each IP is tested with 0 to 4 octets masked
for ($byteCount = 0; $byteCount <= 4; $byteCount++) {
Expand Down
18 changes: 9 additions & 9 deletions tests/IPv6Test.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?php
/**
* Piwik - free/libre analytics platform
* Matomo - free/libre analytics platform
*
* @link http://piwik.org
* @link https://matomo.org
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL v3 or later
*/

namespace Tests\Piwik\Network;
namespace Tests\Matomo\Network;

use Piwik\Network\IP;
use Piwik\Network\IPv6;
use Matomo\Network\IP;
use Matomo\Network\IPv6;
use PHPUnit\Framework\TestCase;

/**
* @covers \Piwik\Network\IPv6
* @covers \Matomo\Network\IPv6
*/
class IPv6Test extends TestCase
{
Expand All @@ -32,7 +32,7 @@ public function testToIPv4String($stringIp, $expected)
{
$ip = IP::fromStringIP($stringIp);

$this->assertInstanceOf('Piwik\Network\IPv6', $ip);
$this->assertInstanceOf('Matomo\Network\IPv6', $ip);

$this->assertEquals($expected, $ip->toIPv4String(), $stringIp);
}
Expand Down Expand Up @@ -88,7 +88,7 @@ public function testAnonymize($ipString, $expected)
{
$ip = IP::fromStringIP($ipString);

$this->assertInstanceOf('Piwik\Network\IPv6', $ip);
$this->assertInstanceOf('Matomo\Network\IPv6', $ip);

// each IP is tested with 0 to 4 octets masked
for ($byteCount = 0; $byteCount < 4; $byteCount++) {
Expand Down Expand Up @@ -125,7 +125,7 @@ public function testAnonymizeIPv4MappedAdresses($ipString, $expected)
{
$ip = IP::fromStringIP('::ffff:' . $ipString);

$this->assertInstanceOf('Piwik\Network\IPv6', $ip);
$this->assertInstanceOf('Matomo\Network\IPv6', $ip);

// mask IPv4 mapped addresses
for ($byteCount = 0; $byteCount <= 4; $byteCount++) {
Expand Down

0 comments on commit 010e496

Please sign in to comment.