Skip to content

Commit 7275436

Browse files
authored
Merge pull request #98 from ackintosh/docker-composer
Make available `composer` on example client
2 parents fa6e940 + 0573ea3 commit 7275436

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Ganesha is PHP implementation of [Circuit Breaker pattern](http://martinfowler.c
66

77
![ganesha](https://ackintosh.github.io/assets/images/ganesha.png)
88

9-
[![Latest Stable Version](https://img.shields.io/packagist/v/ackintosh/ganesha.svg?style=flat-square)](https://packagist.org/packages/ackintosh/ganesha) [![Tests](https://github.com/ackintosh/ganesha/workflows/Tests/badge.svg)](https://github.com/ackintosh/ganesha/actions) [![Coverage Status](https://coveralls.io/repos/github/ackintosh/ganesha/badge.svg?branch=master)](https://coveralls.io/github/ackintosh/ganesha?branch=master) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ackintosh/ganesha/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ackintosh/ganesha/?branch=master) [![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.3-8892BF.svg?style=flat-square)](https://php.net/)
9+
[![Latest Stable Version](https://img.shields.io/packagist/v/ackintosh/ganesha.svg?style=flat-square)](https://packagist.org/packages/ackintosh/ganesha) [![Tests](https://github.com/ackintosh/ganesha/workflows/Tests/badge.svg)](https://github.com/ackintosh/ganesha/actions) [![Coverage Status](https://coveralls.io/repos/github/ackintosh/ganesha/badge.svg?branch=master)](https://coveralls.io/github/ackintosh/ganesha?branch=master) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ackintosh/ganesha/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ackintosh/ganesha/?branch=master) [![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.0-8892BF.svg?style=flat-square)](https://php.net/)
1010

1111
</div>
1212

@@ -212,7 +212,7 @@ The details to help us understand visually is shown below:
212212

213213
### Count
214214

215-
If you want use the Count strategy use `Builder::buildWithCountStrategy()` to build an instance.
215+
If you prefer the Count strategy use `Builder::buildWithCountStrategy()` to build an instance.
216216

217217
```php
218218
$ganesha = Ackintosh\Ganesha\Builder::withCountStrategy()
@@ -292,7 +292,7 @@ $ganesha = Ackintosh\Ganesha\Builder::withRateStrategy()
292292

293293
## [Customizing storage keys](#table-of-contents)
294294

295-
If you want customize the keys to be used when storing circuit breaker information, set an instance which implements [StorageKeysInterface](https://github.com/ackintosh/ganesha/blob/master/src/Ganesha/Storage/StorageKeysInterface.php).
295+
If you want to customize the keys to be used when storing circuit breaker information, set an instance which implements [StorageKeysInterface](https://github.com/ackintosh/ganesha/blob/master/src/Ganesha/Storage/StorageKeysInterface.php).
296296

297297
```php
298298
class YourStorageKeys implements StorageKeysInterface
@@ -544,7 +544,7 @@ $ganeshaClient = new GaneshaHttpClient(
544544
As documented in [Usage](https://github.com/ackintosh/ganesha#usage), Ganesha detects failures for each `$service`.
545545
Below, We will show you how GaneshaHttpClient specify failure explicitly.
546546

547-
By default Ganesha considers a request is successful as soon as the server responded, whatever the HTTP status code.
547+
By default, Ganesha considers a request is successful as soon as the server responded, whatever the HTTP status code.
548548

549549
Alternatively, you can use the `RestFailureDetector` implementation of `FailureDetectorInterface` to specify a list of HTTP Status Code to be considered as failure via an option passed to client.
550550
This implementation will consider failure when these HTTP status codes are returned by the server:
@@ -659,18 +659,29 @@ Here are some articles/videos introduce Ganesha! All of them are really shining
659659
We can run unit tests on a Docker container, so it is not necessary to install the dependencies in your machine.
660660

661661
```bash
662-
# Start redis, memcached server
662+
# Start data stores (Redis, Memcached, etc)
663663
$ docker-compose up
664664

665+
# Run `composer install`
666+
$ docker-compose run --rm -w /tmp/ganesha -u ganesha client composer install
667+
665668
# Run tests in container
666669
$ docker-compose run --rm -w /tmp/ganesha -u ganesha client vendor/bin/phpunit
667670
```
668671

669672
## [Requirements](#table-of-contents)
670673

671-
- Ganesha supports PHP 7.3 or higher.
672674
- An extension or client library which is used by [the storage adapter](https://github.com/ackintosh/ganesha#adapters) you've choice will be required. Please check the [Adapters](https://github.com/ackintosh/ganesha#adapters) section for details.
673675

676+
### Version Guidance
677+
678+
| Version | PHP Version |
679+
|---------|-------------|
680+
| 3.x | >=8.0 |
681+
| 2.x | >=7.3 |
682+
| 1.x | >=7.1 |
683+
| 0.x | >=5.6 |
684+
674685
## [Author](#table-of-contents)
675686

676687
**Ganesha** &copy; ackintosh, Released under the [MIT](./LICENSE) License.

examples/client/Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,12 @@ RUN apt-get update \
2222
&& echo 'apc.enable_cli=1' >> /usr/local/etc/php/php.ini \
2323
&& useradd -m ganesha \
2424
&& rm -rf /var/lib/apt/lists/* \
25-
&& rm -rf /var/cache/apt/*
25+
&& rm -rf /var/cache/apt/* \
26+
# Install composer
27+
# https://getcomposer.org/download/
28+
&& php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
29+
&& php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
30+
&& php composer-setup.php \
31+
&& php -r "unlink('composer-setup.php');" \
32+
&& mv composer.phar /usr/local/bin/composer
2633

0 commit comments

Comments
 (0)