HEX
Server: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips
System: Linux WORDPRESS 3.10.0-1160.118.1.el7.x86_64 #1 SMP Thu Apr 4 03:33:23 EDT 2024 x86_64
User: digital (1020)
PHP: 7.2.24
Disabled: NONE
Upload Files
File: /datos/www/expodubai/wp-content/plugins/modern-events-calendar-lite/app/libraries/cache.php
<?php
/** no direct access **/
defined('MECEXEC') or die();

/**
 * Webnus MEC Cache class.
 * @author Webnus <[email protected]>
 */
class MEC_cache
{
    protected static $instance = null;
    protected static $cache = array();

    /**
     * Constructor method
     * @author Webnus <[email protected]>
     */
    private function __construct()
    {
    }

    public function __clone()
    {
    }

    public function __wakeup()
    {
    }

    public static function getInstance()
    {
        // Get an instance of Class
        if(is_null(self::$instance)) self::$instance = new self();

        // Return the instance
        return self::$instance;
    }

    public static function set($key, $value)
    {
        self::$cache[$key] = $value;
    }

    public static function has($key)
    {
        return isset(self::$cache[$key]);
    }

    public static function get($key)
    {
        return (isset(self::$cache[$key]) ? self::$cache[$key] : NULL);
    }

    public static function delete($key)
    {
        if(MEC_cache::has($key))
        {
            unset(self::$cache[$key]);
            return true;
        }

        return false;
    }
}