PHP Classes

File: example/indexAPCU.php

Recommend this page to a friend!
  Classes of Muhammad Umer Farooq   PHP Simple Cache Library   example/indexAPCU.php   Download  
File: example/indexAPCU.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Simple Cache Library
Access data in different types of cache containers
Author: By
Last change:
Date: 5 years ago
Size: 630 bytes
 

Contents

Class file image Download
<?php


//load the cache file
require_once 'init.php';

$apcu = new Lablnet\APCU();
/* APCU usage */

//store
$apcu->add('name', 'malik');
$apcu->add('age', 25);
$apcu->add('email', 'lablnet01@gmail.com');

//store and override existance
$apcu->addOverride('age', 17);

//update the record/value
$apcu->update('name', 'malik', 'Malik Umer Farooq');

//get the cache value
var_dump($apcu->get('name'));

//delete the cache value
$apcu->delete('email');

//checking is cache is exists
var_dump($apcu->isCached('age'));

//apcu cache info
echo '<br>';
var_dump($apcu->apucInfo());

//delete the all cache data
$apcu->deleteMaster();