PHP code example of aequasi / memcached-bundle

1. Go to this page and download the library: Download aequasi/memcached-bundle 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/ */

    

aequasi / memcached-bundle example snippets


$bundles(
    ...
       new Aequasi\Bundle\MemcachedBundle\AequasiMemcachedBundle(),
    ...
);

php app/console config:dump aequasi_memcached

use Aequasi\Bundle\MemcachedBundle\Cache\AntiStampedeMemcached as Cache;

/** @var $em \Doctrine\ORM\EntityManager */
$data = $this->get( 'memcached.default' )->cache(
	'somekey',
	function( ) use( $em, $color ) {
		$repo = $em->getRepository( 'AcmeDemoBundle:Fruit' );
		return $repo->findBy( array( 'color' => $color ) );
	}, Cache::THIRTY_MINUTE
);