From 751cc8850e52e5d1ed6b9cc0be5cbcd0a6aa6ba2 Mon Sep 17 00:00:00 2001 From: sgiehl Date: Wed, 14 Feb 2018 21:22:45 +0100 Subject: [PATCH] Rename Piwik -> Matomo --- README.md | 25 +++++++++---------- composer.json | 12 ++++----- src/Backend.php | 6 ++--- src/Backend/ArrayCache.php | 8 +++--- src/Backend/Chained.php | 8 +++--- src/Backend/Factory.php | 8 +++--- .../Factory/BackendNotFoundException.php | 6 ++--- src/Backend/File.php | 8 +++--- src/Backend/NullCache.php | 8 +++--- src/Backend/Redis.php | 8 +++--- src/Cache.php | 6 ++--- src/Eager.php | 8 +++--- src/Lazy.php | 10 ++++---- src/Transient.php | 8 +++--- tests/Backend/ChainedTest.php | 14 +++++------ tests/Backend/FactoryTest.php | 22 ++++++++-------- tests/Backend/FileTest.php | 10 ++++---- tests/Backend/NullCacheTest.php | 10 ++++---- tests/BackendTest.php | 16 ++++++------ tests/EagerTest.php | 14 +++++------ tests/LazyTest.php | 12 ++++----- tests/TransientTest.php | 10 ++++---- 22 files changed, 118 insertions(+), 119 deletions(-) diff --git a/README.md b/README.md index 1133c4a..19fccb9 100644 --- a/README.md +++ b/README.md @@ -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 @@ -15,7 +14,7 @@ With Composer: ```json { "require": { - "piwik/cache": "*" + "matomo/cache": "*" } } ``` @@ -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); ``` @@ -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); ``` @@ -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); ``` @@ -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'); @@ -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'); @@ -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'); diff --git a/composer.json b/composer.json index a79281d..0a152e8 100644 --- a/composer.json +++ b/composer.json @@ -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": { diff --git a/src/Backend.php b/src/Backend.php index 53feb5c..bbcf9d6 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -1,12 +1,12 @@ checkId($id); - return 'piwikcache_' . $id; + return 'matomocache_' . $id; } private function checkId($id) diff --git a/src/Transient.php b/src/Transient.php index d8e74de..63fc873 100644 --- a/src/Transient.php +++ b/src/Transient.php @@ -1,14 +1,14 @@