Source for file OCSP_CACHE_FILE.phpclass
Documentation is available at OCSP_CACHE_FILE.phpclass
* openCSP class file OCSP_CACHE_FILE.phpclass
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: OCSP_CACHE_FILE.phpclass,v 1.6 2008/12/12 17:35:14 pitlinz Exp $
// ---------------------------------------------------------
// ---------------------------------------------------------
require
__OCSP_PHPINCPATH__ .
"common" .
_OCSP_DIRSEP_ .
"pcf_directory.phpinc";
require
__OCSP_PHPINCPATH__ .
"common" .
_OCSP_DIRSEP_ .
"pcf_file.phpinc";
* openCSP class OCSP_CACHE_FILE
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: OCSP_CACHE_FILE.phpclass,v 1.6 2008/12/12 17:35:14 pitlinz Exp $
/*** class constants --------------------------------------------- */
* @constant string CLASS_SRC_FILE
/*** class variables --------------------------------------------- */
* @var string $cacheSubDirName
protected static $cacheSubDirName =
'ocsp_cache';
/*** class functions --------------------------------------------- */
* returns if the cache type is usable on the system
public static function isUseable($debug=
False)
if ($debug) echoDebugMethod(__FILE__
,"static","OCSP_CACHE_FILE::isUseable()");
if ($debug) echoDebugLine(__FILE__
,__LINE__
,"cache path: " .
$str_dir .
" is writeable");
if ($debug) echoDebugLine(__FILE__
,__LINE__
,"cache path: " .
$str_dir .
" is NOT writeable");
/*** compostion --------------------------------------------------- */
/*** attributes -------------------------------------------------- */
/*** factory / construct ----------------------------------------- */
* returns the instance of the singleton class
$group =
(empty($group) ?
'DEFAULT' :
$group);
if (!isset
(self::$cacheInstances['FILE'][$group]) ||
!pcf_is_instance_of(self::$cacheInstances['FILE'][$group],'OCSP_CACHE_FILE'))
self::$cacheInstances['FILE'][$group] =
new OCSP_CACHE_FILE($group);
return self::$cacheInstances['FILE'][$group];
/*** getter / setter ---------------------------------------------- */
* retuns the cache file path on the server
if ($debug) echoDebugMethod(__FILE__
,get_class($this),"OCSP_CACHE_FILE::getCacheFilePath()","Group: " .
$this->myGroup);
$str_dir =
OCSP_OBJ::getConf('CACHEPATH') .
self::$cacheSubDirName .
_OCSP_DIRSEP_;
* removes a value from the cache
/*** persistent storage ------------------------------------------- */
* loads the cache values from the file
if ($debug) echoDebugLine(__FILE__
,__LINE__
,"loading file " .
$str_filePath .
"<br />\$this->myValues: <pre>" .
print_r($this->myValues,True) .
"</pre>");
* stores all temp cached values
$arr_newValues =
array();
foreach($this->myValues as $str_name =>
$arr_val)
$ttl =
$arr_val['EXP'] -
$arr_val['TTL'];
$arr_val['EXP'] =
time() +
intval($arr_val['TTL']);
$bol_changed =
((isset
($arr_val['CHA']) &&
$arr_val['CHA']) ?
True :
False);
unset
($this->myValues[$str_name]['CHA']);
$arr_newValues[$str_name] =
$this->myValues[$str_name];
Documentation generated on Thu, 08 Jan 2009 17:45:12 +0100 by phpDocumentor 1.4.0a2