PHP Classes

File: tests/sample.memcached.php

Recommend this page to a friend!
  Classes of Oleg Butuzov  >  Cacheme  >  tests/sample.memcached.php  >  Download  
File: tests/sample.memcached.php
Role: Example script
Content type: text/plain
Description: one more sample
Class: Cacheme
Cache data in different types of container
Author: By
Last change:
Date: 14 years ago
Size: 680 bytes


Class file image Download
include dirname(dirname(__FILE__)).'/Cacheme/Cacheme.php';
$cache = CacheMeLoader::Factory('memcache://');
$cache->lifetime = 10;

$cache->lifetime = 24*60*60;
$mycoolvariable = "mycoolvariable";

/* setting variable */
$cache->set($mycoolvariable, $mycoolvariable);

/* getting variable */
var_dump('1 - '.$cache->get($mycoolvariable));

/* flush */
var_dump('2 not exists'.$cache->get($mycoolvariable));
$cache->set($mycoolvariable, $mycoolvariable);

/* delete variable */
var_dump('3 not exists'.$cache->get($mycoolvariable));

For more information send a message to info at phpclasses dot org.