21 lines
2.5 KiB
Markdown
21 lines
2.5 KiB
Markdown
## Options
|
|
|
|
The `ObjectRetriever` constructor accepts an associative array of options. All options are optional; any option not specified uses its default value.
|
|
|
|
| Key | Description | Default value |
|
|
| --- | --- | --- |
|
|
| `cache_storage` | External cache storage; must implement `Kevinrob\GuzzleCache\Storage\CacheStorageInterface`, `Psr\Cache\CacheItemPoolInterface` or `Psr\SimpleCache\CacheInterface`. See [caching](caching.md). | `null` |
|
|
| `cache_prefix` | Prefix for all keys written to the external cache. | `'clobj:'` |
|
|
| `cache_ttl` | Number of seconds that object descriptions are cached, both in memory and in the external cache. | `60` |
|
|
| `static_config_path` | Path to a directory with static object descriptions, which are used instead of the API. Objects are read from `<path>/<namespace>/<path of COID>/object.jsonld`. | `null` |
|
|
| `auth_ns` | Hostname of the namespace to authenticate as, e.g. `example.com`. | `null` |
|
|
| `auth_secret` | Shared secret between the authenticating namespace and CloudObjects. | `null` |
|
|
| `api_base_url` | Base URL of the CloudObjects Core Object API. If not set, `https://od.coid.link/` is used. | `null` |
|
|
| `logger` | Logger implementing `Psr\Log\LoggerInterface`, which receives info messages about object retrieval. | `null` |
|
|
| `timeout` | Total timeout for API requests, in seconds. | `20` |
|
|
| `connect_timeout` | Timeout for establishing a connection to the API, in seconds. | `5` |
|
|
| `fallback_store_directory` | Writeable directory in which copies of retrieved objects are saved and returned when the API fails with a 5xx error, times out, or the request fails without a response. Requires `fallback_store_scope`. See [caching](caching.md#fallback-store). | `null` |
|
|
| `fallback_store_scope` | Which objects are saved in the fallback store: `'*'` for all objects, or a list of namespaces (domains without `coid://` prefix) as a comma-separated string or an array of strings. | `null` |
|
|
| `permanent_store_directory` | Writeable directory in which copies of retrieved objects are saved; once an object is stored there, it is always returned from the store and the API is never contacted for it again. Requires `permanent_store_scope` and must differ from `fallback_store_directory`. See [caching](caching.md#permanent-store). | `null` |
|
|
| `permanent_store_scope` | Which objects are saved in the permanent store: `'*'` for all objects, or a list of namespaces (domains without `coid://` prefix) as a comma-separated string or an array of strings. | `null` |
|