缓存微信数据
@param $name
@param $value
@param null $duration
@return bool
160568
protected function setCache($name, $value, $duration = null)
    {
        $duration === null && $duration = $this->cacheTime;
        return \Yii::$app->cache->set($this->getCacheKey($name), $value, $duration);
    }
901161
public function param($name, $value = null)
    {
        if (func_num_args() > 1) {
            if ($value instanceof \Coast\App\Access) {
                $value->app($this);
            }
            $this->_params[$name] = $value;
            return $this;
        }
        return isset($this->_params[$name])
            ? $this->_params[$name]
            : null;
    }
1081688
public function seeHttpHeader($name, $value = null)
    {
        if ($value !== null) {
            $this->assertEquals(
                $value,
                $this->getRunningClient()->getInternalResponse()->getHeader($name)
            );
            return;
        }
        $this->assertNotNull($this->getRunningClient()->getInternalResponse()->getHeader($name));
    }
249378
public function setVal($name, $value = null)
    {
        $type = gettype($name);
        if('string' === $type)
        {
            $name = explode('.', $name);
        }
        else if('array' !== $type)
        {
            return false;
        }
        $last = array_pop($name);
        $data = &$this->data;
        foreach ($name as $val)
        {
            if (! isset($data[$val]))
            {
                $data[$val] = array ();
            }
            $data = &$data[$val];
        }
        $data[$last] = $value;
        return true;
    }
284473
public static function set($name, $value, $expired = null)
    {
        // 处理过期时间
        if (null === $expired)
        {
            $expired = Cookie::$expiration;
        }
        if ($expired !== 0)
        {
            $expired += time();
        }

        // Add the salt to the cookie value
        $value = Cookie::salt($name, $value) . '~' . $value;

        return Base::getHttp()->setCookie($name, $value, $expired, Cookie::$path, Cookie::$domain, Cookie::$secure, Cookie::$httpOnly);
    }
506456
public function set($name, $value = '', $prefix = null) {
        $prefix = !is_null($prefix) ? $prefix : $this->prefix;
        if (strpos($name, '.')) {
            // 二维数组赋值
            list($name1, $name2) = explode('.', $name);
            if ($prefix) {
                $this->data[$prefix][$name1][$name2] = $value;
            }
            else {
                $this->data[$name1][$name2] = $value;
            }
        }
        elseif ($prefix) {
            $this->data[$prefix][$name] = $value;
        }
        else {
            $this->data[$name] = $value;
        }
        $this->hander->write($this->sessionID,serialize($this->data));
    }
978674
public function set_data_to_cache($value, $option = null, $duration = 360000)
    {
        return self::$localCache[$this->get_cache_key($option)] = $value;
    }
560022
public function set($name, $value = null, $time = 2592000)
    {
        $value = json_encode($value);
        parent::set($name, $value);

        setcookie($name, $value, time() + $time, '/', $this->server->get('name'));
    }
679979
public static function string(string $name, ?string $value = null, int $expire = 0): RedisString
    {
        //创建String对象
        $string = new RedisString(self::handle(), $name);

        //设置值
        if (!is_null($value)) {
            $string->set($value, $expire);
        }

        //返回
        return $string;
    }
729902
private function ValidateURL($Name, $Value, $MaxLength = 200, $AllowEmpty = false)
        {
            if (empty($Value)) {
                // 是否允許空值
                $this->IsAllowEmpty($Name, $AllowEmpty);
            } else {
                // 格式檢查
                $this->IsValidFormat($Name, '/^(http|https):\/\/+/', $Value);

                // 長度檢查
                $this->IsOverLength($Name, $this->StringLength($Value, $this->Encode), $MaxLength);
            }
        }
355307
public static function get( $name = '', $value = '' ) {

		if ( ! empty( $value ) ) {
			$_GET[ $name ] = $value;
		}

		if ( empty( $name ) ) {
			return $_GET;
		} else {
			return ( isset( $_GET[ $name ] ) ) ? $_GET[ $name ] : NULL;
		}

	}
332103
public static function post(String $name = NULL, $value = NULL)
    {
        return self::_method($name, $value, $_POST ,__FUNCTION__);
    }
1309702
public static function set(
        $name,
        $value,
        $expiry = 90,
        $path = null,
        $domain = null,
        $secure = false,
        $httpOnly = true
    ) {
        return self::get_inst()->set($name, $value, $expiry, $path, $domain, $secure, $httpOnly);
    }
196002
public function set($name, $value, $expire) {
        if (is_null($expire)) {
            $expire = $this->options[ 'expire' ];
        }
        $filename = $this->getCacheFile($name);

        $data = serialize($value);
        if ($this->options[ 'data_compress' ] && function_exists('gzcompress')) {
            //数据压缩
            $data = gzcompress($data, 3);
        }
        $data = "<?php\n//" . sprintf('%012d', $expire) . $data . "\n?>";
        $result = file_put_contents($filename, $data);
        if ($result) {
            clearstatcache();
            return true;
        } else {
            return false;
        }
    }
551889
public function holder($name = null, $value = null) {
        if ($name === null && $value === null) {
            return $this->holders[ 'default' ];
        }
        if ($value === null) {
            $value = $name;
            $name = 'default';
        }
        $this->holders[ $name ] = $value;
        return null;
    }
320855
public function set($name, $value)
    {
        try {
            if (is_string($name) && (is_string($value) || $value === null)) {
                if ($value === null) {
                    if (!array_key_exists($name, $this->defaults)) {
                        return false;
                    }
                    $value = $this->defaults[$name];
                }
                if ((new Query)->from(static::tableName())->where(['name' => $name])->exists()) {
                    Podium::getInstance()->db->createCommand()->update(
                        static::tableName(), ['value' => $value], ['name' => $name]
                    )->execute();
                } else {
                    Podium::getInstance()->db->createCommand()->insert(
                        static::tableName(), ['name' => $name, 'value' => $value]
                    )->execute();
                }
                $this->cache->set('config', $this->notCached);
                $this->_config = null;
                return true;
            }
        } catch (Exception $e) {
            Log::error($e->getMessage(), null, __METHOD__);
        }
        return false;
    }
195092
public function param(string $name, $value = null)
    {
        if ($value === null) {
            return $this->params[$name] ?? null;
        }

        return $this->params[$name] = $value;
    }