laminas / laminas-cache
Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output
Fund package maintenance!
Community Bridge
Installs: 5 023 307
Dependents: 130
Suggesters: 10
Security: 0
Stars: 103
Watchers: 21
Forks: 52
Open Issues: 8
Requires
- php: ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0
- laminas/laminas-eventmanager: ^3.4
- laminas/laminas-servicemanager: ^4.1
- laminas/laminas-stdlib: ^3.20
- psr/cache: ^2.0 || ^3.0
- psr/clock: ^1.0
- psr/simple-cache: ^2.0 || ^3.0
- webmozart/assert: ^1.11
Requires (Dev)
- laminas/laminas-cli: ^1.11
- laminas/laminas-coding-standard: ~3.0.1
- laminas/laminas-config-aggregator: ^1.17
- laminas/laminas-serializer: ^3.1
- phpunit/phpunit: ^10.5.38
- psalm/plugin-phpunit: ^0.19.0
- vimeo/psalm: ^5.26.1
Suggests
- laminas/laminas-cache-storage-adapter-apcu: APCu implementation
- laminas/laminas-cache-storage-adapter-blackhole: Blackhole/Void implementation
- laminas/laminas-cache-storage-adapter-ext-mongodb: MongoDB implementation
- laminas/laminas-cache-storage-adapter-filesystem: Filesystem implementation
- laminas/laminas-cache-storage-adapter-memcached: Memcached implementation
- laminas/laminas-cache-storage-adapter-memory: Memory implementation
- laminas/laminas-cache-storage-adapter-redis: Redis implementation
- laminas/laminas-cache-storage-adapter-session: Session implementation
- laminas/laminas-cli: The laminas-cli binary can be used to consume commands provided by this component
- laminas/laminas-serializer: Laminas\Serializer component
Provides
Conflicts
- laminas/laminas-serializer: <3.0
- symfony/console: <5.1
- 4.2.x-dev
- 4.1.x-dev
- 4.1.0
- 4.0.x-dev
- 4.0.4
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 3.13.x-dev
- 3.12.x-dev
- 3.12.2
- 3.12.1
- 3.12.0
- 3.11.x-dev
- 3.11.0
- 3.10.x-dev
- 3.10.1
- 3.10.0
- 3.9.x-dev
- 3.9.1
- 3.9.0
- 3.8.x-dev
- 3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dev-renovate/lock-file-maintenance
- dev-renovate/phpunit-phpunit-11.x
This package is auto-updated.
Last update: 2024-12-02 01:47:31 UTC
README
π·πΊ Π ΡΡΡΠΊΠΈΠΌ Π³ΡΠ°ΠΆΠ΄Π°Π½Π°ΠΌ
ΠΡ, ΡΡΠ°ΡΡΠ½ΠΈΠΊΠΈ Laminas, ΡΠΎΠ΄ΠΈΠ»ΠΈΡΡ ΠΈ ΠΆΠΈΠ²Π΅ΠΌ Π² ΡΠ°Π·Π½ΡΡ ΡΡΡΠ°Π½Π°Ρ . Π£ ΠΌΠ½ΠΎΠ³ΠΈΡ ΠΈΠ· Π½Π°Ρ Π΅ΡΡΡ Π΄ΡΡΠ·ΡΡ, ΡΠΎΠ΄ΡΡΠ²Π΅Π½Π½ΠΈΠΊΠΈ ΠΈ ΠΊΠΎΠ»Π»Π΅Π³ΠΈ ΠΊΠ°ΠΊ Π² Π ΠΎΡΡΠΈΠΈ, ΡΠ°ΠΊ ΠΈ Π² Π£ΠΊΡΠ°ΠΈΠ½Π΅. ΠΠ΅ΠΊΠΎΡΠΎΡΡΠ΅ ΠΈΠ· Π½Π°Ρ ΡΠΎΠ΄ΠΈΠ»ΠΈΡΡ Π² Π ΠΎΡΡΠΈΠΈ. ΠΠ΅ΠΊΠΎΡΠΎΡΡΠ΅ ΠΈΠ· Π½Π°Ρ ΠΆΠΈΠ²ΡΡ Π² Π ΠΎΡΡΠΈΠΈ. Π£ Π½Π΅ΠΊΠΎΡΠΎΡΡΡ Π±Π°Π±ΡΡΠΊΠΈ ΠΈ Π΄Π΅Π΄ΡΡΠΊΠΈ ΡΡΠ°ΠΆΠ°Π»ΠΈΡΡ Ρ ΡΠ°ΡΠΈΡΡΠ°ΠΌΠΈ Π²ΠΎ ΠΡΠΎΡΠΎΠΉ ΠΌΠΈΡΠΎΠ²ΠΎΠΉ Π²ΠΎΠΉΠ½Π΅. ΠΠ΄Π΅ΡΡ Π½ΠΈΠΊΡΠΎ Π½Π΅ ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΈΠ²Π°Π΅Ρ ΡΠ°ΡΠΈΠ·ΠΌ.
Π£ ΠΎΠ΄Π½ΠΎΠ³ΠΎ ΠΈΠ· Π½Π°Ρ Π΅ΡΡΡ ΡΠΊΡΠ°ΠΈΠ½ΡΠΊΠ°Ρ ΡΠΎΠ΄ΡΡΠ²Π΅Π½Π½ΠΈΡΠ°, ΠΊΠΎΡΠΎΡΠ°Ρ ΡΠΏΠ°ΡΠ»Π°ΡΡ ΠΈΠ· Π΄ΠΎΠΌΠ° Π²ΠΌΠ΅ΡΡΠ΅ Ρ ΡΡΠ½ΠΎΠΌ. ΠΠΎΠ΅Π·Π΄ Π·Π°Π΄Π΅ΡΠΆΠ°Π»ΡΡ ΠΈΠ·-Π·Π° Π±ΠΎΠΌΠ±Π΅ΠΆΠΊΠΈ Π½Π° Π΄ΠΎΡΠΎΠ³Π΅ Π²ΠΏΠ΅ΡΠ΅Π΄ΠΈ. Π£ Π½Π°Ρ Π΅ΡΡΡ Π΄ΡΡΠ·ΡΡ, ΠΊΠΎΡΠΎΡΡΠ΅ ΠΏΡΡΡΡΡΡΡ Π² Π±ΠΎΠΌΠ±ΠΎΡΠ±Π΅ΠΆΠΈΡΠ°Ρ . ΠΡ Ρ ΡΡΠ΅Π²ΠΎΠ³ΠΎΠΉ ΠΆΠ΄Π΅ΠΌ Π²Π΅ΡΡΠΎΡΠΊΠΈ ΠΎΡ Π½ΠΈΡ ΠΏΠΎΡΠ»Π΅ Π²ΠΎΠ·Π΄ΡΡΠ½ΡΡ Π½Π°Π»Π΅ΡΠΎΠ², ΠΊΠΎΡΠΎΡΡΠ΅ Π±Π΅ΡΠΏΠΎΡΡΠ΄ΠΎΡΠ½ΠΎ Π½Π°Π½ΠΎΡΡΡ ΡΠ΄Π°ΡΡ ΠΈ ΠΏΠΎΠΏΠ°Π΄Π°ΡΡ ΠΏΠΎ Π±ΠΎΠ»ΡΠ½ΠΈΡΠ°ΠΌ, ΡΠΊΠΎΠ»Π°ΠΌ, Π΄Π΅ΡΡΠΊΠΈΠΌ ΡΠ°Π΄Π°ΠΌ ΠΈ Π΄ΠΎΠΌΠ°ΠΌ. ΠΡ Π½Π΅ Π±Π΅ΡΠ΅ΠΌ ΡΡΠΎ ΠΈΠ· ΠΊΠ°ΠΊΠΈΡ -Π»ΠΈΠ±ΠΎ Π‘ΠΠ. ΠΡ Π½Π°Π±Π»ΡΠ΄Π°Π΅ΠΌ ΡΡΠΎ Π½Π°ΠΏΡΡΠΌΡΡ.
ΠΡ Π΄ΠΎΠ²Π΅ΡΡΠ΅ΡΠ΅ Π½Π°ΠΌ Π΄ΠΎΡΡΠ°ΡΠΎΡΠ½ΠΎ, ΡΡΠΎΠ± ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ Π½Π°ΡΠΈ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ, ΠΈ ΠΌΡ ΠΏΡΠΎΡΠΈΠΌ Π²Π°Ρ Π΄ΠΎΠ²Π΅ΡΠΈΡΡΡΡ Π½Π°ΠΌ Π²Π½ΠΎΠ²Ρ. ΠΡ Π½ΡΠΆΠ΄Π°Π΅ΠΌΡΡ Π² ΠΏΠΎΠΌΠΎΡΠΈ. ΠΡΡ ΠΎΠ΄ΠΈΡΠ΅ ΠΈ ΠΏΡΠΎΡΠ΅ΡΡΡΠΉΡΠ΅ ΠΏΡΠΎΡΠΈΠ² ΡΡΠΎΠΉ Π±Π΅ΡΠΏΠΎΠ»Π΅Π·Π½ΠΎΠΉ Π²ΠΎΠΉΠ½Ρ. ΠΡΡΠ°Π½ΠΎΠ²ΠΈΡΠ΅ ΠΊΡΠΎΠ²ΠΎΠΏΡΠΎΠ»ΠΈΡΠΈΠ΅. Π‘ΠΊΠ°ΠΆΠΈΡΠ΅ "ΠΠ΅Ρ Π²ΠΎΠΉΠ½Π΅!"
πΊπΈ To Citizens of Russia
We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism.
One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences.
You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say "stop the war!"
Laminas\Cache
provides a general cache system for PHP. The Laminas\Cache
component
is able to cache different patterns (class, object, output, etc) using different
storage adapters (DB, File, Memcache, etc).
- File issues at https://github.com/laminas/laminas-cache/issues
- Documentation is at https://docs.laminas.dev/laminas-cache/
Standalone
If this component is used without laminas-mvc
or mezzio
, a PSR-11 container to fetch services, adapters, plugins, etc. is needed.
The easiest way would be to use laminas-config-aggregator along with laminas-servicemanager.
use Laminas\Cache\ConfigProvider; use Laminas\Cache\Service\StorageAdapterFactoryInterface; use Laminas\Cache\Storage\Adapter\Memory; use Laminas\ConfigAggregator\ConfigAggregator; use Laminas\ServiceManager\ServiceManager; $config = (new ConfigAggregator([ ConfigProvider::class, ]))->getMergedConfig(); $dependencies = $config['dependencies']; $container = new ServiceManager($dependencies); /** @var StorageAdapterFactoryInterface $storageFactory */ $storageFactory = $container->get(StorageAdapterFactoryInterface::class); $storage = $storageFactory->create(Memory::class); $storage->setItem('foo', 'bar');
Benchmarks
We provide scripts for benchmarking laminas-cache using the
PHPBench framework; these can be
found in the benchmark/
directory of each storage adapter.
To execute the benchmarks you can run the following command:
$ vendor/bin/phpbench run --report=aggregate