-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added test and fixed minor bug * Added meta files * Added class comment * Updated integration test version * Require Symfony for testing * Require mockery
- Loading branch information
Showing
9 changed files
with
205 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/vendor/ | ||
composer.lock | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
language: php | ||
sudo: false | ||
|
||
matrix: | ||
include: | ||
- php: 7.0 | ||
|
||
cache: | ||
directories: | ||
- "$HOME/.composer/cache" | ||
|
||
install: | ||
- composer update | ||
|
||
script: | ||
- ./vendor/bin/phpunit --coverage-clover=coverage.xml | ||
|
||
after_success: | ||
- pip install --user codecov && codecov | ||
|
||
notifications: | ||
email: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Change Log | ||
|
||
The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. | ||
|
||
## UNRELEASED | ||
|
||
## 0.1.0 | ||
|
||
First release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2015 Aaron Scherer, Tobias Nyholm | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# PSR-6 to PSR-16 Bridge (Simple cache) | ||
[![Gitter](https://badges.gitter.im/php-cache/cache.svg)](https://gitter.im/php-cache/cache?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) | ||
[![Latest Stable Version](https://poser.pugx.org/cache/simple-cache-bridge/v/stable)](https://packagist.org/packages/cache/simple-cache-bridge) | ||
[![codecov.io](https://codecov.io/github/php-cache/simple-cache-bridge/coverage.svg?branch=master)](https://codecov.io/github/array-cache/apc-adapter?branch=master) | ||
[![Total Downloads](https://poser.pugx.org/cache/simple-cache-bridge/downloads)](https://packagist.org/packages/cache/simple-cache-bridge) | ||
[![Monthly Downloads](https://poser.pugx.org/cache/simple-cache-bridge/d/monthly.png)](https://packagist.org/packages/cache/simple-cache-bridge) | ||
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) | ||
|
||
This is a PSR-6 cache implementation using PHP array. It is a part of the PHP Cache organisation. To read about | ||
features like tagging and hierarchy support please read the shared documentation at [www.php-cache.com](http://www.php-cache.com). | ||
|
||
### Install | ||
|
||
```bash | ||
composer require cache/simple-cache-bridge | ||
``` | ||
|
||
### Use | ||
|
||
You need an existing PSR-6 pool as a cnstructor argument to the bridge. | ||
|
||
```php | ||
$psr6pool = new ArrayCachePool(); | ||
$simpleCache = new SimpleCacheBridge($psr6pool); | ||
``` | ||
|
||
### Contribute | ||
|
||
Contributions are very welcome! Send a pull request to the [main repository](https://github.com/php-cache/cache) or | ||
report any issues you find on the [issue tracker](http://issues.php-cache.com). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of php-cache organization. | ||
* | ||
* (c) 2015 Aaron Scherer <aequasi@gmail.com>, Tobias Nyholm <tobias.nyholm@gmail.com> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace Cache\Bridge\SimpleCache\Tests; | ||
|
||
use Cache\Bridge\SimpleCache\SimpleCacheBridge; | ||
use Cache\IntegrationTests\SimpleCacheTest as BaseTest; | ||
use Symfony\Component\Cache\Adapter\ArrayAdapter; | ||
|
||
class IntegrationTest extends BaseTest | ||
{ | ||
public function createSimpleCache() | ||
{ | ||
return new SimpleCacheBridge(new ArrayAdapter()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"name": "cache/simple-cache-bridge", | ||
"description": "A PSR-6 bridge to PSR-16. This will make any PSR-6 cache compatible with SimpleCache.", | ||
"type": "library", | ||
"license": "MIT", | ||
"minimum-stability": "dev", | ||
"keywords": [ | ||
"cache", | ||
"psr-6", | ||
"psr-16", | ||
"bridge" | ||
], | ||
"homepage": "http://www.php-cache.com/en/latest/", | ||
"authors": [ | ||
{ | ||
"name": "Magnus Nordlander", | ||
"email": "magnus@fervo.se", | ||
"homepage": "https://github.com/magnusnordlander" | ||
} | ||
], | ||
"require": { | ||
"php": "^5.5 || ^7.0", | ||
"psr/cache": "^1.0", | ||
"psr/simple-cache": "^1.0" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^4.0 || ^5.1", | ||
"cache/integration-tests": "^0.14", | ||
"mockery/mockery": "^0.9", | ||
"symfony/cache": "^3.2" | ||
}, | ||
"provide": { | ||
"psr/simple-cache-implementation": "^1.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Cache\\Bridge\\SimpleCache\\": "" | ||
}, | ||
"exclude-from-classmap": [ | ||
"/Tests/" | ||
] | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "0.2-dev" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
syntaxCheck="false" | ||
bootstrap="vendor/autoload.php" | ||
> | ||
<testsuites> | ||
<testsuite name="Main Test Suite"> | ||
<directory>./Tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<groups> | ||
<exclude> | ||
<group>benchmark</group> | ||
</exclude> | ||
</groups> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory>./</directory> | ||
<exclude> | ||
<directory>./Tests</directory> | ||
<directory>./vendor</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |