<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2019 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
declare (strict_types = 1);
namespace think;
use ArrayAccess;
use think\file\UploadedFile;
use think\route\Rule;
/**
* 请求管理类
* @package think
*/
class Request implements ArrayAccess
{
/**
* 兼容PATH_INFO获取
* @var array
*/
protected $pathinfoFetch = ['ORIG_PATH_INFO', 'REDIRECT_PATH_INFO', 'REDIRECT_URL'];
/**
* PATHINFO变量名 用于兼容模式
* @var string
*/
protected $varPathinfo = 's';
/**
* 请求类型
* @var string
*/
protected $varMethod = '_method';
/**
* 表单ajax伪装变量
* @var string
*/
protected $varAjax = '_ajax';
/**
* 表单pjax伪装变量
* @var string
*/
protected $varPjax = '_pjax';
/**
* 域名根
* @var string
*/
protected $rootDomain = '';
/**
* HTTPS代理标识
* @var string
*/
protected $httpsAgentName = '';
/**
* 前端代理服务器IP
* @var array
*/
protected $proxyServerIp = [];
/**
* 前端代理服务器真实IP头
* @var array
*/
protected $proxyServerIpHeader = ['HTTP_X_REAL_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_CLIENT_IP', 'HTTP_X_CLIENT_IP', 'HTTP_X_CLUSTER_CLIENT_IP'];
/**
* 请求类型
* @var string
*/
protected $method;
/**
* 域名(含协议及端口)
* @var string
*/
protected $domain;
/**
* HOST(含端口)
* @var string
*/
protected $host;
/**
* 子域名
* @var string
*/
protected $subDomain;
/**
* 泛域名
* @var string
*/
protected $panDomain;
/**
* 当前URL地址
* @var string
*/
protected $url;
/**
* 基础URL
* @var string
*/
protected $baseUrl;
/**
* 当前执行的文件
* @var string
*/
protected $baseFile;
/**
* 访问的ROOT地址
* @var string
*/
protected $root;
/**
* pathinfo
* @var string
*/
protected $pathinfo;
/**
* pathinfo(不含后缀)
* @var string
*/
protected $path;
/**
* 当前请求的IP地址
* @var string
*/
protected $realIP;
/**
* 当前控制器名
* @var string
*/
protected $controller;
/**
* 当前操作名
* @var string
*/
protected $action;
/**
* 当前请求参数
* @var array
*/
protected $param = [];
/**
* 当前GET参数
* @var array
*/
protected $get = [];
/**
* 当前POST参数
* @var array
*/
protected $post = [];
/**
* 当前REQUEST参数
* @var array
*/
protected $request = [];
/**
* 当前路由对象
* @var Rule
*/
protected $rule;
/**
* 当前ROUTE参数
* @var array
*/
protected $route = [];
/**
* 中间件传递的参数
* @var array
*/
protected $middleware = [];
/**
* 当前PUT参数
* @var array
*/
protected $put;
/**
* SESSION对象
* @var Session
*/
protected $session;
/**
* COOKIE数据
* @var array
*/
protected $cookie = [];
/**
* ENV对象
* @var Env
*/
protected $env;
/**
* 当前SERVER参数
* @var array
*/
protected $server = [];
/**
* 当前FILE参数
* @var array
*/
protected $file = [];
/**
* 当前HEADER参数
* @var array
*/
protected $header = [];
/**
* 资源类型定义
* @var array
*/
protected $mimeType = [
'xml' => 'application/xml,text/xml,application/x-xml',
'json' => 'application/json,text/x-json,application/jsonrequest,text/json',
'js' => 'text/javascript,application/javascript,application/x-javascript',
'css' => 'text/css',
'rss' => 'application/rss+xml',
'yaml' => 'application/x-yaml,text/yaml',
'atom' => 'application/atom+xml',
'pdf' => 'application/pdf',
'text' => 'text/plain',
'image' => 'image/png,image/jpg,image/jpeg,image/pjpeg,image/gif,image/webp,image/*',
'csv' => 'text/csv',
'html' => 'text/html,application/xhtml+xml,*/*',
];
/**
* 当前请求内容
* @var string
*/
protected $content;
/**
* 全局过滤规则
* @var array
*/
protected $filter;
/**
* php://input内容
* @var string
*/
// php://input
protected $input;
/**
* 请求安全Key
* @var string
*/
protected $secureKey;
/**
* 是否合并Param
* @var bool
*/
protected $mergeParam = false;
/**
* 架构函数
* @access public
*/
public function __construct()
{
// 保存 php://input
$this->input = file_get_contents('php://input');
}
public static function __make(App $app)
{
$request = new static();
if (function_exists('apache_request_headers') && $result = apache_request_headers()) {
$header = $result;
} else {
$header = [];
$server = $_SERVER;
foreach ($server as $key => $val) {
if (0 === strpos($key, 'HTTP_')) {
$key = str_replace('_', '-', strtolower(substr($key, 5)));
$header[$key] = $val;
}
}
if (isset($server['CONTENT_TYPE'])) {
$header['content-type'] = $server['CONTENT_TYPE'];
}
if (isset($server['CONTENT_LENGTH'])) {
$header['content-length'] = $server['CONTENT_LENGTH'];
}
}
$request->header = array_change_key_case($header);
$request->server = $_SERVER;
$request->env = $app->env;
$inputData = $request->getInputData($request->input);
$request->get = $_GET;
$request->post = $_POST ?: $inputData;
$request->put = $inputData;
$request->request = $_REQUEST;
$request->cookie = $_COOKIE;
$request->file = $_FILES ?? [];
return $request;
}
/**
* 设置当前包含协议的域名
* @access public
* @param string $domain 域名
* @return $this
*/
public function setDomain(string $domain)
{
$this->domain = $domain;
return $this;
}
/**
* 获取当前包含协议的域名
* @access public
* @param bool $port 是否需要去除端口号
* @return string
*/
public function domain(bool $port = false): string
{
return $this->scheme() . '://' . $this->host($port);
}
/**
* 获取当前根域名
* @access public
* @return string
*/
public function rootDomain(): string
{
$root = $this->rootDomain;
if (!$root) {
$item = explode('.', $this->host());
$count = count($item);
$root = $count > 1 ? $item[$count - 2] . '.' . $item[$count - 1] : $item[0];
}
return $root;
}
/**
* 设置当前泛域名的值
* @access public
* @param string $domain 域名
* @return $this
*/
没有合适的资源?快使用搜索试试~ 我知道了~
2023最新微信付费进群系统源码修复已知bug-附带搭建文本无需备案域名无需公众号可对接任意易支付修复提现不显示二维码,代理无佣
共3443个文件
php:2012个
js:233个
png:226个
3星 · 超过75%的资源 需积分: 0 49 下载量 89 浏览量
2023-07-25
13:54:20
上传
评论 3
收藏 56.17MB ZIP 举报
温馨提示
最新微信付费进群系统源码修复已知bug-附带搭建文本无需备案域名无需公众号可对接任意易支付修复提现不显示二维码,代理无佣金,全开源,thinkphp框架
资源推荐
资源详情
资源评论
收起资源包目录
2023最新微信付费进群系统源码修复已知bug-附带搭建文本无需备案域名无需公众号可对接任意易支付修复提现不显示二维码,代理无佣 (3443个子文件)
controller.ashx 3KB
var-dump-server.bat 142B
Web.config 462B
fe806f5ebb6a73b207bfbdc6b3d9d7f9.cookie 283B
UploadHandler.cs 5KB
CrawlerHandler.cs 3KB
ListFileHandler.cs 3KB
PathFormater.cs 2KB
Handler.cs 1KB
Config.cs 1KB
NotSupportedHandler.cs 477B
ConfigHandler.cs 348B
style.css 499KB
mdui.min.css 318KB
app.min.css 271KB
common.min.css 245KB
common.min.css 245KB
theme.min.css 165KB
icons.min.css 155KB
bootstrap.css 143KB
bootstrap.min.css 118KB
materialdesignicons.css 110KB
bootstrap.min.css 107KB
bootstrap.min.css 107KB
mdclub.css 89KB
materialdesignicons.min.css 88KB
layui.css 71KB
ueditor.css 45KB
ueditor.min.css 34KB
bootstrap-theme.css 26KB
uikit.min.css 24KB
bootstrap-theme.min.css 23KB
video-js.css 22KB
image.css 19KB
summernote-bs4.css 17KB
fullcalendar.min.css 16KB
video.css 15KB
attachment.css 15KB
layer.css 14KB
layer.css 14KB
layer.css 14KB
video-js.min.css 11KB
mobile.css 11KB
css.css 11KB
css.css 11KB
simplemde.min.css 11KB
layui.mobile.css 10KB
style.css 9KB
demo.css 8KB
laydate.css 7KB
shCoreDefault.css 7KB
dataTables.bootstrap4.css 6KB
theme-custom.css 5KB
layer.css 5KB
buttons.bootstrap4.css 5KB
responsive.bootstrap4.css 5KB
select.bootstrap4.css 5KB
batch.css 4KB
britecharts.min.css 4KB
nice-select.css 4KB
scrawl.css 4KB
admin.css 4KB
style.css 3KB
htmlDescriptor.css 3KB
codemirror.css 3KB
charts.css 3KB
scrollbar.css 3KB
background.css 2KB
iconfont.css 2KB
vendor.bundle.base.css 2KB
common.css 2KB
pl.css 2KB
emotion.css 2KB
dialogbase.css 2KB
music.css 2KB
edittable.css 1KB
home.css 1KB
code.css 1KB
template.css 1KB
index.css 884B
jquery-jvectormap-1.2.2.css 692B
webuploader.css 543B
help.css 395B
iframe.css 42B
phpunit.xml.dist 826B
Newtonsoft.Json.dll 471KB
.DS_Store 8KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.editorconfig 271B
.editorconfig 131B
.env 73B
Ubuntu-Light.eot 326KB
materialdesignicons-webfont.eot 296KB
Ubuntu-Regular.eot 265KB
Ubuntu-Medium.eot 251KB
Ubuntu-Bold.eot 236KB
fontawesome-webfont.eot 69KB
fontawesome-webfont_1.eot 69KB
共 3443 条
- 1
- 2
- 3
- 4
- 5
- 6
- 35
资源评论
- m0_670443332024-02-22怎么搭建出来访问是空白
掘金领航者
- 粉丝: 2
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功