Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
veewee committed Jun 7, 2024
1 parent 4bd7ed1 commit f770ba3
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ This package contains a cache wrapper for the SOAP engine.

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.

# Prerequisites

You can choose what cache implementation you want to use.
This package expects some PSR implementations to be present in order to be installed:

* PSR-7: `psr/cache-implementation` like `symfony/cache` or `cache/*`

Example:

```sh
$ composer require symfony/cache
```

# Installation

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

### CachedEngine

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

```php
use PhpSoap\CachedEngine\CachedEngine;
use Soap\CachedEngine\CacheConfig;
use Soap\Engine\Engine;

$engine = new CachedEngine(
$yourPsr6OrPsr16CachePool,
new CacheConfig(
key: 'cached-engine',
ttlInSeconds: 3600
),
static function (): Engine {
return new YourSoapEngine();
}
);
```

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

### CachedDriver

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

```php
use PhpSoap\CachedEngine\CachedDriver;
use Soap\CachedEngine\CacheConfig;
use Soap\Driver\Driver;

$driver = new CachedDriver(
$yourPsr6OrPsr16CachePool,
new CacheConfig(
key: 'cached-engine',
ttlInSeconds: 3600
),
static function (): Driver {
return new YourSoapDriver();
}
);
```

0 comments on commit f770ba3

Please sign in to comment.