HEX
Server: Apache/2
System: Linux server-27-254-144-72.da.direct 5.10.0-33-amd64 #1 SMP Debian 5.10.226-1 (2024-10-03) x86_64
User: pokaorgani (1114)
PHP: 8.1.33
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/pokaorgani/public_html/wp-content/plugins/gallery-by-supsystic/vendor/Rsc/Cache.php
<?php


class RscSgg_Cache
{

    /**
     * @var RscSgg_Cache_Interface
     */
    protected $adapter;

    /**
     * @var string
     */
    protected $prefix;

    /**
     * @var int
     */
    protected $ttl;

    /**
     * Constructor
     * @param RscSgg_Cache_Interface $adapter The caching adapter
     */
    public function __construct(RscSgg_Cache_Interface $adapter)
    {
        $this->adapter = $adapter;
    }

    /**
     * Adds data to the cache
     * @param string $key The key for the cached data
     * @param mixed $data The data for the cache
     * @return bool TRUE on success, FALSE otherwise
     */
    public function set($key, $data)
    {
        return $this->adapter->set($this->prefix . $key, $data, $this->ttl);
    }

    /**
     * Get the cached data by the specified key
     * @param string $key The key for the cached data
     * @return mixed|null The cached data of NULL on failure or if the cached data is not fresh
     */
    public function get($key)
    {
        return $this->adapter->get($this->prefix . $key);
    }

    /**
     * Deletes the cached data for the specified key
     * @param string $key The key for the cached data
     * @return bool TRUE on success, FALSE otherwise
     */
    public function delete($key)
    {
        return $this->adapter->delete($this->prefix . $key);
    }

    /**
     * Clears the cache
     * @return bool TRUE on success, FALSE otherwise
     */
    public function clear()
    {
        return $this->adapter->clear();
    }

    /**
     * Sets the prefix for keys
     * @param string $prefix
     * @return RscSgg_Cache
     */
    public function setPrefix($prefix)
    {
        $this->prefix = $prefix;
        return $this;
    }

    /**
     * Returns the prefix for keys
     * @return string
     */
    public function getPrefix()
    {
        return $this->prefix;
    }

    /**
     * Sets the time to life for cached data
     * @param int $ttl
     * @return RscSgg_Cache
     */
    public function setTtl($ttl)
    {
        $this->ttl = (int)$ttl;
        return $this;
    }

    /**
     * Returns the time to life for cached data
     * @return int
     */
    public function getTtl()
    {
        return $this->ttl;
    }

}