1. Go to this page and download the library: Download chh/cache-service-provider library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Pimple\Container;
use Pimple\ServiceProviderInterface;
use CHH\Silex\CacheServiceProvider\CacheNamespace;
class ExampleServiceProvider extends ServiceProviderInterface
{
function register(Container $app)
{
// Check if Cache Service Provider is registered:
if (isset($app['caches'])) {
$app['caches'] = $app->extend(function ($caches) use ($app) {
// Use a CacheNamespace to safely add keys to the default
// cache.
$caches['example'] = function () use ($caches) {
return new CacheNamespace('example', $caches['default']);
};
return $caches;
});
}
}
}
// Check if Cache Service Provider is registered:
if (isset($app['caches'])) {
$app['caches'] = $app->extend(function ($caches) use ($app) {
// Use a CacheNamespace to safely add keys to the default cache
$caches['example'] = $app['cache.namespace']('example');
return $caches;
});
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.