Skip to content

Commit 31d0510

Browse files
authored
[1.1] Update cache adapters from Symfony 4.4 (#10)
* Light move to 4.4 * [Composer] Bump for 1.1 * Update doc * Re-add old adapters extending the new one as deprecated classes to not break 2.5 * CS * Port redis-cluster testing changes from 4.4 to fix segfault * Use phpunit-bridge
1 parent 232d09a commit 31d0510

18 files changed

+912
-552
lines changed

.travis.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@ language: php
55

66
cache:
77
directories:
8+
- .phpunit
89
- "$HOME/.composer/cache"
910

1011
git:
1112
depth: 2
1213

14+
env:
15+
global:
16+
- SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE=1
17+
1318
matrix:
1419
fast_finish: true
1520
include:
@@ -34,8 +39,8 @@ before_install:
3439
- phpenv config-rm xdebug.ini
3540
- |
3641
# Start Redis cluster
37-
docker pull grokzen/redis-cluster:4.0.12
38-
docker run -d -p 7000:7000 -p 7001:7001 -p 7002:7002 -p 7003:7003 -p 7004:7004 -p 7005:7005 --name redis-cluster grokzen/redis-cluster:4.0.12
42+
docker pull grokzen/redis-cluster:5.0.4
43+
docker run -d -p 7000:7000 -p 7001:7001 -p 7002:7002 -p 7003:7003 -p 7004:7004 -p 7005:7005 --name redis-cluster grokzen/redis-cluster:5.0.4
3944
export REDIS_CLUSTER_HOSTS='localhost:7000 localhost:7001 localhost:7002 localhost:7003 localhost:7004 localhost:7005'
4045
4146
install:

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 eZ Systems
3+
Copyright (c) 2019-2020 eZ Systems
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ changes to the feature when it gets accepted to Symfony.
2727

2828
**Polyfill (backport) features:**
2929
- [Redis session handler](doc/RedisSessionHandler.md) _(for Symfony3, native in Symfony4)_
30+
- [NativeTagAwareAdapters](doc/NativeTagAwareAdapters.md) _(for Symfony3, native in Symfony4)_
3031

3132
**Incubator (proposed) features**
32-
- [NativeTagAwareAdapters](doc/NativeTagAwareAdapters.md)
33+
- N/A
3334

3435

3536
### Contributing

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
},
2424
"require": {
2525
"php": "^7.1",
26-
"symfony/symfony": "^3.4.24"
26+
"symfony/symfony": "^3.4.36"
2727
},
2828
"require-dev": {
2929
"cache/integration-tests": "dev-master",
30-
"friendsofphp/php-cs-fixer": "v2.14.0",
30+
"friendsofphp/php-cs-fixer": "v2.14.6",
3131
"phpdocumentor/reflection-docblock": "^3.0|^4.0",
32-
"phpunit/phpunit": "^7.3",
33-
"predis/predis": "^1.1.0",
32+
"phpunit/phpunit": "^7.5",
33+
"predis/predis": "^1.1.1",
3434
"symfony/phpunit-bridge": "~3.4|~4.0"
3535

3636
},
@@ -43,11 +43,11 @@
4343
},
4444
"extra": {
4545
"branch-alias": {
46-
"dev-master": "2.0.x-dev"
46+
"dev-master": "1.1.x-dev"
4747
}
4848
},
4949
"scripts": {
5050
"fix-cs": "@php ./vendor/bin/php-cs-fixer fix -v --show-progress=estimating",
51-
"test": "@php ./vendor/bin/phpunit"
51+
"test": "@php ./vendor/bin/simple-phpunit"
5252
}
5353
}

doc/NativeTagAwareAdapters.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ See: https://github.com/symfony/symfony/commits/master/src/Symfony/Component/Cac
1515

1616
## Requirements
1717
- Symfony 3.4, PHP 7.1+
18-
- For usage eZ Platform v2: `ezsystems/ezpublish-kernel` v7.3.5, v7.4.3 or higher.
18+
- For usage eZ Platform v2: `ezsystems/ezpublish-kernel` v7.5 or higher.
1919
- For `RedisTagAwareAdapter` usage:
20-
- [PHP Redis](https://pecl.php.net/package/redis) extension v3.1.3 or higher, _or_ [Predis](https://packagist.org/packages/predis/predis)
21-
- Redis 3.2 or higher, configured with `noeviction` or any `volatile-*` eviction policy
20+
- [PHP Redis](https://pecl.php.net/package/redis) extension v3.x or higher, _or_ [Predis](https://packagist.org/packages/predis/predis)
21+
- Redis 2.8 or higher, configured with `noeviction` or any `volatile-*` eviction policy
2222

2323
## Configuration
2424
After installing the bundle, you have to configure proper services in order to use this.
@@ -28,9 +28,9 @@ After installing the bundle, you have to configure proper services in order to u
2828
### File system cache
2929

3030
Enabled by default on eZ Platform 2.5+, this is done by means of a new cache adapter service:
31-
https://github.com/ezsystems/ezplatform/blob/v2.5.1/app/config/cache_pool/cache.tagaware.filesystem.yml
31+
https://github.com/ezsystems/ezplatform/blob/v2.5.8/app/config/cache_pool/cache.tagaware.filesystem.yml
3232

33-
By default `CACHE_POOL` enviroment is set to `cache.tagaware.filesystem` to use it.
33+
By default `CACHE_POOL` environment is set to `cache.tagaware.filesystem` to use it.
3434

3535
If you change to this adapter, clear cache and restart web server. You can verify if the adapter is in use on the Symfony web debug toolbar.
3636

@@ -47,5 +47,6 @@ If you don't have redis, for testing you can use:
4747
- Run: `docker run --name my-redis -p 6379:6379 -d redis`.
4848
- Stop + Remove: `docker rm -f my-redis`.
4949
- Debug: `printf "PING\r\n" | nc localhost 6379`, should return `+PONG`.
50+
- `docker exec -ti my-redis redis-cli INFO` _(see [redis.io/commands](https://redis.io/commands) for more)_
5051

5152
If you change to this adapter, clear cache and restart web server. You can verify if the adapter is in use on the Symfony web debug toolbar.

0 commit comments

Comments
 (0)