<?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 <[email protected]>
// +----------------------------------------------------------------------
declare (strict_types = 1);
namespace think;
use think\file\UploadedFile;
use think\route\Rule;
/**
* 请求管理类
* @package think
*/
class Request
{
/**
* 兼容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;
$request->get = $_GET;
$request->post = $_POST ?: $request->getInputData($request->input);
$request->put = $request->getInputData($request->input);
$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
*/
public function setSubDomain(string $doma
没有合适的资源?快使用搜索试试~ 我知道了~
PHP多应用授权,多域名授权源码_全开源.rar
共967个文件
php:588个
log:96个
html:44个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 42 浏览量
2023-03-20
23:32:30
上传
评论
收藏 4.44MB RAR 举报
温馨提示
PHP多应用授权,多域名授权源码_全开源.rar
资源推荐
资源详情
资源评论
收起资源包目录
PHP多应用授权,多域名授权源码_全开源.rar (967个子文件)
var-dump-server.bat 142B
stye.min.css 297KB
stye.min.css 297KB
admin.css 92KB
layui.css 68KB
layui.css 68KB
layui.css 68KB
jquery-confirm.min.css 22KB
formSelects.css 18KB
layer.css 14KB
layer.css 14KB
laydate.css 7KB
htmlDescriptor.css 3KB
loginStyle.css 2KB
style.css 1KB
phpunit.xml.dist 987B
phpunit.xml.dist 826B
.editorconfig 271B
.editorconfig 131B
iconfont.eot 119KB
hiddeninput.exe 9KB
loading-0.gif 8KB
logo.gif 2KB
logo.gif 2KB
logo.gif 2KB
logo.gif 2KB
logo.gif 2KB
.gitignore 71B
.gitignore 42B
.gitignore 38B
.gitignore 37B
.gitignore 34B
.gitignore 30B
.gitignore 29B
.gitignore 27B
.gitignore 14B
.gitignore 14B
.gitignore 14B
.gitignore 14B
.gitignore 14B
.gitignore 7B
.gitignore 6B
.gitignore 6B
.gitignore 6B
.htaccess 224B
.htaccess 13B
home.html 19KB
base.html 19KB
index.html 18KB
index.html 17KB
setting.html 16KB
index.html 16KB
index.html 15KB
layout.html 14KB
notice.html 14KB
index.html 14KB
index.html 13KB
index.html 12KB
version_list.html 11KB
index.html 11KB
header.html 10KB
app_edit.html 10KB
index.html 10KB
app_create.html 9KB
auth.html 8KB
info.html 8KB
log.html 8KB
edit.html 8KB
version_edit.html 7KB
log.html 7KB
version_release.html 7KB
edit.html 7KB
create.html 6KB
create.html 6KB
华创源码使用说明.html 6KB
login.html 5KB
create.html 5KB
edit.html 4KB
base.html 3KB
login.html 3KB
index.html 2KB
index.html 2KB
404.html 622B
403.html 619B
500.html 613B
admin_ajax_notice_delete.html 482B
footer.html 282B
index.html 144B
header.html 132B
footer.html 132B
favicon.ico 264KB
3.jpg 31KB
6.jpg 31KB
1.jpg 30KB
7.jpg 30KB
8.jpg 29KB
2.jpg 29KB
4.jpg 28KB
5.jpg 27KB
echarts.js 3.35MB
共 967 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
资源评论
没掉发的程序员
- 粉丝: 1911
- 资源: 320
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功