本文整理汇总了PHP中CRM_Core_BAO_Cache::cleanup方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_Cache::cleanup方法的具体用法?PHP CRM_Core_BAO_Cache::cleanup怎么用?PHP CRM_Core_BAO_Cache::cleanup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_BAO_Cache
的用法示例。
在下文中一共展示了CRM_Core_BAO_Cache::cleanup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: civicrm_api3_job_cleanup
/**
* This api cleans up all the old session entries and temp tables.
*
* We recommend that sites run this on an hourly basis.
*
* @param array $params
* Sends in various config parameters to decide what needs to be cleaned.
*/
function civicrm_api3_job_cleanup($params)
{
$session = CRM_Utils_Array::value('session', $params, TRUE);
$tempTable = CRM_Utils_Array::value('tempTables', $params, TRUE);
$jobLog = CRM_Utils_Array::value('jobLog', $params, TRUE);
$prevNext = CRM_Utils_Array::value('prevNext', $params, TRUE);
$dbCache = CRM_Utils_Array::value('dbCache', $params, FALSE);
$memCache = CRM_Utils_Array::value('memCache', $params, FALSE);
$tplCache = CRM_Utils_Array::value('tplCache', $params, FALSE);
$wordRplc = CRM_Utils_Array::value('wordRplc', $params, FALSE);
if ($session || $tempTable || $prevNext) {
CRM_Core_BAO_Cache::cleanup($session, $tempTable, $prevNext);
}
if ($jobLog) {
CRM_Core_BAO_Job::cleanup();
}
if ($tplCache) {
$config = CRM_Core_Config::singleton();
$config->cleanup(1, FALSE);
}
if ($dbCache) {
CRM_Core_Config::clearDBCache();
}
if ($memCache) {
CRM_Utils_System::flushCache();
}
if ($wordRplc) {
CRM_Core_BAO_WordReplacement::rebuild();
}
}
示例2: civicrm_api3_job_cleanup
/**
* This api cleans up all the old session entries and temp tables. We recommend that sites run this on an hourly basis
*
* @param array $params (reference ) - sends in various config parameters to decide what needs to be cleaned
*
* @return boolean true if success, else false
* @static void
* @access public
*/
function civicrm_api3_job_cleanup($params)
{
$session = CRM_Utils_Array::value('session', $params, true);
$tempTable = CRM_Utils_Array::value('tempTables', $params, true);
$jobLog = CRM_Utils_Array::value('jobLog', $params, true);
$prevNext = CRM_Utils_Array::value('prevNext', $params, true);
$dbCache = CRM_Utils_Array::value('dbCache', $params, false);
$memCache = CRM_Utils_Array::value('memCache', $params, false);
if ($session || $tempTable || $prevNext) {
CRM_Core_BAO_Cache::cleanup($session, $tempTable, $prevNext);
}
if ($jobLog) {
CRM_Core_BAO_Job::cleanup();
}
if ($dbCache) {
CRM_Core_Config::clearDBCache();
}
if ($memCache) {
CRM_Utils_System::flushCache();
}
}