vault/classes/Maikuolan/Cache.php
public function setEntry($Key, $Value, $TTL = 3600)
    {
        $Value = $this->serializeEntry($Value);
        if ($this->Using === 'APCu') {
            if (apcu_store($Key, $Value, $TTL)) {
                return $this->Modified = true;
            }
            return false;
        }
        if ($this->Using === 'Memcached') {
            if ($TTL >= 2592000) {
                $TTL += time();
            }
            if ($this->WorkingData->set($Key, $Value, $TTL)) {
                return $this->Modified = true;
            }
            return false;
        }
        if ($this->Using === 'Redis') {
            if ($this->WorkingData->set($Key, $Value, $TTL)) {
                return $this->Modified = true;
            }
            return false;
        }
        if ($this->Using === 'PDO') {
            if ($TTL > 0) {
                $TTL += time();
            }
            $PDO = $this->WorkingData->prepare(self::setQuery);
            if ($PDO !== false && $PDO->execute([
                'key' => $Key,
                'data' => $Value,
                'time' => $TTL,
                'key2' => $Key,
                'data2' => $Value,
                'time2' => $TTL
            ])) {
                return ($PDO->rowCount() > 0 && $this->Modified = true);
            }
            return false;
        }
        if (is_array($this->WorkingData)) {
            if ($TTL > 0) {
                $TTL += time();
                $this->WorkingData[$Key] = ['Data' => $Value, 'Time' => $TTL];
            } else {
                $this->WorkingData[$Key] = $Value;
            }
            return $this->Modified = true;
        }
        return false;
    }
public function setEntry($Key, $Value, $TTL = 3600)
    {
        $Value = $this->serializeEntry($Value);
        if ($this->Using === 'APCu') {
            if (apcu_store($Key, $Value, $TTL)) {
                return $this->Modified = true;
            }
            return false;
        }
        if ($this->Using === 'Memcached') {
            if ($TTL >= 2592000) {
                $TTL += time();
            }
            if ($this->WorkingData->set($Key, $Value, $TTL)) {
                return $this->Modified = true;
            }
            return false;
        }
        if ($this->Using === 'Redis') {
            if ($this->WorkingData->set($Key, $Value, $TTL)) {
                return $this->Modified = true;
            }
            return false;
        }
        if ($this->Using === 'PDO') {
            if ($TTL > 0) {
                $TTL += time();
            }
            $PDO = $this->WorkingData->prepare(self::setQuery);
            if ($PDO !== false && $PDO->execute([
                'key' => $Key,
                'data' => $Value,
                'time' => $TTL,
                'key2' => $Key,
                'data2' => $Value,
                'time2' => $TTL
            ])) {
                return ($PDO->rowCount() > 0 && $this->Modified = true);
            }
            return false;
        }
        if (is_array($this->WorkingData)) {
            if ($TTL > 0) {
                $TTL += time();
                $this->WorkingData[$Key] = ['Data' => $Value, 'Time' => $TTL];
            } else {
                $this->WorkingData[$Key] = $Value;
            }
            return $this->Modified = true;
        }
        return false;
    }
public function setEntry ( $ Key , $ Value , $ TTL = 3600 ) { $ Value = $ this -> serializeEntry ( $ Value ) ; if ( $ this -> Using === 'APCu' ) { if ( apcu_store ( $ Key , $ Value , $ TTL ) ) { return $ this -> Modified = true ; } return false ; } if ( $ this -> Using === 'Memcached' ) { if ( $ TTL >= 2592000 ) { $ TTL += time ( ) ; } if ( $ this -> WorkingData -> set ( $ Key , $ Value , $ TTL ) ) { return $ this -> Modified = true ; } return false ; } if ( $ this -> Using === 'Redis' ) { if ( $ this -> WorkingData -> set ( $ Key , $ Value , $ TTL ) ) { return $ this -> Modified = true ; } return false ; } if ( $ this -> Using === 'PDO' ) { if ( $ TTL > 0 ) { $ TTL += time ( ) ; } $ PDO = $ this -> WorkingData -> prepare ( self :: setQuery ) ; if ( $ PDO !== false && $ PDO -> execute ( [ 'key' => $ Key , 'data' => $ Value , 'time' => $ TTL , 'key2' => $ Key , 'data2' => $ Value , 'time2' => $ TTL ] ) ) { return ( $ PDO -> rowCount ( ) > 0 && $ this -> Modified = true ) ; } return false ; } if ( is_array ( $ this -> WorkingData ) ) { if ( $ TTL > 0 ) { $ TTL += time ( ) ; $ this -> WorkingData [ $ Key ] = [ 'Data' => $ Value , 'Time' => $ TTL ] ; } else { $ this -> WorkingData [ $ Key ] = $ Value ; } return $ this -> Modified = true ; } return false ; }
Set a cache entry.

@param string $Key The name of the cache entry to set.
@param mixed $Value The value of the cache entry to get.
@param int $TTL The number of seconds that the cache entry should persist.
@return bool True on success; False on failure.
Set a cache entry .