Set new cache by key name
@param mixed $key
@param mixed $value
@param int $expiration
@return sFire\Cache\Cache
498495
public function set($key, $value, $expiration = 300) {

    	if(false === ('-' . intval($expiration) == '-' . $expiration)) {
			return trigger_error(sprintf('Argument 3 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($expiration)), E_USER_ERROR);
		}
    	
    	$this -> call() -> set($key, $value, $expiration);
    	return $this;
    }
1272823
protected function set($key, $data, $expire) {
		$this->memcache->set($key, $data, null, $expire);
	}
1253697
public function add($key, $value, $expiration = null)
    {
        if (null !== $this->logger) {
            $this->logger->startMethod('add', ['key' => $key, 'value' => $value, 'expiration' => $expiration]);
        }

        if (!$this->assertConnected()) {
            $this->setResultFailed(5); // \Memcached::RES_WRITE_FAILURE
            $this->stopMethod();

            return false;
        }

        if (!$this->assertKey($key)) {
            $this->stopMethod();

            return false;
        }

        $key = $this->getPrefix().$key;
        $this->checkForDelayedDelete($key);
        if (!$this->assertHasNotInDeleteQueue($key)) {
            $this->setResultFailed(12); // \Memcached::RES_DATA_EXISTS doc states \Memcached::RES_NOTSTORED :(
            $this->stopMethod();

            return false;
        }

        if (!$this->assertHasNotInCache($key)) {
            $this->setResultFailed(12); // \Memcached::RES_DATA_EXISTS doc states \Memcached::RES_NOTSTORED :(
            $this->stopMethod();

            return false;
        }

        if (!$this->assertValue($value)) {
            $this->stopMethod();

            return false;
        }

        if (!$this->assertExpiration($expiration)) {
            $this->stopMethod();

            return false;
        }

        $this->storeValueInCache($key, $value, $expiration);
        $this->setResultOK();
        $this->stopMethod();

        return true;
    }
218544
public function _set($name, $value, $expires)
    {
        $name = $this->createFileName($name);
        $data = $this->packData($value, $expires);

        return file_put_contents($this->cacheDir . '/' . $name, $data);
    }
1186129
public function haveInMemcached($key, $value, $expiration = null)
    {
        switch (get_class($this->memcache)) {
            case 'Memcache':
                $this->assertTrue($this->memcache->set($key, $value, null, $expiration));
                break;
            case 'Memcached':
                $this->assertTrue($this->memcache->set($key, $value, $expiration));
                break;
        }
    }
20307
public function store($key, $value, $expiration = 0)
    {
        // $this->getTimeout(); Do delete based on the session time out
        $data = [
            'time'   => time(),
            'expire' => $expiration,
            'data'   => $value,
        ];

        if ($this->where == true) {
            $this->setCache($key)
                 ->setPath(CYGNITE_BASE.DS.toPath('public.storage.cache').DS);
        }

        if (is_array($this->getCache())) {
            $array = $this->getCache();
            $array[$key] = $data;
        } else {
            $array = [$key => $data];
        }

        $cacheData = json_encode($array);

        if ($this->getDirectory() == true) {
            @file_put_contents($this->getDirectory(), $cacheData);
        }

        return $this;
    }
814448
public function set($key, $data, $expire = 0) {
		if ($data instanceof ModelArray) {
			$modelArray = explode('\\', get_class($data[0]));
			$modelName = count($data) == 0 ? '': end($modelArray);
			$data = [
				'__fsm' => [
					'm' => $modelName,
					'a' => 1
				],
				'data' => $data->toArray()
			];
		} else if ($data instanceof Model) {
			$modelArray = explode('\\', get_class($data));
			$modelName = count($data) == 0 ? '': end($modelArray);
			$data = [
				'__fsm' => [
					'm' => $modelName,
					'a' => 0
				],
				'data' => $data->toArray()
			];
		}
		//print_r($data);
		CacheFactory::getCache()->set($key, $data, $expire);
	}
1057436
public function set($key, $value, $expiration = 0)
    {
        $file = $this->cacheDir . $this->getDir($key) . $this->getFile($key);

        if (!file_exists(dirname($file))) {
            mkdir(dirname($file), 0755, true);
        }

        $return = file_put_contents($file, $value);
        touch($file, time() + $expiration);

        return $return;
    }
1143030
protected function setCookie($key, $value = null, $expire = 0)
    {
        if ($value === null) {
            Arr::forget($_COOKIE, $key);
        } else {
            if ($this->defaults['encrypt']) {
                $value = $this->getEncryption()->encryptBase64($value);
            }

            Arr::set($_COOKIE, $key, $value);
        }

        setcookie(
            $key,
            $value,
            $expire,
            $this->defaults['path'],
            $this->defaults['domain'],
            $this->defaults['secure'],
            $this->defaults['httponly']
        );
    }
111151
public function add($key, $value, $expiration = null)
    {

        return $this->set($key, $value, $expiration);
    }
1047709
public function update($key, $value, $expire = 0)
    {
        if ($this->type === 1) {
            return $this->memcache->replace($key, $value, $expire);
        } else {
            return $this->memcache->replace($this->conf['prefix'] . $key, json_encode($value, JSON_UNESCAPED_UNICODE), false, $expire);
        }

    }
235471
public function store($key, $value, $expiry=0) {
		if ($expiry == 0) {
			$expiry = $this->expiry;
		}
		$entry = new CacheItem();

		$entry->value = serialize($value);
		$entry->expireAt = time() + $expiry;
		$data = serialize($entry);

		$this->store->store($key, $data);

		$this->items[$key] = $entry;
	}
1028145
protected function rememberEverythingWithKey(string $key, $value, int $expire = null) {
		return ($content = $this->driver->get($key)) !== false ? $this->unserialize($content) :
			($this->set($key, $value, $expire) ? $this->get($key) : null);
	}
643976
public function replace($key, $value, $expire = 0)
    {
        if (false === $this->get($key)) {
            return false;
        }
        return $this->set($key, $value, $expire);
    }
315246
public function set($key,$value,$expired){
		if(DEBUG_MODE){
			BDebug::message('[Memcached]: Set key('.$key.')');
			}
		$mc=$this->getMemcached();
		if(empty($mc))return false;
		$this->queries_set_count++;
		return $mc->set($key,$value,$expired);
		}
25207
public function set($key, $val, $expire = 0)
    {
        return $this->mem->set($key, $val, $expire);
    }
1371909
public function set($name, $value, $expires = null)
    {
        $name = $this->getFullName($name);

        if (!is_array($value)) {
            $value = ['value' => (string) $value];
        }

        if (isset($expires)) {
            $value['expires'] = $expires;
        }

        parent::set($name, $value);

        return $this;
    }