Add data to cache database table.

@param string $name
@param string $value
@param int    $lifetime

@return bool
551916
protected function add($name, $value, $lifetime)
    {
        return Query::into($this->table)
                    ->column('name', 'value', 'lifetime')
                    ->value($name, $value, $lifetime)
                    ->insert();
    }
708991
public function save($id, $data, $lifetime = 3600)
    {
        $dir = $this->getDirectory($id);
        if (!is_dir($dir)) {
            if (!mkdir($dir, 0755, true)) {
                return false;
            }
        }
        $file_name  = $this->getFileName($id);
        $lifetime   = time() + $lifetime;
        $serialized = serialize($data);
        $result     = file_put_contents($file_name, $lifetime . PHP_EOL . $serialized);
        if ($result === false) {
            return false;
        }
        return true;
    }
1337985
public function addRecursive($name, $value)
    {
        foreach ($value as $key => $value) {
            $key = $name . '[' . $key . ']';
            $this->add($key, $value);
        }
    }
667209
public function save($id, $data, $lifeTime = 0)
    {
        $item = $this->cache->getItem((string) $id);
        $item->set($data);

        if ($lifeTime > 0) {
            $item->expiresAfter($lifeTime);
        }

        return $this->cache->save($item);
    }
1021834
public function set($key, $value, $lifeTime = 3600)
    {
        if (!$this->isEnabled()) {
            return false;
        }

        return eaccelerator_put($this->prefix() . $key, serialize($value), $lifeTime);
    }
1217414
public static function set($name, $value, $time = 0) {
        self::$cache->set($name, $value, $time);
    }
931318
public static function prolong($name, $lifetime)
    {
        $item = static::reach($name);

        if ($item['lifetime'] > 0) {
            $item['lifetime'] += $lifetime;
        } elseif ($item['lifetime'] == 0) {
            $item['lifetime'] = time() + $lifetime;
        }

        static::$register[$name] = $item;

        static::save();

        return true;
    }
1198246
public function setCache($key, $data, $lifetimeInSeconds = false)
    {
        return parent::setCache($this->getHierarchicalKey($key), $data, $lifetimeInSeconds);
    }
603420
public static function cache($name, $value = '', $expires = 0)
    {
        if (!$name || !is_string($name)) {
            self::setError('参数错误!');

            return false;
        }

        /** @var BaseDriver $cacheDriver */
        static $cacheDriver;

        if (!isset($cacheDriver)) {
            $cacheDriver = __NAMESPACE__ . '\\CacheDriver\\' . self::$CACHE_DRIVER . 'Driver';
            $cacheDriver = new $cacheDriver(__DIR__ . '/Cache/');
        }

        if (!$value && $value !== 0) {
            $value = $cacheDriver->_get($name);
            if (false == $value) {
                $value = null;
            }

            return $value;
        }

        $res = $cacheDriver->_set($name, $value, $expires);

        return $res ? true : false;
    }
261392
public function add($name, $value = '')
    {
        Types::assert(['string' => [$name, $value]]);

        $key = strtolower($name);
        if ( ! array_key_exists($key, $this->headers))
        {
            $this->headers[$key] = [];
        }

        $this->headers[$key][] = HeaderFactory::build($name, $value);
    }
940579
public function setMany(array $data, $lifetime = 0) {
		if (! $this->connectionCheckStatus) {
			$this->addServer();
		}
		
		$compression = $this->compression ? MEMCACHE_COMPRESSED : 0;
		$client      = $this->getClient();
		
		$ids  = array_map([$this, 'prepareId'], array_keys($data));
		$data = array_combine($ids, array_values($data));

		foreach ($data as $id => $dataPart) {
			$result = $client->set($id, $dataPart, $compression, $lifetime);

			if ($result === false) {
				if ($this->operationsExceptions) {
					throw new OperationFailed('Inserting of the data into the cache failed, ID: "' . $id . '"');
				} else {
					return false;
				}
			}
		}
		
		return true;
	}
1067131
public function insert($name, $value, $priority = 0)
    {
        if (!isset($this->items[$name])) {
            $this->count++;
        }

        $this->sorted = false;

        $this->items[$name] = [
            'data'     => $value,
            'priority' => (int) $priority,
            'serial'   => $this->serial++,
        ];
    }
32371
public function setValue($name, $value)
    {
        unset($this->factories[$name]);
        $this->cache[$name] = $value;
    }
570914
public function create($name, $value = '')
    {
        $_SESSION[$name] = $value;

        if(isset($_SESSION[$name])) {

            return true;
        }

        return false;
    }
674680
public function set($name, $value)
    {
        if (!$this->isLocked()) {
            $_SESSION[$this->publicStorage]['store'][$this->_namespaceName][$name] = $value;
            return true;
        }
        return false;
    }
647712
public function add($name, $value)
    {
        $this->arguments[] = '--add';
        $this->arguments[] = $name;
        $this->arguments[] = $value;
        return $this;
    }
159603
public function addQuery($name, $value)
    {
        $this->query = array_merge_recursive($this->query, [$name => $value]);
    }