PHP code example of igormatkovic / memcache
1. Go to this page and download the library: Download igormatkovic/memcache 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/ */
igormatkovic / memcache example snippets
"igormatkovic/memcache": "dev-master"
'Igormatkovic\Memcache\MemcacheServiceProvider',
'driver' => 'memcache',
use Illuminate\Cache\Repository;
use Igormatkovic\Memcache\MemcacheStore;
use Igormatkovic\Memcache\MemcacheConnector;
Cache::extend('memcache', function($app) {
$servers = Config::get('cache.memcached');
$prefix = Config::get('cache.prefix');
$memcache = (new MemcacheConnector())->connect($servers);
return new Repository(new MemcacheStore($memcache, $prefix));
});
'driver' => 'memcache',
phpunit