Skip to content

Commit f770ba3

Browse files
committed
Add docs
1 parent 4bd7ed1 commit f770ba3

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ This package contains a cache wrapper for the SOAP engine.
1111

1212
Want more information about the future of this project? Check out this list of the [next big projects](https://github.com/php-soap/.github/blob/main/PROJECTS.md) we'll be working on.
1313

14+
# Prerequisites
15+
16+
You can choose what cache implementation you want to use.
17+
This package expects some PSR implementations to be present in order to be installed:
18+
19+
* PSR-7: `psr/cache-implementation` like `symfony/cache` or `cache/*`
20+
21+
Example:
22+
23+
```sh
24+
$ composer require symfony/cache
25+
```
26+
1427
# Installation
1528

1629
```shell
@@ -23,8 +36,23 @@ This package provides engines that can be used in a generic way:
2336

2437
### CachedEngine
2538

39+
You can cache a complete engine so that you don't have to reload a WSDL on every HTTP request.
2640

2741
```php
42+
use PhpSoap\CachedEngine\CachedEngine;
43+
use Soap\CachedEngine\CacheConfig;
44+
use Soap\Engine\Engine;
45+
46+
$engine = new CachedEngine(
47+
$yourPsr6OrPsr16CachePool,
48+
new CacheConfig(
49+
key: 'cached-engine',
50+
ttlInSeconds: 3600
51+
),
52+
static function (): Engine {
53+
return new YourSoapEngine();
54+
}
55+
);
2856
```
2957

3058
## Drivers
@@ -33,5 +61,21 @@ This package provides drivers that can be used in a generic way:
3361

3462
### CachedDriver
3563

64+
You can cache a complete driver so that you don't have to reload a WSDL on every HTTP request.
65+
3666
```php
67+
use PhpSoap\CachedEngine\CachedDriver;
68+
use Soap\CachedEngine\CacheConfig;
69+
use Soap\Driver\Driver;
70+
71+
$driver = new CachedDriver(
72+
$yourPsr6OrPsr16CachePool,
73+
new CacheConfig(
74+
key: 'cached-engine',
75+
ttlInSeconds: 3600
76+
),
77+
static function (): Driver {
78+
return new YourSoapDriver();
79+
}
80+
);
3781
```

0 commit comments

Comments
 (0)