Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
552
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.76 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. /*~ quickcache.php
  5. .---------------------------------------------------------------------------.
  6. | Software: QuickCache |
  7. | Version: 2.1rc1 |
  8. | Contact: andy.prevost@worxteam.com |
  9. | Info: http://sourceforge.net/projects/quickcache |
  10. | Support: http://sourceforge.net/projects/quickcache |
  11. | ------------------------------------------------------------------------- |
  12. | Author: Andy Prevost andy.prevost@worxteam.com (admin) |
  13. | Author: Jean-Pierre Deckers (original founder) |
  14. | Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved. |
  15. | Copyright (c) 2001-2003, Jean-Pierre Deckers jp@jpcache.com |
  16. | * NOTE: QuickCache is the 'jpcache' project renamed. 'jpcache |
  17. | information and downloads can still be accessed at the |
  18. | sourceforge.net site |
  19. | ------------------------------------------------------------------------- |
  20. | License: Distributed under the General Public License (GPL) |
  21. | http://www.gnu.org/copyleft/gpl.html |
  22. | This program is distributed in the hope that it will be useful - WITHOUT |
  23. | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
  24. | FITNESS FOR A PARTICULAR PURPOSE. |
  25. | ------------------------------------------------------------------------- |
  26. | We offer a number of paid services: |
  27. | - Web Hosting on highly optimized fast and secure servers |
  28. | - Technology Consulting |
  29. | - Oursourcing (highly qualified programmers and graphic designers) |
  30. '---------------------------------------------------------------------------'
  31. Last modified: October 31 2007 ~*/
  32.  
  33. /* **************************************************************************
  34. * This program is free software; you can redistribute it and/or
  35. * modify it under the terms of the GNU General Public License
  36. * as published by the Free Software Foundation; either version 2
  37. * of the License, or (at your option) any later version.
  38. *
  39. * This program is distributed in the hope that it will be useful,
  40. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  41. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  42. * GNU General Public License for more details.
  43.  
  44. * You should have received a copy of the GNU General Public License
  45. * along with this program; if not, write to the Free Software
  46. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  47. *************************************************************************** */
  48.  
  49. /* Credits:
  50. *
  51. * Based upon and inspired by:
  52. * phpCache <nathan@0x00.org> (http://www.0x00.org/phpCache)
  53. * gzdoc.php <catoc@163.net> and <jlim@natsoft.com.my>
  54. * jr-cache.php <jr-jrcache@quo.to>
  55. *
  56. * More info on http://quickcache.codeworxtech.com/
  57. */
  58.  
  59. $QUICKCACHE_VERSION="v2.1.1rc1";
  60.  
  61. // Set the includedir to the quickcache-directory
  62. //$includedir = "/www/MW_qXnayncqG/areasostaitalia.it/quickcache";
  63. //$includedir = "/var/www/html/quickcache";
  64. $includedir = "/var/www/quickcache";
  65.  
  66. /* File based caching setting. */
  67. $QUICKCACHE_DIR = $includedir . '/tmp';
  68. // Directory where quickcache will store generated files.
  69. // Please use a dedicated directory, and make it writable
  70.  
  71. /* IF USING DATABASE TYPE CACHE STORAGE, FILL INFO BELOW */
  72.  
  73. /* Some settings are specific for the type of cache you are running, like
  74. * file- or database-based.
  75. * Define which QuickCache type you want to use (db storage and/or system).
  76. * Note: with 2.1rc1, file type is assumed unless another type is selected
  77. * This allows for system-specific patches & handling, as sometimes
  78. * 'platform independent' is behaving quite differently.
  79. */
  80.  
  81. /* DB based caching settings
  82. * Fill in your username and password
  83. * ONLY if you intend to use the MySQL database to store
  84. * cache settings, otherwise, leave blank
  85. */
  86. $QUICKCACHE_DB_HOST = ''; // Database Server
  87. $QUICKCACHE_DB_DATABASE = ''; // Database-name to use
  88. $QUICKCACHE_DB_USERNAME = ''; // Username
  89. $QUICKCACHE_DB_PASSWORD = ''; // Password
  90. $QUICKCACHE_DB_TABLE = ''; // Table that holds the data
  91. $QUICKCACHE_OPTIMIZE = 1; // If 'OPTIMIZE TABLE' after garbage
  92. // collection is executed. Please check
  93. // first if this works on your mySQL!
  94.  
  95. IF ($QUICKCACHE_DB_USERNAME != '') {
  96. $QUICKCACHE_TYPE = 'mysql'; /* means this is a 'MySQL' type cache */
  97. } else {
  98. $QUICKCACHE_TYPE = 'file'; /* means this is a 'file' type cache */
  99. }
  100.  
  101. /* IF YOU HAVE IMPLEMENTED YOUR OWN TYPE OF STORAGE OR FILE SYSTEM
  102. * FILL IN BELOW AND EMAIL TO 'andy.prevost@worxteam.com' TO INCLUDE IN
  103. * THE NEXT RELEASE OF QUICKCACHE
  104. */
  105. // $QCACHE_TYPE = 'template';
  106.  
  107. /* General configuration options */
  108. $QUICKCACHE_TIME = 900; // Default number of seconds to cache a page
  109. $QUICKCACHE_DEBUG = 0; // Turn debugging on/off
  110. $QUICKCACHE_IGNORE_DOMAIN= 1; // Ignore domain name in request(single site)
  111. $QUICKCACHE_ON = 0; // Turn caching on/off
  112. $QUICKCACHE_USE_GZIP = 1; // Whether or not to use GZIP
  113. $QUICKCACHE_POST = 0; // Should POST's be cached (default OFF)
  114. $QUICKCACHE_GC = 1; // Probability % of garbage collection
  115. $QUICKCACHE_GZIP_LEVEL = 9; // GZIPcompressionlevel to use (1=low,9=high)
  116. $QUICKCACHE_CLEANKEYS = 0; // Set to 1 to avoid hashing storage-key:
  117. // you can easily see cachefile-origin.
  118.  
  119. $QUICKCACHE_FILEPREFIX = 'qcc-';
  120. // Prefix used in the filename. This enables
  121. // QuickCache to (more accurately) recognize
  122. // quickcache files.
  123.  
  124. if ( isCGI() ) {
  125. $QUICKCACHE_ISCGI = 1; // CGI-PHP is running
  126. } else {
  127. $QUICKCACHE_ISCGI = 0; // PHP is running as module - definitely not CGI
  128. }
  129.  
  130. // Standard functions
  131. require $includedir . "/quickcache_main.php";
  132.  
  133. // Type specific implementations
  134. require $includedir . "/type/" . $QUICKCACHE_TYPE . ".php";
  135.  
  136. // Start caching
  137. quickcache_start();
  138.  
  139. /* function to determine if PHP is loaded as a CGI-PHP or as an Apache module */
  140. function isCGI() {
  141. if (substr(php_sapi_name(), 0, 3) == 'cgi') {
  142. return true;
  143. } else {
  144. return false;
  145. }
  146. }
  147.  
  148. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement