CRM-16523 towards fixing test issues on this
[civicrm-core.git] / api / v3 / Job.php
index c6a27618e4b6d9f17fde80bf6aebc03271f4612d..8bb86189fb8827cbc2f0a39d56c174cff6571bae 100644 (file)
@@ -568,6 +568,8 @@ function civicrm_api3_job_cleanup($params) {
   $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);
@@ -577,6 +579,11 @@ function civicrm_api3_job_cleanup($params) {
     CRM_Core_BAO_Job::cleanup();
   }
 
+  if ($tplCache) {
+    $config = CRM_Core_Config::singleton();
+    $config->cleanup(1, FALSE);
+  }
+
   if ($dbCache) {
     CRM_Core_Config::clearDBCache();
   }
@@ -584,6 +591,10 @@ function civicrm_api3_job_cleanup($params) {
   if ($memCache) {
     CRM_Utils_System::flushCache();
   }
+
+  if ($wordRplc) {
+    CRM_Core_BAO_WordReplacement::rebuild();
+  }
 }
 
 /**