<?php
//load the class file
require_once 'init.php';
/* Memcache usage */
//connection
$mcache = new Lablnet\mcache('localhost', 11111);
//store
$mcache->store('name', 'Malik Umer Farooq', 0);
$mcache->store('age', '17', 0);
$mcache->store('email', 'lablnet01@gmail.org', 0);
//update
$mcache->update('email', 'lablnet01@gmail.com');
//replace
$mcache->replace('email', 'umer@gmail.com', 0);
//delete
$delete = $mcache->delete('email');
//get once record
var_dump($mcache->get('name'));
//get multiple records
echo '<br>';
var_dump($mcache->getMultiple(['name', 'age']));
//delete master its delete all data
//$mcache->deleteMaster();
//add new server
$mcache->addServer('localhost', 22222);
//version
$version = $mcache->version();
//finally close the server connection
$mcache->close();
|