-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2d129d3
Showing
18 changed files
with
903 additions
and
0 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,71 @@ | ||
# Nettrine Cache | ||
|
||
[Doctrine\Cache](https://www.doctrine-project.org/projects/doctrine-cache/en/1.8/index.html) for Nette Framework. | ||
|
||
## Content | ||
|
||
- [Setup](#setup) | ||
- [Configuration](#configuration) | ||
- [Usage](#usage) | ||
|
||
## Setup | ||
|
||
Install package | ||
|
||
```bash | ||
composer require nettrine/cache | ||
``` | ||
|
||
Register extension | ||
|
||
```yaml | ||
extensions: | ||
nettrine.cache: Nettrine\Cache\DI\CacheExtension | ||
``` | ||
## Configuration | ||
Extension wil try to choose a cache driver automatically but you may need to specify one. | ||
`PhpFileCache` and eventually `ApcuCache` are the automatically chosen defaults. | ||
|
||
```yaml | ||
nettrine.cache: | ||
driver: Doctrine\Common\Cache\MemcachedCache() | ||
``` | ||
|
||
Doctrine provide many drivers you can use by default: | ||
|
||
- `Doctrine\Common\Cache\ApcuCache` | ||
- `Doctrine\Common\Cache\ArrayCache` | ||
- `Doctrine\Common\Cache\ChainCache` | ||
- `Doctrine\Common\Cache\CouchbaseBucketCache` | ||
- `Doctrine\Common\Cache\FilesystemCache` | ||
- `Doctrine\Common\Cache\MemcachedCache` | ||
- `Doctrine\Common\Cache\MongoDBCache` | ||
- `Doctrine\Common\Cache\PhpFileCache` | ||
- `Doctrine\Common\Cache\PredisCache` | ||
- `Doctrine\Common\Cache\RedisCache` | ||
- `Doctrine\Common\Cache\SQLite3Cache` | ||
- `Doctrine\Common\Cache\VoidCache` | ||
- `Doctrine\Common\Cache\WinCacheCache` | ||
- `Doctrine\Common\Cache\ZendDataCache` | ||
|
||
## Usage | ||
|
||
See [Doctrine\Cache docs](https://www.doctrine-project.org/projects/doctrine-cache/en/1.8/index.html), this is just a DI integration. | ||
|
||
```php | ||
use Doctrine\Common\Cache\Cache; | ||
class MyClass { | ||
/** @var Cache */ | ||
private $cache; | ||
public function __construct(Cache $cache) { | ||
$this->cache = $cache; | ||
} | ||
} | ||
``` |
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,16 @@ | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
indent_style = tab | ||
indent_size = tab | ||
tab_width = 4 | ||
|
||
[{*.json,*.yml,*.md}] | ||
indent_style = space | ||
indent_size = 2 |
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,11 @@ | ||
# Not archived | ||
.docs export-ignore | ||
tests export-ignore | ||
.editorconfig export-ignore | ||
.gitattributes export-ignore | ||
.gitignore export-ignore | ||
.travis.yml export-ignore | ||
Makefile export-ignore | ||
phpstan.neon export-ignore | ||
README.md export-ignore | ||
ruleset.xml export-ignore |
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 @@ | ||
# IDE | ||
/.idea | ||
|
||
# Composer | ||
/vendor | ||
/composer.lock | ||
|
||
# Tests | ||
/coverage.xml |
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,56 @@ | ||
language: php | ||
|
||
php: | ||
- 7.2 | ||
- 7.3 | ||
- 7.4snapshot | ||
- nightly | ||
|
||
before_install: | ||
- phpenv config-rm xdebug.ini || return 0 # Turn off XDebug | ||
|
||
install: | ||
- travis_retry composer install --no-progress --prefer-dist | ||
|
||
script: | ||
- make tests | ||
|
||
jobs: | ||
include: | ||
- env: title="Lowest Dependencies" | ||
php: 7.2 | ||
install: | ||
- travis_retry composer update --no-progress --prefer-dist --prefer-lowest --prefer-stable | ||
script: | ||
- make tests | ||
|
||
- stage: Quality Assurance | ||
php: 7.3 | ||
script: | ||
- make qa | ||
|
||
- stage: Test Coverage | ||
if: branch = master AND type = push | ||
php: 7.3 | ||
script: | ||
- make coverage | ||
after_script: | ||
- composer global require php-coveralls/php-coveralls ^2.1.0 | ||
- ~/.composer/vendor/bin/php-coveralls --verbose --config tests/.coveralls.yml | ||
|
||
- stage: Outdated Dependencies | ||
if: branch = master AND type = cron | ||
php: 7.3 | ||
script: | ||
- composer outdated --direct | ||
|
||
allow_failures: | ||
- stage: Test Coverage | ||
- php: 7.4snapshot | ||
- php: nightly | ||
|
||
sudo: false | ||
|
||
cache: | ||
directories: | ||
- $HOME/.composer/cache |
Oops, something went wrong.