Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on Jun 2, 2024 via composer

symfony/cache v4.4.34

Provides an extended PSR-6, PSR-16 (and tags) implementation
Package summary
Share
0
issues
1
license
10
MIT
Package created
19 Jan 2016
Version published
16 Nov 2021
Maintainers
1
Total deps
10
Direct deps
7
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
10 Packages, Including:
psr/cache@2.0.0
psr/container@1.1.2
psr/log@3.0.0
symfony/cache@v4.4.34
symfony/cache-contracts@v2.5.3
symfony/deprecation-contracts@v3.5.0
symfony/polyfill-php73@v1.29.0
symfony/polyfill-php80@v1.29.0
symfony/service-contracts@v2.5.3
symfony/var-exporter@v5.4.39
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

7
All Dependencies CSV
β“˜ This is a list of symfony/cache 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
psr/cache2.0.05.99 kBMIT
prod
psr/log3.0.06.77 kBMIT
prod
symfony/cache-contractsv2.5.3-MIT
prod
symfony/polyfill-php73v1.29.04.15 kBMIT
prod
symfony/polyfill-php80v1.29.0-MIT
prod
symfony/service-contractsv2.5.3-MIT
prod
symfony/var-exporterv5.4.39-MIT
prod

Visualizations

Frequently Asked Questions

What does symfony/cache do?

Symfony/Cache is a powerful component used to add cache to your applications. Following the PSR-6 and PSR-16 caching standards, Symfony/Cache is designed for speed and low overhead to make caching faster and more efficient. It's packed with adapters for the most common caching backends and also provides implementations for Symfony's CacheInterface and TagAwareCacheInterface from the symfony/cache-contracts package. Leveraging caching in your applications can greatly improve performance by storing data in a cache for faster future access.

How do you use symfony/cache?

To use symfony/cache, first, you need to install it via composer. Run composer require symfony/cache. This command installs the symfony/cache package into your project.

Here is an example of how to use the cache component:

use Symfony\Contracts\Cache\ItemInterface;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;

// The first argument is the namespace, which should be unique per cache pool
// The second argument is the default lifetime of cache items, in seconds
$cache = new FilesystemAdapter('my_cache_namespace', 3600);

// Attempt to fetch the cached value
$value = $cache->get('my_cache_key', function (ItemInterface $item) {
    $item->expiresAfter(3600);

    // do some expensive computation or fetch data
    // and finally return the computed value
    return "cached value";
});

echo $value;  // Output: "cached value"

In this example, we first create an instance of FilesystemAdapter which represents the cache pool. Next, we attempt to fetch a value from the cache using the get() method. If the value does not exist in the cache, we use a callback function to compute and return the value, which gets stored in the cache.

Where are the symfony/cache docs?

For detailed usage and examples, you can refer to the official Symfony Cache component documentation by visiting Symfony's official documentation. You can also contribute, report issues and send pull requests in the main Symfony repository. The symfony/cache package follows Symfony's code of conduct and contributing guidelines.