解析一些常见的请求信息
@return self
438181
private function parseReq()
    {
        $this->ip = $this->getIp();
        $this->hostname = $this->env->get('HTTP_HOST');
        $this->referrer = $this->env->get('HTTP_REFERER');
        $this->referer = $this->referrer;
        //请求协议
        $protocol = $this->env->get('SERVER_PROTOCOL');
        //设置变量
        if ($protocol) {
            list($this->protocol, $this->version) = explode('/', $protocol);
            if ($this->protocol == 'https') {
                $this->secure = true;
            } else {
                $this->secure = false;
            }
        } else {
            $this->secure = false;
        }

        return $this;
    }
871351
public function reset()
	{
		$this->_select   = array();
		$this->_from     = array();
		$this->_join     = array();
		$this->_where    = array();
		$this->_group_by = array();
		$this->_having   = array();
		$this->_order_by = array();
		$this->_distinct = false;
		$this->_limit     = null;
		$this->_offset    = null;
		$this->_last_join = null;
		$this->_parameters = array();

		return $this;
	}
921561
public function current()
	{
		if (isset ($this->data[$this->position]))
		{
			return $this->data[$this->position];
		}
		return null;
	}
1184047
public static function instance()
    {
        if (self::$instance) {
            return self::$instance;
        }

        //set up a proper instance
        self::$instance = new self;

        return self::$instance;
    }
1223217
public function reset()
    {
        $this->parameters = [
            'utt'       => null,
            'context'   => null,
            'mode'      => self::MODE_DIALOG,
            't'         => self::CHARACTER_DEFAULT,
        ];
        $this->user_info = null;
        return $this;
    }
534974
public static function init()
    {
        // !self::$_instance instanceof self
        if (!isset(self::$instance)) {
            self::$instance = new self();

            // 使用哪种方式的cache
            $cache_driver = Config::get('cache_driver');

            // 兼容predis(PHP扩展), phpredis(C扩展)
            $type = $cache_driver;
            if ($cache_driver === 'predis') {
                $cache_driver = 'redis';
            }

            $cache_driver = '\\ePHP\Cache\\' . ($cache_driver ? 'Cache' . ucfirst($cache_driver) : 'CacheFile');
            self::$instance->handle = new $cache_driver($type);
        }
        return self::$instance;
    }
387307
public function load(): self
    {
        $this->loader = new Loader($this->files, true);
        $this->loader->load();

        return $this;
    }
1216025
public function reset()
    {
        $this->state = self::STATE_WAITING;
        $this->result = null;
        $this->args = [];
        return $this;
    }
1014293
public function start()
    {
        if (!$this->nested || !$this->depth) {
            $this->db->connect()->getConnection()->beginTransaction();
        }

        $this->depth++;

        return $this;
    }
1033433
public function attr()
    {
        $args = func_get_args();

        $this->each(function ($item) use ($args) {
            if (count($args) >= 2) {
                $item->attr($args[0], $args[1]);
            } else {
                $item->attr($args[0]);
            }
        });

        return $this;
    }
177431
public function save(){

        foreach($this->_items as $item){
            if($item->exists()){
                $item->save();
            }
        }

        return $this;

    }
409741
public function required() {
        $this->validated = false;
        $this->config[self::REQUIRED] = true;
        return $this;
    }
69538
public static function instance(): self
    {
        if (!self::$instance) {
            self::$instance = new self(
                Sequencer::sequence('event-sequence-number'),
                SystemClock::instance()
            );
        }

        return self::$instance;
    }
1083271
public function select()
    {
        self::$instance->reset();
        $this->sql('SELECT ');
        if ($this->oosql_distinct) {
            $this->sql('DISTINCT ');
        }
        $numargs = func_num_args();

        if ($numargs > 0) {

            $arg_list = func_get_args();

            $this->oosql_fields = $arg_list;

            for ($i = 0; $i < $numargs; $i++) {
                if ($i != 0 && $numargs > 1) {
                    $this->sql(',');
                }
                $this->sql($arg_list[$i]);

            }
        } else {
            $this->oosql_fields[] = '*';
            $this->sql($this->oosql_table . '.* ');
        }

        $this->oosql_fromFlag = true;
        $this->oosql_select = $this;
        $this->oosql_where = null;
        return $this;
    }
846199
public function remove()
    {
        unset($this->_nodes[$this->_pointer]);
        $this->_nodes = array_values($this->_nodes);
        return $this;
    }
285960
public function save()
        {
            if (count($this->_items)) {
                foreach($this->_items as $item) {
                    if(true === $item->exists()) {
                        $item->save();
                    }
                }
            }

            return $this;
        }
1342448
public function reset()
    {
        $this->start = null;
        $this->range = null;
        $this->sort = null;
        $this->sortDirection = null;
        $this->search = null;
        $this->searchNotes = null;
        $this->condition = null;
        return $this;
    }