设置缓存
@param string $alias 别名
@param string $value 缓存内容
@param array $config 配置
@return bool
160587
public function set($alias, $value, $config = array())
	{
		$ttl = isset($config['ttl']) ? $config['ttl'] : 0;
		return apcu_store($alias,$value,$ttl);
	}
738938
public static function value($alias,$value=''){
        if (isset(self::$pool[$alias])) {
            return self::$pool[$alias];
        }
        //value('name','hello',function ($hello){});
        //value('name',function (){});
        //value('name',new Hook());
        //value('name',2);
        //value('name',[]);
        //获取参数数量
        $num = func_num_args();

        if($num<3) {
            $value = ($value instanceof \Closure)?$value():$value;
        }
        elseif($num == 3) {
            $func = func_get_arg(2);
            $value = $func($value);
        }
        else {
            $args = func_get_args();
            $alias = $args[0];
            $value = $args[--$num];
            unset($args[0]);
            unset($args[$num]);
            $value = call_user_func_array($value,$args);
        }

        //固化
        if(in_array($alias,Config::$o->pool)) {
            self::$solidify[$alias] = $value;
        }

        return self::$pool[$alias] = $value;
    }
252896
protected function filterConfig(string $name, $value = null)
    {
        $class = 'filterConfig' . ucfirst($name);
        if (method_exists($this, $class) === true) {
            $value = call_user_func([$this, $class], $value);
        }
        return $value;
    }
978123
public static function set(string $name, $value)
    {
        $names = Imi::parseDotRule($name);
        if (isset($names[0]))
        {
            $first = array_shift($names);
            if(isset(static::$configs[$first]))
            {
                return static::$configs[$first]->setVal($names, $value);
            }
            else
            {
                return false;
            }
        }
        else
        {
            return false;
        }
    }
1233263
public static function validateStrEqI($value, $equalsValue, $reason = null, $alias = 'Parameter')
    {
        if (is_string($value)) {
            if (strcasecmp($value, $equalsValue) === 0)
                return $value;
            $isTypeError = false;
        } else
            $isTypeError = true;

        if ($reason !== null)
            throw new ValidationException($reason);

        if ($isTypeError) {
            $error = self::getErrorTemplate('Str');
            $error = str_replace('{{param}}', $alias, $error);
        } else {
            $error = self::getErrorTemplate('StrEqI');
            $error = str_replace('{{param}}', $alias, $error);
            $error = str_replace('{{value}}', $equalsValue, $error);
        }
        throw new ValidationException($error);
    }
833737
public function set($alias, $value, $config = array())
	{
		$ttl = isset($config['ttl']) ? $config['ttl'] : 0;
		return apc_store($alias,$value,$ttl);
	}
326472
public static function set_merge($name, $value=null){
        if(is_array($name)) {
            self::$o->config = array_merge(self::$o->config,$name);
        }
        else {
            self::$o->config[$name] = array_merge(self::$o->config[$name],$value);
        }
        return true;
    }
443327
public function connect(string $alias, string $mode = 'write'): \PDO
    {
        // 参数检查
        $mode = strtolower($mode);
        if ($mode != 'read') {
            $mode = 'write';
        }

        // 读取数据库配置
        $all = self::getConfig();

        // 取相应的读/写服务器的连接信息
        if (isset($all[$alias])) {
            $connectInfo = $all[$alias][$mode];
        } else {
            $connectInfo = $all['_default'][$mode];
        }

        // 连接指定数据库
        return self::connectDatabase($connectInfo);
    }
882411
public function handlerAlias($name, $value = null)
    {
        $alias = is_array($name) ? $name : [$name => $value];
        $this->handlerAlias = $alias + $this->handlerAlias;
    }
776050
public function config($name, $value = null)
    {
        if (func_num_args() === 1) {
            return $this["config"]->get($name);
        }

        return $this["config"]->set($name, $value);
    }
653244
public function config($value = null, $default = false)
        {
            // Setter
            if (Arrays::is($value)) {
                if (count($value) > 0) {
                    // Merge given config settings over any previous ones (if $value is array)
                    static::$cfg = $this->arrayMergeRecursiveReplace(static::$cfg, $value);
                }
            // Getter
            } else {
                // Config array is static to persist across multiple instances
                $cfg = static::$cfg;

                // No value passed - return entire config array
                if ($value === null) {
                    return $cfg;
                }

                // Find value to return
                if (strpos($value, '.') !== false) {
                    $cfgValue = $cfg;
                    $valueParts = explode('.', $value);

                    foreach($valueParts as $valuePart) {
                        if (isset($cfgValue[$valuePart])) {
                            $cfgValue = $cfgValue[$valuePart];
                        } else {
                            $cfgValue = $default;
                        }
                    }
                } else {
                    $cfgValue = $cfg;

                    if (isset($cfgValue[$value])) {
                        $cfgValue = $cfgValue[$value];
                    } else {
                        $cfgValue = $default;
                    }
                }

                return $cfgValue;
            }
        }
389392
protected function constraintField(ConstraintFactory $where, $field, $value, $alias)
    {
        if ($field === $this->class->nodename) {
            $where->eq()->name($alias)->literal($value);
        } else {
            $where->eq()->field($alias.'.'.$field)->literal($value);
        }
    }
868101
private function getCacheConfig(string $alias): ?string
    {
        //读配置文件 ,可以不指定
        $config = configDefault([], 'tablecache');
        foreach ($config as $type => $tables) {
            if ($tables == $alias) {
                return $type;
            }

            if (is_array($tables)) {
                foreach ($tables as $table) {
                    if ($table == $alias) {
                        return $type;
                    }
                }
            }
        }
        return null;
    }
593475
public static function set($name,$value=null)
    {
        if(is_array($name)){
            self::$config=array_merge(self::$config,$name);
            return;
        }
        if(strstr($name,'.')===false){
            self::$config[$name]=$value;
        }else{
            list($l,$r)=explode('.',$name);
            self::$config[$l][$r]=$value;
        }
    }
837351
public static function clear($alias = null)
	{
		$obj = self::getInstance($alias);
		if ($obj)
		{
			return $obj->clear();
		}
		else
		{
			return false;
		}
	}
373613
public function config($name, $value = null) {
        if (is_array($name)) {
            $this->config = array_merge($this->config, $name);
        }
        elseif (is_null($value)) {
            return isset($this->config[$name]) ? $this->config[$name] : null;
        }
        else {
            $this->config[$name] = $value;
        }
    }
1122302
public function setWasConverterUsed($value, $alias = null)
    {
        if ($alias) {
            $this->converterAliasUsed[$alias] = (bool) $value;
        } else {
            $this->converterUsed = (bool) $value;
        }
    }