コード例 #1
0
ファイル: Job.php プロジェクト: hyebahi/civicrm-core
/**
 * 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
0
ファイル: Job.php プロジェクト: prashantgajare/civicrm-core
/**
 * 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();
    }
}