TITAN Library for PHP5  5.1.0
Web Software Development Kit for PHP5
cache Class Reference

Titan Cache Class. More...

Inheritance diagram for cache:
iterator callback

Public Member Functions

 __construct ($cache_id, $load_cache=true, $expires_in= '+1 day')
 
 set ($name, $value= '', $save_cache=false)
 
 get ($name, $value= '')
 
 load ()
 
 save ()
 
- Public Member Functions inherited from iterator
 max_count ($max_count=-1)
 
- Public Member Functions inherited from callback
 __construct ($callback=NULL)
 
 callback ($callback=NULL)
 
 argument ($value)
 
 parameter ($name, $value= '')
 
factory (array $arguments=array())
 
execute ()
 

Data Fields

 $cache_id = ''
 Unique key.
 
 $access_time = ''
 Current server time just after reads and just before writes.
 
 $expire_time = ''
 When does the cache expire, relative to it's access_time.
 
 $expires_in = '+1 day'
 When does the cache expire, relative to it's access_time.
 
 $data = ''
 Serialized data.
 

Protected Attributes

 $timestamp = false
 timestamp object
 
 $database = false
 mysqli object
 
 $table = 'data_cache'
 table name
 

Additional Inherited Members

- Protected Member Functions inherited from callback
arguments (array $arguments=array())
 

Detailed Description

Titan Cache Class.

Class: \tl\data\cache

Author
James E. Bush work@.nosp@m.bush.nosp@m..cc
Version
5.1.0

Table data_cache:

  DROP TABLE IF EXISTS `data_cache`;
  CREATE TABLE IF NOT EXISTS `data_cache` (
    `idx` int(11) NOT NULL AUTO_INCREMENT,
    `cache_id` char(32) COLLATE utf8_unicode_ci NOT NULL,
    `access_time` varchar(14) COLLATE utf8_unicode_ci NOT NULL,
    `expire_time` varchar(14) COLLATE utf8_unicode_ci NOT NULL,
    `expires_in` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
    `content` text COLLATE utf8_unicode_ci NOT NULL,
    PRIMARY KEY (`idx`),
    KEY `cache_id` (`cache_id`),
    KEY `expire_time` (`expire_time`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Constructor & Destructor Documentation

__construct (   $cache_id,
  $load_cache = true,
  $expires_in = '+1 day' 
)

Constructor

Parameters
string$cache_idCache ID
boolean$load_cache(optional) Should we load the session? (default) true
string$expires_in(optional) How long before the session expires? (default) '+1 day'
Returns
session Session handling object

Member Function Documentation

set (   $name,
  $value = '',
  $save_cache = false 
)

Set the cache content

Parameters
string$nameThe name of the cache variable to set
mixed$value(optional) The new value for the cache content (default) '', erase the cache content
boolean$save_cache(optional) Should we save the cache after setting this variable? (default) false
Returns
mixed The value of the cache variable
get (   $name,
  $value = '' 
)

Get the value of a cache variable

Parameters
string$nameThe name of the cache variable to retrieve
mixed$value(optional) Default value if not already set (default) ''
Returns
mixed The value of the cache variable
load ( )

Load the cache data

save ( )

Save the data


The documentation for this class was generated from the following file: