From 1c74156a15f05569f9d5f6772ceb531152d16749 Mon Sep 17 00:00:00 2001 From: padams Date: Wed, 2 Feb 2022 00:08:28 +0000 Subject: [PATCH] adding update 011 for cache flush. --- modules/base/module.php | 4 +- modules/base/updates/011.php | 50 +++++++++++++++++++++++++ modules/fileCache/classes/fileCache.php | 2 + 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 modules/base/updates/011.php diff --git a/modules/base/module.php b/modules/base/module.php index 6d0523991..955ecec04 100644 --- a/modules/base/module.php +++ b/modules/base/module.php @@ -42,10 +42,10 @@ function __construct() { $this->display_name = 'Open Web Analytics'; $this->group = 'Base'; $this->author = 'Peter Adams'; - $this->version = 10; + $this->version = 11; $this->description = 'Base functionality for OWA.'; $this->config_required = false; - $this->required_schema_version = 10; + $this->required_schema_version = 11; return parent::__construct(); } diff --git a/modules/base/updates/011.php b/modules/base/updates/011.php new file mode 100644 index 000000000..9faf8919f --- /dev/null +++ b/modules/base/updates/011.php @@ -0,0 +1,50 @@ +setMapValue( 'object_cache_types', 'file', $class_info); + + owa_coreAPI::setSetting('base', 'cache_objects', true); + owa_coreAPI::setSetting('base', 'cacheType', 'file'); + + $cache = owa_coreAPI::cacheSingleton(); + + if ( $cache->flush() ) { + + owa_coreAPI::notice('Cache Flushed'); + return true; + + } else { + $this->e->notice('Could not flush cache.'); + return false; + } + + } + + function down() { + + return true; + } +} + +?> \ No newline at end of file diff --git a/modules/fileCache/classes/fileCache.php b/modules/fileCache/classes/fileCache.php index c84ec7277..a551ac6f7 100644 --- a/modules/fileCache/classes/fileCache.php +++ b/modules/fileCache/classes/fileCache.php @@ -221,6 +221,8 @@ function flush() { } } } + + return true; } function setCacheDir($dir) {