获取
@return string
359633
public function get() : string
        {
                $result = $this->_redis->get($this->_key);
                return !empty($result)?$result:'';
        }
1116922
public function result()
    {
        $string = "";
        while ($this->count > 0) {
            $string .= $this->util->cursor->startOfCurrentLine();
            $string .= $this->util->cursor->deleteCurrentLine();
            --$this->count;

            $string .= $this->util->cursor->up();
        }

        $string .= $this->util->cursor->down();

        return $string;
    }
1018369
protected function getAllHeaders() {
        if (function_exists('getallheaders')) {
            return getallheaders();
        }

        //对没有getallheaders函数做处理
        $headers = array();
        foreach ($_SERVER as $name => $value) {
            if (is_array($value) || substr($name, 0, 5) != 'HTTP_') {
                continue;
            }

            $key = $this->formatHeaderKey($name);
            $headers[$key] = $value;
        }

        return $headers;
    }
979704
public function getData()
    {
        $this->validate('orderId', 'txnTime', 'accNo', 'payTimeout');

        $data = array(
            'version'       => $this->getVersion(),  //版本号
            'encoding'      => $this->getEncoding(),  //编码方式
            'certId'        => $this->getTheCertId(),    //证书ID
            'signMethod'    => $this->getSignMethod(),  //签名方法
            'txnType'       => '79',        //交易类型
            'txnSubType'    => '00',        //交易子类
            'bizType'       => '000902',    //业务类型
            'accessType'    => $this->getAccessType(),         //接入类型
            'channelType'   => $this->getChannelType(), //05:语音 07:互联网 08:移动
            'encryptCertId' => CertUtil::readX509CertId($this->getEncryptKey()),
            'merId'         => $this->getMerId(),     //商户代码
            'orderId'       => $this->getOrderId(),     //商户订单号，填写开通并支付交易的orderId
            'txnTime'       => $this->getTxnTime(),    //订单发送时间
            'tokenPayData'  => sprintf('{trId=%s&tokenType=01}', $this->getTrId()), //标记请求者 trId
            'accNo'         => $this->encrypt($this->getAccNo()), //银行卡号
            'customerInfo'  => $this->getEncryptCustomerInfo(), //标记请求者 trId,
            'frontUrl'      => $this->getReturnUrl(), //前台通知地址
            'backUrl'       => $this->getNotifyUrl(), //后台通知地址
            'payTimeout'    => $this->getPayTimeout(), //订单超时时间
        );

        $data = $this->filter($data);

        $data['signature'] = $this->sign($data, 'RSA2');

        return $data;
    }
169486
public function create(): string
    {
        switch ($this->operation) {
            case 'exist':
                // 判断是否存在满足条件的记录
                return $this->createExist();
            case 'query':
            case 'repair':
            case 'optimize':
            case 'call':
                // 直接SQL查询
                return $this->createQuery();
            case 'execute':
                // 直接SQL操作
                return $this->createExecute();
            case 'insert':
                // 插入
            case 'replace':
                // 存在则替换,否则插入
            case 'insertIgnore':
                // 存在则忽略,否则插入
                return $this->createAdd();
            case 'inserts':
                //多行插入
                return $this->createInserts();
            case 'update':
                // 修改
                return $this->createUpdate();
            case 'delete':
                // 删除
                return $this->createDelete();
            case 'deleteAll':
                // 删除全部
                return $this->createDeleteAll();
            case 'select':
                // 查询
            case 'selectHandle':
                // 查询并返回句柄
                return $this->createSelect();
            case 'crease':
                // 增减
                return $this->createCrease();
        }
        trigger_error('无法识别或不支持的SQL命令:' . $this->operation, E_USER_ERROR);
        return '';
    }
862092
public function toArray()
    {
        $arr = [];
        // 从保存未定义属性的变量中读取字段kv
        foreach ($this->attrs as $field => $value) {
            $arr[$field] = $value;
        }

        // 从指定的属性中读取字段kv
        foreach ($this->columnMap as $field => $attr) {
            if (property_exists($this, $attr)) {
                $arr[$field] = $this->$attr;
            } else {
                unset($arr[$field]);
            }
        }

        return $arr;
    }
1266437
protected function getOss()
    {
        if (!$this->upload) {
            $this->upload = new OssClient(
                $this->config['accessKeyId'],
                $this->config['accessKeySecret'],
                $this->config['endpoint'],
                $this->config['isCName'],
                $this->config['securityToken']
            );

            //设置请求超时时间
            $this->upload->setTimeout($this->config['timeout']);

            //设置连接超时时间
            $this->upload->setConnectTimeout($this->config['connectTimeout']);
        }

        return $this->upload;
    }
667312
public function MakeSign()
    {
        //签名步骤一：按字典序排序参数
        ksort($this->values);
        $string = $this->ToUrlParams();
        //签名步骤二：在string后加入KEY
        $string = $string . "&key=" . $this->key;
        if ($this->IsSign_typeSet() && $this->GetSign_type() == 'HMAC-SHA256') {
            //签名步骤三：HMAC-SHA256加密
            $string = hash_hmac('sha256', $string, $this->key);
        } else {
            //签名步骤三：MD5加密
            $string = md5($string);
        }
        //签名步骤四：所有字符转为大写
        $result = strtoupper($string);
        return $result;
    }
304126
public function getToken()
    {
        $cacheKey = sprintf($this->cacheKey, $this->authorizer_appid);

        $this->token = Cache::get($cacheKey, function () use ($cacheKey) {
            $params = array(
                'component_appid'          => Config::get('wechat.componentAppId'),
                'authorizer_appid'         => $this->authorizer_appid,
                'authorizer_refresh_token' => $this->authorizer_refresh_token,
            );

            $http = new ComponentHttp(new ComponentAccessToken());
            $response = $http->jsonPost(self::API_AUTHORIZER_TOKEN, $params);

            // 设置token
            $token = $response['authorizer_access_token'];

            // 把token缓存起来
            $expiresAt = Carbon::now()->addSeconds($response['expires_in']);
            Cache::put($cacheKey, $token, $expiresAt);

            return $token;
        });

        return $this->token;
    }
327654
protected function getSelectString(): string
    {
        $statement = '';
        $fieldSelect    = $this->builder->getSelect();
        $aggregate = $this->builder->getAggregate();
        if (empty($fieldSelect) && empty($aggregate)) {
            return $statement;
        }

        $select = $this->getAggregateStatement($fieldSelect, $aggregate);

        // 字段组拼
        foreach ($select as $column => $alias) {
            // Filter db keyword
            if (array_key_exists($column, $fieldSelect) && trim($column) != '*' && strpos($column, '.') === false) {
                // 判断是否为函数调用
                if (strpos($column, '(') || strpos($column, ')')) {
                    $column = sprintf('%s', $column);
                } else {
                    $column = sprintf('`%s`', $column);
                }
            }

            $statement .= $column;
            if ($alias !== null) {
                $statement .= sprintf(' AS `%s`', $alias);
            }
            $statement .= ', ';
        }

        //select组拼
        $statement = substr($statement, 0, -2);
        if (!empty($statement)) {
            $statement = 'SELECT ' . $statement;
        }

        return $statement;
    }
1087502
public function lBrackets()
    {
        if ($this->sql['where'] == '') {
            $this->sql['where'] = 'WHERE ';
        } else {
            if ($this->whereNeedAddAndOrOr === 1) {
                $this->sql['where'] .= ' AND ';
            } else if ($this->whereNeedAddAndOrOr === 2) {
                $this->sql['where'] .= ' OR ';
            }
        }
        $this->sql['where'] .= ' (';
        //移除下一次where操作默认加上AND
        $this->whereNeedAddAndOrOr = 0;
        return $this;
    }
880208
public function show()
    {
        $fileName = $this->pictureId;
        if(!is_null($this->style)){
            $fileName .= '_'.$this->style;
        }
        //判断客户端是否有缓存
        if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] === $fileName) {
            //有缓存
            $response = response('', 304);
        } else {
            //无缓存
            if (!file_exists($this->thumbnailPath)) {
                $this->createPicture();
            }
            $response = $this->imageManager->make($this->thumbnailPath)->response();
        }
        $response->header('Content-Disposition', 'inline; filename=' . $fileName);
        $response->header('Etag', $fileName);
        $response->header('Cache-Control', 'public, max-age=31536000');
        return $response;
    }
483702
public function getPlugin()
    {
        if (!$this->plugin) {
            $classes = array_reverse($this->getControllerClasses($this->controller));
            foreach ($classes as $class) {
                // 认为第二部分是插件名称
                list(, $plugin) = explode('\\', $class, 3);
                $this->plugin = $this->str->dash($plugin);

                break;
            }
        }

        return $this->plugin;
    }
126363
public function getAccessToken()
    {
        if (!empty($this->access_token)) {
            return $this->access_token;
        }
        $cache = $this->config->get('appid') . '_access_token';
        $this->access_token = Tools::getCache($cache);
        if (!empty($this->access_token)) {
            return $this->access_token;
        }
        // 处理开放平台授权公众号获取AccessToken
        if (!empty($this->GetAccessTokenCallback) && is_callable($this->GetAccessTokenCallback)) {
            $this->access_token = call_user_func_array($this->GetAccessTokenCallback, [$this->config->get('appid'), $this]);
            if (!empty($this->access_token)) {
                Tools::setCache($cache, $this->access_token, 7000);
            }
            return $this->access_token;
        }
        list($appid, $secret) = [$this->config->get('appid'), $this->config->get('appsecret')];
        $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={$appid}&secret={$secret}";
        $result = Tools::json2arr(Tools::get($url));
        if (!empty($result['access_token'])) {
            Tools::setCache($cache, $result['access_token'], 7000);
        }
        return $this->access_token = $result['access_token'];
    }
874786
public function selected()
    {
        // 请求参数
        $param['__EVENTTARGET'] = '';
        $param['__EVENTARGUMENT'] = '';
        $param['__VIEWSTATE'] = true;
        $param['zymc'] = "";
        $param['xx'] = "";
        $param['Button8'] = iconv('utf-8', 'gb2312', '已选课程');

        $header = [
            'code', 'name', 'property', 'direction', 'credit', 'hour', 'exam_time', '', 'status'
        ];

        return $this->getSelect($param, $param, $header, 10);
    }
1295003
public static function getModuleRoute() {
        //获取请求URL
        $requestUrlArr = self::getRouteArray();

        //处理请求URL
        if (count($requestUrlArr) == 1) {//dev.example.com/aaa
            $data = array(array(
                    'module' => $requestUrlArr[0],
                    'act' => 'index',
                    'op' => 'actionIndex',
                    'namespace' => ''
            ));
        } elseif (count($requestUrlArr) == 2) {//dev.example.com/aaa/bbb
            $data = array(array(
                    'module' => $requestUrlArr[0],
                    'act' => $requestUrlArr[1],
                    'op' => 'actionIndex',
                    'namespace' => ''
            ));
        } elseif (count($requestUrlArr) == 3) {//dev.example.com/aaa/bbb
            $data = array(array(
                    'module' => $requestUrlArr[0],
                    'act' => $requestUrlArr[1],
                    'op' => 'action' . ucfirst($requestUrlArr[2]),
                    'namespace' => ''
                ),
                array(
                    'module' => $requestUrlArr[0],
                    'act' => $requestUrlArr[2],
                    'op' => 'actionIndex',
                    'namespace' => $requestUrlArr[1]
            ));
        } elseif (count($requestUrlArr) >= 4) {//dev.example.com/aaa/bbb/ccc //dev.example.com/aaa/bbb/ccc/index
            $module = array_shift($requestUrlArr); //第一个元素即为module名字
            $origRequestUrlArr = $requestUrlArr;
            $lastParam = array_pop($requestUrlArr);

            if ($lastParam == 'index') {
                $data = array(array(
                        'module' => $module,
                        'act' => array_pop($requestUrlArr),
                        'op' => 'actionIndex',
                        'namespace' => implode('/', $requestUrlArr)
                ));
            } else {
                $data = array(
                    array(
                        'module' => $module,
                        'act' => array_pop($origRequestUrlArr),
                        'op' => 'actionIndex',
                        'namespace' => implode('/', $origRequestUrlArr),
                    ),
                    array(
                        'module' => $module,
                        'act' => array_pop($requestUrlArr),
                        'op' => 'action' . ucfirst($lastParam),
                        'namespace' => implode('/', $requestUrlArr),
                    )
                );
            }
        }

        return $data;
    }
965693
private function getMessage()
    {
        if ($this->echostr === false && $this->checkSignature()) {

            // 获取微信原始消息体
            if (@file_get_contents('php://input') !== false) {
                $xml_input = file_get_contents('php://input');
            } else {
                $xml_input = $GLOBALS['HTTP_RAW_POST_DATA'];
            }
            if (!empty($xml_input)) {

                // XML解析微信消息体
                libxml_disable_entity_loader(true);
                $xml_obj = simplexml_load_string($xml_input, 'SimpleXMLElement', LIBXML_NOCDATA);
                        
                // 微信 兼容模式/安全模式 信息解密
                if ($this->encrypt_type == 'aes') {
                    // 异常处理: 未配置encodingAESKey
                    if ($this->encodingAESKey===false) {
                        @error_log('EncodingAESKey Not Defined.', 0);
                        exit();
                    }
                    // 验证用户消息的安全签名
                    $msg_signature = SHA1::getSHA1($this->token, $this->timestamp, $this->nonce, $xml_obj->Encrypt);
                    if ($msg_signature === false) {
                        @error_log('getSHA1 Error.', 0);
                        exit();
                    }
                    if ($msg_signature != $this->msg_signature){
                        @error_log('MsgSignature Not Match.', 0);
                        exit();
                    }
                    // 解密用户消息
                    $pc = new Prpcrypt($this->encodingAESKey);
                    $xml_input1 = $pc->decrypt($xml_obj->Encrypt, $this->appId);
                    if ($xml_input1 === false) {
                        @error_log('Decode Message Error.', 0);
                        exit();
                    }
                    $xml_obj = simplexml_load_string($xml_input1, 'SimpleXMLElement', LIBXML_NOCDATA);
                }    
                $this->message = $xml_obj;
                return $xml_obj;
            }
        }
        exit();
    }