启动路由
@param  string $value [description]
@return [type]        [description]
963951
public function start($url = '', $par = '') {
        $url = $this->getRoutePath();
        #检查视图URL
        if (class_exists('view')) {
            $url = view::viewURL($url);
        }
        #检查图片URL
        if (class_exists('images')) {
            $url = images::imagesURL($url);
        }
        #检查微信URL
        if (class_exists('wechat')) {
            $url = wechat::wechatURL($url);
        }
        #判断是否为空 则设置默认值
        if (empty($url[0])) {
            $type   = 'page';
            $app    = 'client';
            $model  = 'home';
            $action = 'home';
        }
        #获取地址字段
        else {
            #偶数页面
            if (count($url) % 2 == 0) {
                $type  = 'page';
                $app   = 'client';
                $model = !empty($url[0]) ? $url[0] : 'home';
                array_shift($url);
                $action = !empty($url[0]) ? $url[0] : 'home';
                array_shift($url);
            }
            #API访问
            elseif (strtolower($url[0]) === 'api' || strtolower($url[0]) === 'dapi' || strtolower($url[0]) === 'system') {
                $type = strtolower($url[0]);
                $app  = $url[0];
                array_shift($url);
                $model = !empty($url[0]) ? $url[0] : 'demo';
                array_shift($url);
                $action = !empty($url[0]) ? $url[0] : 'index';
                array_shift($url);
            }
            #奇数访问
            else {
                $type = 'page';
                $path = !empty($url[0]) ? $url[0] : 'home';
                $app  = 'client/' . $path;
                array_shift($url);
                $model = !empty($url[0]) ? $url[0] : 'home';
                array_shift($url);
                $action = !empty($url[0]) ? $url[0] : 'home';
                array_shift($url);
            }
        }
        #将参数以数组保存到URL
        $this->url = compact('type', 'app', 'model', 'action');
        #获取参数字段
        for ($i = 0; $i < count($url); $i += 2) {
            $value               = isset($url[$i + 1]) ? $url[$i + 1] : '';
            $this->par[$url[$i]] = $value;
        }
        $_GET = empty($this->par) ? $this->url : array_merge($this->url, $this->par);
        #执行系统API
        if ($type == 'system') {
            call_user_func([$model, $action], $_GET);
        }
        #执行页面或API
        else {
            #执行中间件
            middleware::run();
            #执行页面或API
            if ($type == 'api' || $type == 'dapi') {
                api::startApi($model, $action, $type, $this->app);
            } else {
                view::display();
            }
        }

    }
900870
public function parseValue($value)
    {
        if (strlen($value) === 0) {
            return $value;
        }

        if ($value[0] === '"' || $value[0] === "'") {
            $value = substr($value, 1, -1);
        }

        $value = stripslashes($value);

        return $value;
    }
424245
static public function urlencode($value)
    {
        if (is_string($value)) {
            return urlencode($value);
        } elseif (is_array($value)) {
            foreach ($value as $k => $v) {
                $value[$k] = static::urlencode($v);
            }
        }
        return $value;
    }
272528
public static function emailDomain($value)
    {
        if ( ! self::notEmpty($value))
        {
            return false;
        }

        // 检查MX记录
        return (bool) checkdnsrr(preg_replace('/^[^@]++@/', '', $value), 'MX');
    }
199094
function fromString($value)
    {
        $this->clear();
        $this->orignalValue = $this->returnValue  = (string) $value;
        return $this->parse();
    }
1348054
protected function getValueTypeDescription($value): string
    {
        if (is_resource($value)) {
            $valueType = get_resource_type($value) . " resource";
        } elseif (is_object($value)) {
            $valueType = get_class($value) . " object";
        } elseif (is_string($value)) {
            $valueType = "string \"{$value}\"";
        } else {
            $valueType = gettype($value);
        }

        return $valueType;
    }
880689
private function item($key, $value): ?array
    {
        // 键不是整数,有用,需要分析
        if (!is_numeric($key)) {
            return $this->itemWithKey(trim($key), $value);
        }

        //键是整数,无用
        return $this->itemWithoutKey($value);
    }
125949
public static function getTypeCodeFromObject( $value )
	{
		if ( is_null( $value ) )
		{
			return TypeCode::Null_;
		}

		if ( is_array( $value ) )
		{
			return TypeCode::assocArray;
		}

		if ( is_string( $value ) )
		{
			return strlen( $value ) === 1 ? TypeCode::Char : TypeCode::String;
		}

		if ( $value instanceof DateTime )
		{
			return TypeCode::DateTime;
		}

		if ( $value instanceof DateTimeInterval )
		{
			return TypeCode::DateTimeInterval;
		}

		if ( is_double( $value ) )
		{
			return TypeCode::Double;
		}

		if ( is_int( $value ) )
		{
			return TypeCode::Int32;
		}

		if ( is_bool( $value ) )
		{
			return TypeCode::Boolean;
		}

		if ( is_object( $value ) )
		{
			return TypeCode::Object;
		}
	}
475818
private function unpack(string $value)
    {
        $c = $value[0];
        $value = substr($value, 1);
        if ($c === 'r') {
            return $value;
        }
        return unserialize($value);
    }
772197
public function setValue($value) {
        switch ($this->type) {
            case self::TYPE_BOOLEAN:
                $this->value = (bool) $value;
                break;
            case self::TYPE_STRING:
                $this->value = (string) $value;
                break;
        }
        return $this;
    }
725192
public static function GetTypeName( $value ) : string
   {

      if ( \is_null( $value ) )
      {
         return Type::PHP_NULL;
      }

      if ( \is_object( $value ) )
      {
         return \get_class( $value );
      }

      if ( \is_string( $value ) )
      {
         return Type::PHP_STRING;
      }

      if ( \is_int( $value ) )
      {
         return Type::PHP_INTEGER;
      }

      if ( \is_bool( $value ) )
      {
         return Type::PHP_BOOLEAN;
      }

      if ( \is_double( $value ) )
      {
         return Type::PHP_DOUBLE;
      }

      if ( \is_float( $value ) )
      {
         return Type::PHP_FLOAT;
      }

      if ( \is_resource( $value ) )
      {
         return Type::PHP_RESOURCE;
      }

      if ( \is_array( $value ) )
      {
         return Type::PHP_ARRAY;
      }

      return Type::PHP_UNKNOWN;

   }
283616
public function filter($value)
    {
        $type    = $this->getType();
        $casting = $this->getCasting();

        // LOCALIZED
        if ($type >= self::TYPE_LOCALIZED) {
            $type -= self::TYPE_LOCALIZED;
            if (is_string($value)) {
                if (isset($this->options['translations'][$value])) {
                    return (bool) $this->options['translations'][$value];
                }
            }
        }

        // FALSE_STRING ('false')
        if ($type >= self::TYPE_FALSE_STRING) {
            $type -= self::TYPE_FALSE_STRING;
            if (is_string($value) && (strtolower($value) == 'false')) {
                return false;
            }

            if (!$casting && is_string($value) && (strtolower($value) == 'true')) {
                return true;
            }
        }

        // NULL (null)
        if ($type >= self::TYPE_NULL) {
            $type -= self::TYPE_NULL;
            if ($value === null) {
                return false;
            }
        }

        // EMPTY_ARRAY (array())
        if ($type >= self::TYPE_EMPTY_ARRAY) {
            $type -= self::TYPE_EMPTY_ARRAY;
            if (is_array($value) && ($value == [])) {
                return false;
            }
        }

        // ZERO_STRING ('0')
        if ($type >= self::TYPE_ZERO_STRING) {
            $type -= self::TYPE_ZERO_STRING;
            if (is_string($value) && ($value == '0')) {
                return false;
            }

            if (!$casting && (is_string($value)) && ($value == '1')) {
                return true;
            }
        }

        // STRING ('')
        if ($type >= self::TYPE_STRING) {
            $type -= self::TYPE_STRING;
            if (is_string($value) && ($value == '')) {
                return false;
            }
        }

        // FLOAT (0.0)
        if ($type >= self::TYPE_FLOAT) {
            $type -= self::TYPE_FLOAT;
            if (is_float($value) && ($value == 0.0)) {
                return false;
            }

            if (!$casting && is_float($value) && ($value == 1.0)) {
                return true;
            }
        }

        // INTEGER (0)
        if ($type >= self::TYPE_INTEGER) {
            $type -= self::TYPE_INTEGER;
            if (is_int($value) && ($value == 0)) {
                return false;
            }

            if (!$casting && is_int($value) && ($value == 1)) {
                return true;
            }
        }

        // BOOLEAN (false)
        if ($type >= self::TYPE_BOOLEAN) {
            $type -= self::TYPE_BOOLEAN;
            if (is_bool($value)) {
                return $value;
            }
        }

        if ($casting) {
            return true;
        }

        return $value;
    }
346679
protected function value($value)
    {
        if (is_numeric($value)) {
            return $value;
        }

        if (is_bool($value)) {
            return $value ? 1 : 0;
        }

        if (is_string($value)) {
            return "'" . str_replace("'", "''", $value) . "'";
        }

        return 'NULL';
    }
901614
protected function parseValue($value) {
        if(is_string($value)) {
            $value =  strpos($value,':') === 0 && in_array($value,array_keys($this->bind))? $this->escapeString($value) : '\''.$this->escapeString($value).'\'';
        }
        elseif(isset($value[0]) && is_string($value[0]) && strtolower($value[0]) == 'exp'){
            $value =  $this->escapeString($value[1]);
        }
        elseif(is_array($value)) {
            $value =  array_map([$this, 'parseValue'],$value);
        }
        elseif(is_bool($value)){
            $value =  $value ? '1' : '0';
        }
        elseif(is_null($value)){
            $value =  'null';
        }
        return $value;
    }
81817
public static function decode(string $value)
    {
        $stdObject = json_decode($value);
        // catch error if it occurs
        self::catchError();

        if (self::getError()) {
            return self::getError();
        }

        return $stdObject;
    }
510605
public function getTypeFromValue($value = null)
    {
        $value = ($value == null ? $this->value : $value);
        return array_search($this->value, self::$sourceList);
    }
437168
public function getType($value)
    {
        if (strpos($value, '\\') !== false && class_exists($value)) {
            return self::TYPE_CLASS;
        } else {
            return self::TYPE_SCALAR;
        }
    }