Open Sencillo
2014.008
Main Page
Related Pages
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Files
Functions
Variables
Pages
template.php
Go to the documentation of this file.
1
<?php
2
/*~ template.php
3
.---------------------------------------------------------------------------.
4
| Software: SencilloCache |
5
| Version: 2014.002 |
6
| Contact:
[email protected]
|
7
| ------------------------------------------------------------------------- |
8
| Author: Bc. Peter Horváth (original founder) |
9
| Copyright (c) 2014, Bc. Peter Horváth. All Rights Reserved. |
10
| ------------------------------------------------------------------------- |
11
| License: Distributed under the General Public License (GPL) |
12
| http://www.gnu.org/copyleft/gpl.html |
13
| This program is distributed in the hope that it will be useful - WITHOUT |
14
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
15
| FITNESS FOR A PARTICULAR PURPOSE. |
16
'---------------------------------------------------------------------------'
17
~*/
18
19
/* Template for other types of cache
20
* You'll need to implement these 5 functions, add
21
* additional functions inhere.
22
*
23
* Add variables you use to quickcache_config.php
24
*
25
* When you've implemented a new storage-system, and think that the world
26
* could/should use it too, please submit it to me (
[email protected]
),
27
* and we will include it in a next release (with full credits, of course).
28
*/
29
30
/* quickcache_restore()
31
* Will (try to) restore the cachedata.
32
*/
33
function
quickcache_restore
() {
34
global
$QUICKCACHE_TIME
, $cache_key, $cachedata_gzdata, $cachedata_datasize, $cachedata_datacrc;
35
36
// Implement restoring of cached data
37
//
38
// Use $cache_key to lookup data, use $JPACHE_TIME to check if
39
// data is still valid.
40
//
41
// If data-retrieval was succesfull, you'll need to set
42
// $cachedata_gzdata, $cachedata_datasize and $cachedata_datacrc
43
// and return true, if unsuccesfull, return false.
44
45
return
false
;
46
}
47
48
/* quickcache_write()
49
* Will (try to) write out the cachedata to the db
50
*/
51
function
quickcache_write
($gzcontents, $size, $crc32) {
52
global
$QUICKCACHE_TIME
,
$QUICKCACHE_ON
, $cache_key;
53
54
// Implement writing of the data as given.
55
// Store on $cache_key and add a 'field' for $QUICKCACHE_TIME
56
// Store the 3 parameters seperatly
57
}
58
59
/* quickcache_do_gc()
60
* Performs the actual garbagecollection
61
*/
62
function
quickcache_do_gc
() {
63
// Implement garbage-collection
64
}
65
66
67
/* quickcache_do_start()
68
* Additional code that is executed before real quickcache-code kicks
69
*/
70
function
quickcache_do_start
() {
71
// Add additional code you might require
72
}
73
74
/* quickcache_do_end()
75
* Additional code that us executed after caching has been performed,
76
* but just before output is returned. No new output can be added.
77
*/
78
function
quickcache_do_end
() {
79
// Add additional code you might require
80
}
81
82
// Make sure no additional lines/characters are after the closing-tag!
83
?>
quickcache_write
quickcache_write($gzcontents, $size, $crc32)
Definition:
template.php:51
$QUICKCACHE_TIME
$QUICKCACHE_TIME
Definition:
cache.php:72
quickcache_do_start
quickcache_do_start()
Definition:
template.php:70
quickcache_do_gc
quickcache_do_gc()
Definition:
template.php:62
$QUICKCACHE_ON
$QUICKCACHE_ON
Definition:
cache.php:75
quickcache_do_end
quickcache_do_end()
Definition:
template.php:78
quickcache_restore
quickcache_restore()
Definition:
template.php:33
fw_cache
type
template.php
Generated on Mon Aug 11 2014 23:52:16 for Open Sencillo by
1.8.6