FOSSology  4.4.0
Open Source License Compliance by Open Source Software
common-cache.php File Reference

General purpose classes used for fossology report cache. More...

Go to the source code of this file.

Namespaces

 common
 

Functions

 ReportCacheGet ($CacheKey)
 This function is used by Output() to see if the requested report is in the report cache. More...
 
 ReportCachePut ($CacheKey, $CacheValue)
 This function is used to write a record to the report cache. If the record already exists, update it. More...
 
 ReportCachePurgeAll ()
 Purge all records from the report cache.
 
 ReportCachePurgeByDate ($PurgeDate)
 Purge from the report cache records that have been accessed previous to $PurgeDate. More...
 
 ReportCachePurgeByUpload ($UploadPK)
 Purge from the report cache records for upload $UploadPK. More...
 
 ReportCachePurgeByKey ($CacheKey)
 Purge from the report cache the record with $CacheKey. More...
 

Detailed Description

General purpose classes used for fossology report cache.

Definition in file common-cache.php.

Function Documentation

◆ ReportCacheGet()

ReportCacheGet (   $CacheKey)

This function is used by Output() to see if the requested report is in the report cache.

If it is, the report is returned as a string. Else, there is an empty return. By convention, this should be called with _SERVER[REQUEST_URI]. However, any data may be put into the cache by any key. This function also purges the cache of unused items.

Parameters
string$CacheKeyCachekey, can get cache value through cachedkey
Returns
Return null when cache is off for this user, else return value for this key
Remarks
UserCacheStat: Does user want cache on?
0 Don't know
1 Cache is on
2 Cache is off for this user
$UserCacheStat = 0; // default, don't know

Check if user has cache turned off by default it is on for everyone. If a record does not exist for this user, then the cache is on default is used.

Definition at line 39 of file common-cache.php.

◆ ReportCachePurgeByDate()

ReportCachePurgeByDate (   $PurgeDate)

Purge from the report cache records that have been accessed previous to $PurgeDate.

Parameters
string$PurgeDateFormat: YYYY-MM-DD HH:MM:SS (or some portion thereof).

Definition at line 167 of file common-cache.php.

◆ ReportCachePurgeByKey()

ReportCachePurgeByKey (   $CacheKey)

Purge from the report cache the record with $CacheKey.

Parameters
string$CacheKeyCan get cachevalue through cachedkey
Returns
Error message

Definition at line 199 of file common-cache.php.

◆ ReportCachePurgeByUpload()

ReportCachePurgeByUpload (   $UploadPK)

Purge from the report cache records for upload $UploadPK.

Parameters
int$UploadPKUpload id

Definition at line 182 of file common-cache.php.

◆ ReportCachePut()

ReportCachePut (   $CacheKey,
  $CacheValue 
)

This function is used to write a record to the report cache. If the record already exists, update it.

Parameters
string$CacheKeyCachekey
string$CacheValueCachevalue

Definition at line 94 of file common-cache.php.