Skip to content

Commit

Permalink
Merge pull request #17 from matomo-org/2.x-dev
Browse files Browse the repository at this point in the history
Rename Piwik -> Matomo
  • Loading branch information
sgiehl authored Feb 14, 2018
2 parents adf8feb + 751cc88 commit df16f20
Show file tree
Hide file tree
Showing 22 changed files with 118 additions and 119 deletions.
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Piwik/Cache
# Matomo/Cache

This is a PHP caching library based on [Doctrine cache](https://github.com/doctrine/cache) that supports different backends.
At [Piwik](http://piwik.org) we developed this library with the focus on speed as we make heavy use of caching and
At [Matomo](https://matomo.org) we developed this library with the focus on speed as we make heavy use of caching and
sometimes fetch hundreds of entries from the cache in one request.

[![Build Status](https://travis-ci.org/piwik/component-cache.svg?branch=master)](https://travis-ci.org/piwik/component-cache)
[![Coverage Status](https://coveralls.io/repos/piwik/component-cache/badge.png?branch=master)](https://coveralls.io/r/piwik/component-cache?branch=master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/piwik/component-cache/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/piwik/component-cache/?branch=master)
[![Build Status](https://travis-ci.org/matomo-org/component-cache.svg?branch=master)](https://travis-ci.org/matomo-org/component-cache)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/matomo-org/component-cache/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/matomo-org/component-cache/?branch=master)

## Installation

Expand All @@ -15,7 +14,7 @@ With Composer:
```json
{
"require": {
"piwik/cache": "*"
"matomo/cache": "*"
}
}
```
Expand Down Expand Up @@ -78,7 +77,7 @@ Use this one if you read hundreds or thousands of cache entries and if performan

```php
$options = array('directory' => '/path/to/cache');
$factory = new \Piwik\Cache\Backend\Factory();
$factory = new \Matomo\Cache\Backend\Factory();
$backend = $factory->buildBackend('file', $options);
```

Expand All @@ -92,7 +91,7 @@ $options = array(
'database' => 15, // optional
'password' => 'secret', // optional
);
$factory = new \Piwik\Cache\Backend\Factory();
$factory = new \Matomo\Cache\Backend\Factory();
$backend = $factory->buildBackend('redis', $options);
```

Expand All @@ -103,7 +102,7 @@ $options = array(
'backends' => array('array', 'file'),
'file' => array('directory' => '/path/to/cache')
);
$factory = new \Piwik\Cache\Backend\Factory();
$factory = new \Matomo\Cache\Backend\Factory();
$backend = $factory->buildBackend('redis', $options);
```

Expand All @@ -119,10 +118,10 @@ using the array cache so the next read within this request will be fast and won'
[Description lazy cache.](#lazy)

```php
$factory = new \Piwik\Cache\Backend\Factory();
$factory = new \Matomo\Cache\Backend\Factory();
$backend = $factory->buildBackend('file', array('directory' => '/path/to/cache'));

$cache = new \Piwik\Cache\Lazy($backend);
$cache = new \Matomo\Cache\Lazy($backend);
$cache->fetch('myid');
$cache->contains('myid');
$cache->delete('myid');
Expand All @@ -135,7 +134,7 @@ $cache->flushAll();
[Description eager cache.](#eager)

```php
$cache = new \Piwik\Cache\Eager($backend, $storageId = 'eagercache');
$cache = new \Matomo\Cache\Eager($backend, $storageId = 'eagercache');
$cache->fetch('myid');
$cache->contains('myid');
$cache->delete('myid');
Expand All @@ -151,7 +150,7 @@ It will cache all set cache entries under the cache entry `eagercache`.
[Description transient cache.](#transient)

```php
$cache = new \Piwik\Cache\Transient();
$cache = new \Matomo\Cache\Transient();
$cache->fetch('myid');
$cache->contains('myid');
$cache->delete('myid');
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"name": "piwik/cache",
"name": "matomo/cache",
"type": "library",
"license": "LGPL-3.0",
"description": "PHP caching library based on Doctrine cache",
"keywords": ["cache","array","file","redis"],
"authors": [
{
"name": "The Piwik Team",
"email": "hello@piwik.org",
"homepage": "http://piwik.org/the-piwik-team/"
"name": "The Matomo Team",
"email": "hello@matomo.org",
"homepage": "https://matomo.org/the-matomo-team/"
}
],
"autoload": {
"psr-4": {
"Piwik\\Cache\\": "src/"
"Matomo\\Cache\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\Piwik\\Cache\\": "tests/"
"Tests\\Matomo\\Cache\\": "tests/"
}
},
"require": {
Expand Down
6 changes: 3 additions & 3 deletions src/Backend.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\Cache;
namespace Matomo\Cache;

/**
* Backend interface
Expand Down
8 changes: 4 additions & 4 deletions src/Backend/ArrayCache.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?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\Cache\Backend;
namespace Matomo\Cache\Backend;

use Piwik\Cache\Backend;
use Matomo\Cache\Backend;

class ArrayCache implements Backend
{
Expand Down
8 changes: 4 additions & 4 deletions src/Backend/Chained.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?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\Cache\Backend;
namespace Matomo\Cache\Backend;

use Piwik\Cache\Backend;
use Matomo\Cache\Backend;

/**
* TODO: extend Doctrine ChainCache as soon as available
Expand Down
8 changes: 4 additions & 4 deletions src/Backend/Factory.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?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\Cache\Backend;
namespace Matomo\Cache\Backend;

use Piwik\Cache\Backend;
use Matomo\Cache\Backend;

class Factory
{
Expand Down
6 changes: 3 additions & 3 deletions src/Backend/Factory/BackendNotFoundException.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\Cache\Backend\Factory;
namespace Matomo\Cache\Backend\Factory;

use \Exception;

Expand Down
8 changes: 4 additions & 4 deletions src/Backend/File.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?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\Cache\Backend;
namespace Matomo\Cache\Backend;

use Doctrine\Common\Cache\PhpFileCache;
use Piwik\Cache\Backend;
use Matomo\Cache\Backend;

/**
* This class is used to cache data on the filesystem.
Expand Down
8 changes: 4 additions & 4 deletions src/Backend/NullCache.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?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\Cache\Backend;
namespace Matomo\Cache\Backend;

use Piwik\Cache\Backend;
use Matomo\Cache\Backend;

/**
* Can be used in development to prevent caching. Does not cache anything.
Expand Down
8 changes: 4 additions & 4 deletions src/Backend/Redis.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?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\Cache\Backend;
namespace Matomo\Cache\Backend;

use Doctrine\Common\Cache\RedisCache;
use Piwik\Cache\Backend;
use Matomo\Cache\Backend;

class Redis extends RedisCache implements Backend
{
Expand Down
6 changes: 3 additions & 3 deletions src/Cache.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\Cache;
namespace Matomo\Cache;

interface Cache
{
Expand Down
8 changes: 4 additions & 4 deletions src/Eager.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?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\Cache;
namespace Matomo\Cache;

use Piwik\Cache\Backend;
use Matomo\Cache\Backend;

/**
* This cache uses one "cache" entry for all cache entries it contains.
Expand Down
10 changes: 5 additions & 5 deletions src/Lazy.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?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\Cache;
namespace Matomo\Cache;

use Piwik\Cache\Backend;
use Matomo\Cache\Backend;

class Lazy implements Cache
{
Expand Down Expand Up @@ -90,7 +90,7 @@ public function flushAll()
private function getCompletedCacheIdIfValid($id)
{
$this->checkId($id);
return 'piwikcache_' . $id;
return 'matomocache_' . $id;
}

private function checkId($id)
Expand Down
8 changes: 4 additions & 4 deletions src/Transient.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?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\Cache;
namespace Matomo\Cache;

use Piwik\Cache\Backend;
use Matomo\Cache\Backend;

/**
* This class is used to cache data during one request.
Expand Down
14 changes: 7 additions & 7 deletions tests/Backend/ChainedTest.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\Cache\Backend;
namespace Tests\Matomo\Cache\Backend;

use Piwik\Cache\Backend\ArrayCache;
use Piwik\Cache\Backend\Chained;
use Piwik\Cache\Backend\NullCache;
use Matomo\Cache\Backend\ArrayCache;
use Matomo\Cache\Backend\Chained;
use Matomo\Cache\Backend\NullCache;

/**
* @covers \Piwik\Cache\Backend\Chained
* @covers \Matomo\Cache\Backend\Chained
*/
class ChainedTest extends \PHPUnit_Framework_TestCase
{
Expand Down
Loading

0 comments on commit df16f20

Please sign in to comment.