/** * Clears the application cache * * Since this script is being executed via web requests and standalone from the Mautic application, we don't have access to Symfony's * CLI suite. So we'll go with Option B in this instance and just nuke the entire production cache and let Symfony rebuild it on the next * application cycle. * * @param array $status * * @return array */ function clear_mautic_cache(array $status) { if (!recursive_remove_directory(MAUTIC_CACHE_DIR)) { process_error_log(array('Could not remove the application cache. You will need to manually delete ' . MAUTIC_CACHE_DIR . '.')); } // Build the cache for migrations build_cache(); // Apply critical migrations apply_critical_migrations(); $status['complete'] = true; $status['stepStatus'] = 'Success'; $status['nextStep'] = 'Processing Database Updates'; $status['nextStepStatus'] = 'In Progress'; $status['updateState']['cacheComplete'] = true; return $status; }
unset($state['refresh_count']); } break; case 'clearCache': clear_mautic_cache(); $nextTask = 'buildCache'; $redirect = true; break; case 'buildCache': build_cache(); $nextTask = !empty($standalone) ? 'applyMigrations' : 'applyCriticalMigrations'; $redirect = true; break; case 'applyCriticalMigrations': // Apply critical migrations apply_critical_migrations(); $nextTask = 'finish'; $redirect = true; break; case 'clearCache': clear_mautic_cache(); $nextTask = 'buildCache'; $redirect = true; break; case 'applyMigrations': // Apply critical migrations apply_migrations(); $nextTask = 'finish'; break; case 'finish': clear_mautic_cache();