Open Sencillo  2014.008
 All Data Structures Files Functions Variables Pages
cache.php
Go to the documentation of this file.
1 <?php
2 /*~ cache.php
3 .---------------------------------------------------------------------------.
4 | Software: SencilloCache |
5 | Version: 2014.002 |
6 | Contact: ph@mastery.sk |
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 /* Credits:
20  *
21  * Based upon and inspired by:
22  * QuickCache <andy.prevost@worxteam.com> (http://sourceforge.net/projects/quickcache)
23  */
24 
25 $QUICKCACHE_VERSION="v2014.002";
26 
27 // Set the includedir to the quickcache-directory
28 $includedir = "./fw_cache";
29 
30 /* File based caching setting. */
32  // Directory where quickcache will store generated files.
33  // Please use a dedicated directory, and make it writable
34 
35 /* IF USING DATABASE TYPE CACHE STORAGE, FILL INFO BELOW */
36 
37 /* Some settings are specific for the type of cache you are running, like
38  * file- or database-based.
39  * Define which QuickCache type you want to use (db storage and/or system).
40  * Note: with 2.1rc1, file type is assumed unless another type is selected
41  * This allows for system-specific patches & handling, as sometimes
42  * 'platform independent' is behaving quite differently.
43  */
44 
45 /* DB based caching settings
46  * Fill in your username and password
47  * ONLY if you intend to use the MySQL database to store
48  * cache settings, otherwise, leave blank
49  */
50 $QUICKCACHE_DB_HOST = $DBHost; // Database Server
51 $QUICKCACHE_DB_DATABASE = $DBName; // Database-name to use
52 $QUICKCACHE_DB_USERNAME = $DBUser; // Username
53 $QUICKCACHE_DB_PASSWORD = $DBPass; // Password
54 $QUICKCACHE_DB_TABLE = 'sencillo_cache'; // Table that holds the data
55 $QUICKCACHE_OPTIMIZE = 1; // If 'OPTIMIZE TABLE' after garbage
56  // collection is executed. Please check
57  // first if this works on your mySQL!
58 
59 IF ($QUICKCACHE_DB_USERNAME != '') {
60  $QUICKCACHE_TYPE = 'mysql'; /* means this is a 'MySQL' type cache */
61 } else {
62  $QUICKCACHE_TYPE = 'file'; /* means this is a 'file' type cache */
63 }
64 
65 /* IF YOU HAVE IMPLEMENTED YOUR OWN TYPE OF STORAGE OR FILE SYSTEM
66  * FILL IN BELOW AND EMAIL TO 'andy.prevost@worxteam.com' TO INCLUDE IN
67  * THE NEXT RELEASE OF QUICKCACHE
68  */
69 // $QCACHE_TYPE = 'template';
70 
71 /* General configuration options */
72 $QUICKCACHE_TIME = 900; // Default number of seconds to cache a page
73 $QUICKCACHE_DEBUG = 0; // Turn debugging on/off
74 $QUICKCACHE_IGNORE_DOMAIN= 1; // Ignore domain name in request(single site)
75 $QUICKCACHE_ON = 1; // Turn caching on/off
76 $QUICKCACHE_USE_GZIP = 1; // Whether or not to use GZIP
77 $QUICKCACHE_POST = 0; // Should POST's be cached (default OFF)
78 $QUICKCACHE_GC = 1; // Probability % of garbage collection
79 $QUICKCACHE_GZIP_LEVEL = 9; // GZIPcompressionlevel to use (1=low,9=high)
80 $QUICKCACHE_CLEANKEYS = 0; // Set to 1 to avoid hashing storage-key:
81  // you can easily see cachefile-origin.
82 
84  // Prefix used in the filename. This enables
85  // QuickCache to (more accurately) recognize
86  // quickcache files.
87 
88 if ( isCGI() ) {
89  $QUICKCACHE_ISCGI = 1; // CGI-PHP is running
90 } else {
91  $QUICKCACHE_ISCGI = 0; // PHP is running as module - definitely not CGI
92 }
93 
94 // Standard functions
95 require $includedir . "/cache_main.php";
96 
97 // Type specific implementations
98 require $includedir . "/type/" . $QUICKCACHE_TYPE . ".php";
99 
100 // Start caching
102 
103 /* function to determine if PHP is loaded as a CGI-PHP or as an Apache module */
104 function isCGI() {
105  if (substr(php_sapi_name(), 0, 3) == 'cgi') {
106  return true;
107  } else {
108  return false;
109  }
110 }
111 
112 ?>
$QUICKCACHE_DB_USERNAME
Definition: cache.php:52
$QUICKCACHE_CLEANKEYS
Definition: cache.php:80
$QUICKCACHE_TIME
Definition: cache.php:72
$QUICKCACHE_FILEPREFIX
Definition: cache.php:83
$QUICKCACHE_DEBUG
Definition: cache.php:73
$QUICKCACHE_GZIP_LEVEL
Definition: cache.php:79
isCGI()
Definition: cache.php:104
$QUICKCACHE_OPTIMIZE
Definition: cache.php:55
$QUICKCACHE_DB_HOST
Definition: cache.php:50
$QUICKCACHE_ON
Definition: cache.php:75
$QUICKCACHE_DIR
Definition: cache.php:31
$QUICKCACHE_IGNORE_DOMAIN
Definition: cache.php:74
$includedir
Definition: cache.php:28
quickcache_start()
Definition: cache_main.php:175
$QUICKCACHE_DB_DATABASE
Definition: cache.php:51
$QUICKCACHE_GC
Definition: cache.php:78
$QUICKCACHE_DB_PASSWORD
Definition: cache.php:53
$QUICKCACHE_VERSION
Definition: cache.php:25
$QUICKCACHE_USE_GZIP
Definition: cache.php:76
$QUICKCACHE_DB_TABLE
Definition: cache.php:54
$QUICKCACHE_POST
Definition: cache.php:77