diff --git a/README.md b/README.md index 40ad1b5..d024637 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ a distributed applications (e.g. with several servers, load balancers, etc.). The package could be installed with composer: ``` -composer require yiisoft/cache-memcached --prefer-dist +composer require yiisoft/cache-memcached ``` ## Configuration @@ -124,47 +124,25 @@ To work with values in a more efficient manner, batch operations should be used: This package can be used as a cache handler for the [Yii Caching Library](https://github.com/yiisoft/cache). -## Testing +## Documentation -### Unit testing +- [Internals](docs/internals.md) -The package is tested with [PHPUnit](https://phpunit.de/). To run tests: - -```shell -./vendor/bin/phpunit -``` - -### Mutation testing - -The package tests are checked with [Infection](https://infection.github.io/) mutation framework. To run it: - -```shell -./vendor/bin/infection -``` - -### Static analysis +## License -The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis: +The Yii Cache Library - Memcached Handler is free software. It is released under the terms of the BSD License. +Please see [`LICENSE`](./LICENSE.md) for more information. -```shell -./vendor/bin/psalm -``` +Maintained by [Yii Software](https://www.yiiframework.com/). -### Support the project +## Support the project [![Open Collective](https://img.shields.io/badge/Open%20Collective-sponsor-7eadf1?logo=open%20collective&logoColor=7eadf1&labelColor=555555)](https://opencollective.com/yiisoft) -### Follow updates +## Follow updates [![Official website](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=flat)](https://www.yiiframework.com/) [![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555?style=flat)](https://twitter.com/yiiframework) [![Telegram](https://img.shields.io/badge/telegram-join-1DA1F2?style=flat&logo=telegram)](https://t.me/yii3en) [![Facebook](https://img.shields.io/badge/facebook-join-1DA1F2?style=flat&logo=facebook&logoColor=ffffff)](https://www.facebook.com/groups/yiitalk) [![Slack](https://img.shields.io/badge/slack-join-1DA1F2?style=flat&logo=slack)](https://yiiframework.com/go/slack) - -## License - -The Yii Cache Library - Memcached Handler is free software. It is released under the terms of the BSD License. -Please see [`LICENSE`](./LICENSE.md) for more information. - -Maintained by [Yii Software](https://www.yiiframework.com/). diff --git a/docs/internals.md b/docs/internals.md new file mode 100644 index 0000000..40fe5c5 --- /dev/null +++ b/docs/internals.md @@ -0,0 +1,57 @@ +# Internals + +## Development environment + +For greater ease it is recommended to use docker containers. + +Run container with memcached directly via command: + +```shell +docker run --rm --name yiisoft-cache-memcached-cache --detach --publish 11211:11211 memcached:1.6.23 +``` + +Memcached must be accessible by address `127.0.0.1`. If you use PHP via docker container, run PHP container in network +of memcached container. Use `docker run` command argument for it: + +``` +--network container:yiisoft-cache-memcached-cache +``` + +## Unit testing + +The package is tested with [PHPUnit](https://phpunit.de/). To run tests: + +```shell +./vendor/bin/phpunit +``` + +## Mutation testing + +The package tests are checked with [Infection](https://infection.github.io/) mutation framework with +[Infection Static Analysis Plugin](https://github.com/Roave/infection-static-analysis-plugin). To run it: + +```shell +./vendor/bin/roave-infection-static-analysis-plugin +``` + +## Static analysis + +The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis: + +```shell +./vendor/bin/psalm +``` + +## Code style + +Use [Rector](https://github.com/rectorphp/rector) to make codebase follow some specific rules or +use either newest or any specific version of PHP: + +```shell +./vendor/bin/rector +``` + +## Dependencies + +Use [ComposerRequireChecker](https://github.com/maglnet/ComposerRequireChecker) to detect transitive +[Composer](https://getcomposer.org/) dependencies.