Files
roi-theme/wp-content/plugins/wp-marketing-automations/woofunnels/includes/class-woofunnels-cache.php
root a22573bf0b Commit inicial - WordPress Análisis de Precios Unitarios
- WordPress core y plugins
- Tema Twenty Twenty-Four configurado
- Plugin allow-unfiltered-html.php simplificado
- .gitignore configurado para excluir wp-config.php y uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 21:04:30 -06:00

76 lines
1.6 KiB
PHP
Executable File

<?php
/**
* @author woofunnels
* @package WooFunnels
*/
if ( ! class_exists( 'WooFunnels_Cache' ) ) {
#[AllowDynamicProperties]
class WooFunnels_Cache {
protected static $instance;
protected $woofunnels_core_cache = array();
/**
* WooFunnels_Cache constructor.
*/
public function __construct() {
}
/**
* Creates an instance of the class
* @return WooFunnels_Cache
*/
public static function get_instance() {
if ( null === self::$instance ) {
self::$instance = new self;
}
return self::$instance;
}
/**
* Set the cache contents by key and group within page scope
*
* @param $key
* @param $data
* @param string $group
*/
public function set_cache( $key, $data, $group = '0' ) {
$this->woofunnels_core_cache[ $group ][ $key ] = $data;
}
/**
* Get the cache contents by the cache key or group.
*
* @param $key
* @param string $group
*
* @return bool|mixed
*/
public function get_cache( $key, $group = '0' ) {
if ( isset( $this->woofunnels_core_cache[ $group ] ) && isset( $this->woofunnels_core_cache[ $group ][ $key ] ) ) {
return $this->woofunnels_core_cache[ $group ][ $key ];
}
return false;
}
/**
* Reset the cache by group or complete reset by force param
*
* @param string $group
* @param bool $force
*/
function reset_cache( $group = '0', $force = false ) {
if ( true === $force ) {
$this->woofunnels_core_cache = array();
} elseif ( isset( $this->woofunnels_core_cache[ $group ] ) ) {
$this->woofunnels_core_cache[ $group ] = array();
}
}
}
}