lachlanarthur/psr16-wordpress-transients

Use WordPress transients as a PSR-16 cache.

Installs: 1 228

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 1

Open Issues: 0

pkg:composer/lachlanarthur/psr16-wordpress-transients

1.1 2020-03-08 05:45 UTC

This package is auto-updated.

Last update: 2025-11-08 18:27:46 UTC


README

Use the WordPress transient API as a PSR-16 cache

composer require lachlanarthur/psr16-wordpress-transients
use LachlanArthur\Psr16WordPressTransients\WordPressTransientAdapter

new WordPressTransientAdapter( 'prefix-', MONTH_IN_SECONDS );

NOTES

  • This cache cannot store null or false. This is because the WP transient API returns false for a cache miss, and the PSR-16 spec must return null for a cache miss.

  • Key length is restricted to 172 characters, including the prefix.