Commit 537cab11 authored by Michael Iseard's avatar Michael Iseard
Browse files

Clear twig cache on update/activation

parent bfee0eb3
......@@ -24,7 +24,7 @@ use Kudos\Helpers\Settings;
class ActivatorService {
/**
* Runs all activation functions
* Runs all activation functions.
*
* @param string|null $old_version Previous version of plugin.
*
......@@ -35,7 +35,8 @@ class ActivatorService {
$logger = LoggerService::factory();
$logger::init();
TwigService::initCache();
$twig = new TwigService();
$twig->initCache();
self::create_donors_table();
self::create_transactions_table();
self::create_subscriptions_table();
......
......@@ -147,13 +147,13 @@ class TwigService extends AbstractService {
*
* @since 2.0.0
*/
public static function initCache() {
public function initCache() {
$logger = LoggerService::factory();
$logger = $this->logger;
if ( wp_mkdir_p( self::CACHE_DIR ) ) {
$logger->info( 'Twig cache directory created successfully' );
$this->clearCache();
return;
}
......
......@@ -112,6 +112,7 @@ e.g:
* Fix issues with payments over 999
* Fix email address not validating correctly
* Fix various jQuery deprecations
* Fix twig cache issue by clearing cache on activation
= 2.0.8 =
* Add 'Recreate database' action to debug menu
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment