-
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.
Merge pull request #24 from square/any-simple-cache
Drop PSR SimpleCache
- Loading branch information
Showing
14 changed files
with
322 additions
and
349 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 |
---|---|---|
|
@@ -13,7 +13,15 @@ jobs: | |
build: | ||
container: ubuntu:latest | ||
runs-on: ubuntu-latest | ||
|
||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
php: ['8.0', '8.1', '8.2'] | ||
psr: ['2.0', '3.0'] | ||
|
||
name: 'PHP ${{ matrix.php }} - Simple Cache: ${{matrix.psr}}' | ||
|
||
services: | ||
redis: | ||
image: redis:latest | ||
|
@@ -22,16 +30,16 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP with PECL extension | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
php-version: '${{ matrix.php }}' | ||
extensions: memcached, redis | ||
|
||
#- name: Setup Memcache | ||
# uses: niden/actions-memcached@v7 | ||
|
||
#- name: Setup Redis | ||
# uses: zhulik/[email protected] | ||
|
||
|
@@ -48,13 +56,13 @@ jobs: | |
${{ runner.os }}-php- | ||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress | ||
run: composer update --with='psr/simple-cache:${{matrix.psr}}' --prefer-dist --no-interaction --no-progress | ||
|
||
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" | ||
# Docs: https://getcomposer.org/doc/articles/scripts.md | ||
|
||
- name: Run static analysis | ||
run: ./vendor/bin/phpstan analyse src tests --level 5 | ||
|
||
- name: Run unit tests | ||
run: ./vendor/bin/phpunit tests |
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
FROM php:7.4.27-cli | ||
RUN apt-get update && apt-get install -y libmemcached-dev zlib1g-dev \ | ||
&& pecl install memcached-3.1.5 \ | ||
&& docker-php-ext-enable memcached \ | ||
&& pecl install redis-5.3.7 \ | ||
&& docker-php-ext-enable redis | ||
FROM php:8.2-cli | ||
RUN apt-get update && apt-get install -y libz-dev libmemcached-dev zlib1g-dev libssl-dev | ||
RUN pecl install memcached | ||
RUN docker-php-ext-enable memcached |
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
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 |
---|---|---|
|
@@ -9,5 +9,3 @@ services: | |
command: tail -f phpunit.xml | ||
memcached: | ||
image: "memcached:latest" | ||
redis: | ||
image: "redis:latest" |
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
<?php declare(strict_types=1); | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Square\TTCache\Store; | ||
|
||
use Psr\SimpleCache\CacheException; | ||
use Exception; | ||
|
||
class CacheStoreException extends Exception implements CacheException | ||
class CacheStoreException extends Exception | ||
{ | ||
} |
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,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Square\TTCache\Store; | ||
|
||
interface CacheStoreInterface | ||
{ | ||
public function get(string $key, mixed $default = null): mixed; | ||
|
||
public function set(string $key, mixed $value, int|\DateInterval $ttl = null): bool; | ||
|
||
public function delete(string $key): bool; | ||
|
||
public function getMultiple(iterable $keys, mixed $default = null): iterable; | ||
|
||
public function setMultiple(iterable $values, int|\DateInterval $ttl = null): bool; | ||
|
||
public function deleteMultiple(iterable $keys): bool; | ||
} |
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
Oops, something went wrong.