Skip to content

Commit

Permalink
Merge pull request #328 from boesing/docs/memory-options
Browse files Browse the repository at this point in the history
Add new `max_items` `Memory` adapter option
  • Loading branch information
boesing authored Jul 10, 2024
2 parents d7ec131 + 718e041 commit 7c72bc9
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions docs/book/v4/storage/adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -712,9 +712,9 @@ This adapter implements the following interfaces:
|----------------------|---------------------------------------------------------------------------------|
| `supportedDatatypes` | `string`, `null`, `boolean`, `integer`, `double`, `array`, `object`, `resource` |
| `ttlSupported` | `true` |
| `ttlPrecision` | `0.05` |
| `ttlPrecision` | `1` |
| `usesRequestTime` | `false` |
| `maxKeyLength` | `0` |
| `maxKeyLength` | `0` (unlimited) |
| `namespaceIsPrefix` | `false` |

### Metadata
Expand All @@ -725,19 +725,15 @@ This adapter implements the following interfaces:

### Adapter Specific Options

| Name | Data Type | Default Value | Description |
|----------------|---------------|---------------------------------|-----------------------------------------------------------------|
| `memory_limit` | `string\|int` | 50% of `memory_limit` INI value | Limit of how much memory can PHP allocate to allow store items. |
| Name | Data Type | Default Value | Description |
|-------------|-----------|-----------------|-----------------------------------------------------------------------------------------------------|
| `max_items` | `int` | `0` (unlimited) | Limit of how many cache items are allowed to be stored. Available with v3.0 of the `Memory` adapter |

> #### Memory Limit
> #### Max Items
>
> The adapter has the following behavior with regards to the memory limit:
> The adapter has the following behavior in regard to the `max_items` option:
>
> - If the consumed memory exceeds the limit provided, an `OutOfSpaceException`
> is thrown.
> - A number less the or equal to zero disables the memory limit.
> - When a value is provided for the memory limit, the value is measured in
> bytes. Shorthand notation may also be provided.
> - If the items persisted to the memory cache are exceeding the limit, a new item will be stored while the oldest item will be removed
> ### Current process only
>
Expand Down

0 comments on commit 7c72bc9

Please sign in to comment.