Put something in the cache

@param int|string $key   The key. Strings that are ints are cast to ints.
@param mixed      $value The value to cache
346437
public function put($key, $value) {
        if (isset($this->data[$key])) {
            $this->data[$key] = $value;
            $this->recordAccess($key);
        } else {
            $this->data[$key] = $value;
            if ($this->size() > $this->maximumSize) {
                // remove least recently used element (front of array)
                reset($this->data);
                unset($this->data[key($this->data)]);
            }
        }
    }
159720
function set($key, $value)
    {
        $index = array_search($key, $this->keys);

        if ($index !== false) {
            $this->values[$index] = $value;
        } else {
            $this->keys[] = $key;
            $this->values[] = $value;
        }
    }
30317
public function set($key,$value)
    {
        $file=$this->getCacheDir().$key;
        file_put_contents($file, serialize($value));
    }
285766
public function offsetSet($key, $value)
    {
        if (Arr::accessible($this->value)) {
            $this->value[$key] = $value;
        }
    }
168880
public static function set(string $key, $value)
    {
        // Start session if needed
        if (! session_id()) {
            self::start();
        }

        // Set key
        $_SESSION[(string) $key] = $value;
    }
906786
public function set($key, $value) {
		$this->loadIfNeeded();

		$this->array[$key] = $value;

		$this->saver->save($this->fileName, $this->array, $this->fileMap);
	}
1237936
public function setPost($key, $value)
    {
        $this->_POST = Hash::insert($this->_POST, $key, $value);
    }
436772
public function set(string $key, $value)
    {
        if (! is_array($value)) {
            $value = [$value];
        }

        parent::set($key, [
            'value' => $value,
            'originalKey' => $key
        ]);
    }
1368551
protected function setAsInteger($key, $value)
    {
        $this->checkForNonEmptyKey($key);

        $this->set($key, (int)$value);
    }
1000107
public function set(string $key, $value)
    {
        if (!is_array($value)) {
            $value = [$value];
        }
        $this->normSet($key, $value);
    }
918027
protected function setKey($key, $value)
    {
        if ($key == $this->_keyName) {
            $this->_keyValue = $value;
            $this->_key['value'] = $value;
        }
    }
851871
public function offsetSet($key, $value)
    {
        $key = strtr(strtolower($key), '_', '-');

        $this->_data[$key] = $value;
    }
706900
public function set($key, $value = null)
    {
        if (is_array($key)) {
            foreach ($key as $configKey => $configValue) {
                $this->setSingleItem($configKey, $configValue);
            }
        } else {
            $this->setSingleItem($key, $value);
        }
    }
867134
public function setToCache($key, $value)
    {
        $fileName = $this->getCacheFilePath($key);
        $cacheDirectory = $this->getCacheDir();

        $tmpFile = $cacheDirectory . "/" . basename($fileName) . uniqid('.temp', true) . '.txt';
        file_put_contents($tmpFile, serialize($value), LOCK_EX);

        rename($tmpFile, $fileName);
    }
1023566
public function set($key, $value = null)
    {
        try {
            $this->table()->insert(compact('key', 'value'));
        } catch (Exception $e) {
            $this->table()->where('key', '=', $key)->update(compact('value'));
        }
    }
418009
public function put($key, $value = '')
    {
        Arr::set($this->attributes, $key, $value);

        return $this;
    }
265763
public static function put($key, $value)
    {
        Cache::ensureCacheDirectoryExists($path = Cache::path($key));
        file_put_contents($path, $value);
    }