<?php

class Cache
{

    private $expires;
    private $adapter;

    public function __construct()
    {
        if(defined('CACHE_TYPE')){
            $this->adapter = new CacheFile();
        } else {
            $this->adapter = new CacheRam();
        }
    }

    public function get($key)
    {
        return $this->adapter->get($key);
    }

    public function setPrefix($prefix)
    {
        $this->adapter->setPrefix($prefix);
    }

    public function set($key, $value, $timeCache = false)
    {
        $this->adapter->set($key, $value, $timeCache);
    }

    public function delete($key)
    {
        $this->adapter->delete($key);
    }

    public function __destruct()
    {
        $this->adapter->close();
    }

}
