新增
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2023 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\facade;
|
||||
|
||||
use think\Facade;
|
||||
|
||||
/**
|
||||
* @see \think\App
|
||||
* @package think\facade
|
||||
* @mixin \think\App
|
||||
* @method static \think\Service|null register(\think\Service|string $service, bool $force = false) 注册服务
|
||||
* @method static mixed bootService(\think\Service $service) 执行服务
|
||||
* @method static \think\Service|null getService(string|\think\Service $service) 获取服务
|
||||
* @method static \think\App debug(bool $debug = true) 开启应用调试模式
|
||||
* @method static bool isDebug() 是否为调试模式
|
||||
* @method static \think\App setNamespace(string $namespace) 设置应用命名空间
|
||||
* @method static string getNamespace() 获取应用类库命名空间
|
||||
* @method static string version() 获取框架版本
|
||||
* @method static string getRootPath() 获取应用根目录
|
||||
* @method static string getBasePath() 获取应用基础目录
|
||||
* @method static string getAppPath() 获取当前应用目录
|
||||
* @method static mixed setAppPath(string $path) 设置应用目录
|
||||
* @method static string getRuntimePath() 获取应用运行时目录
|
||||
* @method static void setRuntimePath(string $path) 设置runtime目录
|
||||
* @method static string getThinkPath() 获取核心框架目录
|
||||
* @method static string getConfigPath() 获取应用配置目录
|
||||
* @method static string getConfigExt() 获取配置后缀
|
||||
* @method static float getBeginTime() 获取应用开启时间
|
||||
* @method static integer getBeginMem() 获取应用初始内存占用
|
||||
* @method static \think\App initialize() 初始化应用
|
||||
* @method static bool initialized() 是否初始化过
|
||||
* @method static void loadLangPack(string $langset) 加载语言包
|
||||
* @method static void boot() 引导应用
|
||||
* @method static void loadEvent(array $event) 注册应用事件
|
||||
* @method static string parseClass(string $layer, string $name) 解析应用类的类名
|
||||
* @method static bool runningInConsole() 是否运行在命令行下
|
||||
*/
|
||||
class App extends Facade
|
||||
{
|
||||
/**
|
||||
* 获取当前Facade对应类名(或者已经绑定的容器对象标识)
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeClass()
|
||||
{
|
||||
return 'app';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2023 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\facade;
|
||||
|
||||
use think\cache\Driver;
|
||||
use think\cache\TagSet;
|
||||
use think\Facade;
|
||||
|
||||
/**
|
||||
* @see \think\Cache
|
||||
* @package think\facade
|
||||
* @mixin \think\Cache
|
||||
* @method static string|null getDefaultDriver() 默认驱动
|
||||
* @method static mixed getConfig(null|string $name = null, mixed $default = null) 获取缓存配置
|
||||
* @method static array getStoreConfig(string $store, string $name = null, null $default = null) 获取驱动配置
|
||||
* @method static Driver store(string $name = null) 连接或者切换缓存
|
||||
* @method static bool clear() 清空缓冲池
|
||||
* @method static mixed get(string $key, mixed $default = null) 读取缓存
|
||||
* @method static bool set(string $key, mixed $value, int|\DateInterval|\DateTimeInterface $ttl = null) 写入缓存
|
||||
* @method static bool delete(string $key) 删除缓存
|
||||
* @method static iterable getMultiple(iterable $keys, mixed $default = null) 读取缓存
|
||||
* @method static bool setMultiple(iterable $values, null|int|\DateInterval|\DateTimeInterface $ttl = null) 写入缓存
|
||||
* @method static bool deleteMultiple(iterable $keys) 删除缓存
|
||||
* @method static bool has(string $key) 判断缓存是否存在
|
||||
* @method static TagSet tag(string|array $name) 缓存标签
|
||||
*/
|
||||
class Cache extends Facade
|
||||
{
|
||||
/**
|
||||
* 获取当前Facade对应类名(或者已经绑定的容器对象标识)
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeClass()
|
||||
{
|
||||
return 'cache';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2023 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\facade;
|
||||
|
||||
use think\Facade;
|
||||
|
||||
/**
|
||||
* @see \think\Config
|
||||
* @package think\facade
|
||||
* @mixin \think\Config
|
||||
* @method static array load(string $file, string $name = '') 加载配置文件(多种格式)
|
||||
* @method static bool has(string $name) 检测配置是否存在
|
||||
* @method static mixed get(string $name = null, mixed $default = null) 获取配置参数 为空则获取所有配置
|
||||
* @method static array set(array $config, string $name = null) 设置配置参数 name为数组则为批量设置
|
||||
*/
|
||||
class Config extends Facade
|
||||
{
|
||||
/**
|
||||
* 获取当前Facade对应类名(或者已经绑定的容器对象标识)
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeClass()
|
||||
{
|
||||
return 'config';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: yunwuxin <448901948@qq.com>
|
||||
// +----------------------------------------------------------------------
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace think\facade;
|
||||
|
||||
use think\console\Command;
|
||||
use think\console\Input;
|
||||
use think\console\input\Definition as InputDefinition;
|
||||
use think\console\Output;
|
||||
use think\console\output\driver\Buffer;
|
||||
use think\Facade;
|
||||
|
||||
/**
|
||||
* Class Console
|
||||
* @package think\facade
|
||||
* @mixin \think\Console
|
||||
* @method static Output|Buffer call(string $command, array $parameters = [], string $driver = 'buffer')
|
||||
* @method static int run() 执行当前的指令
|
||||
* @method static int doRun(Input $input, Output $output) 执行指令
|
||||
* @method static void setDefinition(InputDefinition $definition) 设置输入参数定义
|
||||
* @method static InputDefinition The InputDefinition instance getDefinition() 获取输入参数定义
|
||||
* @method static string A help message. getHelp() Gets the help message.
|
||||
* @method static void setCatchExceptions(bool $boolean) 是否捕获异常
|
||||
* @method static void setAutoExit(bool $boolean) 是否自动退出
|
||||
* @method static string getLongVersion() 获取完整的版本号
|
||||
* @method static void addCommands(array $commands) 添加指令集
|
||||
* @method static Command|void addCommand(string|Command $command, string $name = '') 添加一个指令
|
||||
* @method static Command getCommand(string $name) 获取指令
|
||||
* @method static bool hasCommand(string $name) 某个指令是否存在
|
||||
* @method static array getNamespaces() 获取所有的命名空间
|
||||
* @method static string findNamespace(string $namespace) 查找注册命名空间中的名称或缩写。
|
||||
* @method static Command find(string $name) 查找指令
|
||||
* @method static Command[] all(string $namespace = null) 获取所有的指令
|
||||
* @method static string extractNamespace(string $name, int $limit = 0) 返回命名空间部分
|
||||
*/
|
||||
class Console extends Facade
|
||||
{
|
||||
/**
|
||||
* 获取当前Facade对应类名(或者已经绑定的容器对象标识)
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeClass()
|
||||
{
|
||||
return 'console';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2023 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\facade;
|
||||
|
||||
use think\Facade;
|
||||
|
||||
/**
|
||||
* @see \think\Cookie
|
||||
* @package think\facade
|
||||
* @mixin \think\Cookie
|
||||
* @method static mixed get(mixed $name = '', string $default = null) 获取cookie
|
||||
* @method static bool has(string $name) 是否存在Cookie参数
|
||||
* @method static void set(string $name, string $value, mixed $option = null) Cookie 设置
|
||||
* @method static void forever(string $name, string $value = '', mixed $option = null) 永久保存Cookie数据
|
||||
* @method static void delete(string $name) Cookie删除
|
||||
* @method static array getCookie() 获取cookie保存数据
|
||||
* @method static void save() 保存Cookie
|
||||
*/
|
||||
class Cookie extends Facade
|
||||
{
|
||||
/**
|
||||
* 获取当前Facade对应类名(或者已经绑定的容器对象标识)
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeClass()
|
||||
{
|
||||
return 'cookie';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2023 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\facade;
|
||||
|
||||
use think\Facade;
|
||||
|
||||
/**
|
||||
* @see \think\Env
|
||||
* @package think\facade
|
||||
* @mixin \think\Env
|
||||
* @method static void load(string $file) 读取环境变量定义文件
|
||||
* @method static mixed get(string $name = null, mixed $default = null) 获取环境变量值
|
||||
* @method static void set(string|array $env, mixed $value = null) 设置环境变量值
|
||||
* @method static bool has(string $name) 检测是否存在环境变量
|
||||
* @method static void __set(string $name, mixed $value) 设置环境变量
|
||||
* @method static mixed __get(string $name) 获取环境变量
|
||||
* @method static bool __isset(string $name) 检测是否存在环境变量
|
||||
* @method static void offsetSet($name, $value)
|
||||
* @method static bool offsetExists($name)
|
||||
* @method static mixed offsetUnset($name)
|
||||
* @method static mixed offsetGet($name)
|
||||
*/
|
||||
class Env extends Facade
|
||||
{
|
||||
/**
|
||||
* 获取当前Facade对应类名(或者已经绑定的容器对象标识)
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeClass()
|
||||
{
|
||||
return 'env';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2023 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\facade;
|
||||
|
||||
use think\Facade;
|
||||
|
||||
/**
|
||||
* @see \think\Event
|
||||
* @package think\facade
|
||||
* @mixin \think\Event
|
||||
* @method static \think\Event listenEvents(array $events) 批量注册事件监听
|
||||
* @method static \think\Event listen(string $event, mixed $listener, bool $first = false) 注册事件监听
|
||||
* @method static bool hasListener(string $event) 是否存在事件监听
|
||||
* @method static void remove(string $event) 移除事件监听
|
||||
* @method static \think\Event bind(array $events) 指定事件别名标识 便于调用
|
||||
* @method static \think\Event subscribe(mixed $subscriber) 注册事件订阅者
|
||||
* @method static \think\Event observe(string|object $observer, null|string $prefix = '') 自动注册事件观察者
|
||||
* @method static mixed trigger(string|object $event, mixed $params = null, bool $once = false) 触发事件
|
||||
* @method static mixed until($event, $params = null) 触发事件(只获取一个有效返回值)
|
||||
*/
|
||||
class Event extends Facade
|
||||
{
|
||||
/**
|
||||
* 获取当前Facade对应类名(或者已经绑定的容器对象标识)
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeClass()
|
||||
{
|
||||
return 'event';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2023 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\facade;
|
||||
|
||||
use think\Facade;
|
||||
|
||||
/**
|
||||
* @see \think\Lang
|
||||
* @package think\facade
|
||||
* @mixin \think\Lang
|
||||
* @method static void setLangSet(string $lang) 设置当前语言
|
||||
* @method static string getLangSet() 获取当前语言
|
||||
* @method static string defaultLangSet() 获取默认语言
|
||||
* @method static array load(string|array $file, string $range = '') 加载语言定义(不区分大小写)
|
||||
* @method static bool has(string|null $name, string $range = '') 判断是否存在语言定义(不区分大小写)
|
||||
* @method static mixed get(string|null $name = null, array $vars = [], string $range = '') 获取语言定义(不区分大小写)
|
||||
* @method static string detect(\think\Request $request) 自动侦测设置获取语言选择
|
||||
* @method static void saveToCookie(\think\Cookie $cookie) 保存当前语言到Cookie
|
||||
*/
|
||||
class Lang extends Facade
|
||||
{
|
||||
/**
|
||||
* 获取当前Facade对应类名(或者已经绑定的容器对象标识)
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeClass()
|
||||
{
|
||||
return 'lang';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2023 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\facade;
|
||||
|
||||
use think\Facade;
|
||||
use think\log\Channel;
|
||||
use think\log\ChannelSet;
|
||||
|
||||
/**
|
||||
* @see \think\Log
|
||||
* @package think\facade
|
||||
* @mixin \think\Log
|
||||
* @method static string|null getDefaultDriver() 默认驱动
|
||||
* @method static mixed getConfig(null|string $name = null, mixed $default = null) 获取日志配置
|
||||
* @method static array getChannelConfig(string $channel, null $name = null, null $default = null) 获取渠道配置
|
||||
* @method static Channel|ChannelSet channel(string|array $name = null) driver() 的别名
|
||||
* @method static mixed createDriver(string $name)
|
||||
* @method static \think\Log clear(string|array $channel = '*') 清空日志信息
|
||||
* @method static \think\Log close(string|array $channel = '*') 关闭本次请求日志写入
|
||||
* @method static array getLog(string $channel = null) 获取日志信息
|
||||
* @method static bool save() 保存日志信息
|
||||
* @method static \think\Log record(mixed $msg, string $type = 'info', array $context = [], bool $lazy = true) 记录日志信息
|
||||
* @method static \think\Log write(mixed $msg, string $type = 'info', array $context = []) 实时写入日志信息
|
||||
* @method static Event listen($listener) 注册日志写入事件监听
|
||||
* @method static void log(string $level, mixed $message, array $context = []) 记录日志信息
|
||||
* @method static void emergency(mixed $message, array $context = []) 记录emergency信息
|
||||
* @method static void alert(mixed $message, array $context = []) 记录警报信息
|
||||
* @method static void critical(mixed $message, array $context = []) 记录紧急情况
|
||||
* @method static void error(mixed $message, array $context = []) 记录错误信息
|
||||
* @method static void warning(mixed $message, array $context = []) 记录warning信息
|
||||
* @method static void notice(mixed $message, array $context = []) 记录notice信息
|
||||
* @method static void info(mixed $message, array $context = []) 记录一般信息
|
||||
* @method static void debug(mixed $message, array $context = []) 记录调试信息
|
||||
* @method static void sql(mixed $message, array $context = []) 记录sql信息
|
||||
* @method static mixed __call($method, $parameters)
|
||||
*/
|
||||
class Log extends Facade
|
||||
{
|
||||
/**
|
||||
* 获取当前Facade对应类名(或者已经绑定的容器对象标识)
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeClass()
|
||||
{
|
||||
return 'log';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2023 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\facade;
|
||||
|
||||
use think\Facade;
|
||||
|
||||
/**
|
||||
* @see \think\Middleware
|
||||
* @package think\facade
|
||||
* @mixin \think\Middleware
|
||||
* @method static void import(array $middlewares = [], string $type = 'global') 导入中间件
|
||||
* @method static void add(mixed $middleware, string $type = 'global') 注册中间件
|
||||
* @method static void route(mixed $middleware) 注册路由中间件
|
||||
* @method static void controller(mixed $middleware) 注册控制器中间件
|
||||
* @method static mixed unshift(mixed $middleware, string $type = 'global') 注册中间件到开始位置
|
||||
* @method static array all(string $type = 'global') 获取注册的中间件
|
||||
* @method static Pipeline pipeline(string $type = 'global') 调度管道
|
||||
* @method static mixed end(\think\Response $response) 结束调度
|
||||
* @method static \think\Response handleException(\think\Request $passable, \Throwable $e) 异常处理
|
||||
*/
|
||||
class Middleware extends Facade
|
||||
{
|
||||
/**
|
||||
* 获取当前Facade对应类名(或者已经绑定的容器对象标识)
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeClass()
|
||||
{
|
||||
return 'middleware';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2023 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\facade;
|
||||
|
||||
use think\Facade;
|
||||
use think\file\UploadedFile;
|
||||
use think\route\Rule;
|
||||
|
||||
/**
|
||||
* @see \think\Request
|
||||
* @package think\facade
|
||||
* @mixin \think\Request
|
||||
* @method static \think\Request setDomain(string $domain) 设置当前包含协议的域名
|
||||
* @method static string domain(bool $port = false) 获取当前包含协议的域名
|
||||
* @method static string rootDomain() 获取当前根域名
|
||||
* @method static \think\Request setSubDomain(string $domain) 设置当前泛域名的值
|
||||
* @method static string subDomain() 获取当前子域名
|
||||
* @method static \think\Request setPanDomain(string $domain) 设置当前泛域名的值
|
||||
* @method static string panDomain() 获取当前泛域名的值
|
||||
* @method static \think\Request setUrl(string $url) 设置当前完整URL 包括QUERY_STRING
|
||||
* @method static string url(bool $complete = false) 获取当前完整URL 包括QUERY_STRING
|
||||
* @method static \think\Request setBaseUrl(string $url) 设置当前URL 不含QUERY_STRING
|
||||
* @method static string baseUrl(bool $complete = false) 获取当前URL 不含QUERY_STRING
|
||||
* @method static string baseFile(bool $complete = false) 获取当前执行的文件 SCRIPT_NAME
|
||||
* @method static \think\Request setRoot(string $url) 设置URL访问根地址
|
||||
* @method static string root(bool $complete = false) 获取URL访问根地址
|
||||
* @method static string rootUrl() 获取URL访问根目录
|
||||
* @method static \think\Request setPathinfo(string $pathinfo) 设置当前请求的pathinfo
|
||||
* @method static string pathinfo() 获取当前请求URL的pathinfo信息(含URL后缀)
|
||||
* @method static string ext() 当前URL的访问后缀
|
||||
* @method static integer|float time(bool $float = false) 获取当前请求的时间
|
||||
* @method static string type() 当前请求的资源类型
|
||||
* @method static void mimeType(string|array $type, string $val = '') 设置资源类型
|
||||
* @method static \think\Request setMethod(string $method) 设置请求类型
|
||||
* @method static string method(bool $origin = false) 当前的请求类型
|
||||
* @method static bool isGet() 是否为GET请求
|
||||
* @method static bool isPost() 是否为POST请求
|
||||
* @method static bool isPut() 是否为PUT请求
|
||||
* @method static bool isDelete() 是否为DELTE请求
|
||||
* @method static bool isHead() 是否为HEAD请求
|
||||
* @method static bool isPatch() 是否为PATCH请求
|
||||
* @method static bool isOptions() 是否为OPTIONS请求
|
||||
* @method static bool isCli() 是否为cli
|
||||
* @method static bool isCgi() 是否为cgi
|
||||
* @method static mixed param(string|array $name = '', mixed $default = null, string|array|null $filter = '') 获取当前请求的参数
|
||||
* @method static \think\Request setRule(Rule $rule) 设置路由变量
|
||||
* @method static Rule|null rule() 获取当前路由对象
|
||||
* @method static \think\Request setRoute(array $route) 设置路由变量
|
||||
* @method static mixed route(string|array $name = '', mixed $default = null, string|array|null $filter = '') 获取路由参数
|
||||
* @method static mixed get(string|array $name = '', mixed $default = null, string|array|null $filter = '') 获取GET参数
|
||||
* @method static mixed middleware(mixed $name, mixed $default = null) 获取中间件传递的参数
|
||||
* @method static mixed post(string|array $name = '', mixed $default = null, string|array|null $filter = '') 获取POST参数
|
||||
* @method static mixed put(string|array $name = '', mixed $default = null, string|array|null $filter = '') 获取PUT参数
|
||||
* @method static mixed delete(mixed $name = '', mixed $default = null, string|array|null $filter = '') 设置获取DELETE参数
|
||||
* @method static mixed patch(mixed $name = '', mixed $default = null, string|array|null $filter = '') 设置获取PATCH参数
|
||||
* @method static mixed request(string|array $name = '', mixed $default = null, string|array|null $filter = '') 获取request变量
|
||||
* @method static mixed env(string $name = '', string $default = null) 获取环境变量
|
||||
* @method static mixed session(string $name = '', string $default = null) 获取session数据
|
||||
* @method static mixed cookie(mixed $name = '', string $default = null, string|array|null $filter = '') 获取cookie参数
|
||||
* @method static mixed server(string $name = '', string $default = '') 获取server参数
|
||||
* @method static null|array|UploadedFile file(string $name = '') 获取上传的文件信息
|
||||
* @method static string|array header(string $name = '', string $default = null) 设置或者获取当前的Header
|
||||
* @method static mixed input(array $data = [], string|false $name = '', mixed $default = null, string|array|null $filter = '') 获取变量 支持过滤和默认值
|
||||
* @method static mixed filter(mixed $filter = null) 设置或获取当前的过滤规则
|
||||
* @method static mixed filterValue(mixed &$value, mixed $key, array $filters) 递归过滤给定的值
|
||||
* @method static bool has(string $name, string $type = 'param', bool $checkEmpty = false) 是否存在某个请求参数
|
||||
* @method static array only(array $name, mixed $data = 'param', string|array|null $filter = '') 获取指定的参数
|
||||
* @method static mixed except(array $name, string $type = 'param') 排除指定参数获取
|
||||
* @method static bool isSsl() 当前是否ssl
|
||||
* @method static bool isJson() 当前是否JSON请求
|
||||
* @method static bool isAjax(bool $ajax = false) 当前是否Ajax请求
|
||||
* @method static bool isPjax(bool $pjax = false) 当前是否Pjax请求
|
||||
* @method static string ip() 获取客户端IP地址
|
||||
* @method static boolean isValidIP(string $ip, string $type = '') 检测是否是合法的IP地址
|
||||
* @method static string ip2bin(string $ip) 将IP地址转换为二进制字符串
|
||||
* @method static bool isMobile() 检测是否使用手机访问
|
||||
* @method static string scheme() 当前URL地址中的scheme参数
|
||||
* @method static string query() 当前请求URL地址中的query参数
|
||||
* @method static \think\Request setHost(string $host) 设置当前请求的host(包含端口)
|
||||
* @method static string host(bool $strict = false) 当前请求的host
|
||||
* @method static int port() 当前请求URL地址中的port参数
|
||||
* @method static string protocol() 当前请求 SERVER_PROTOCOL
|
||||
* @method static int remotePort() 当前请求 REMOTE_PORT
|
||||
* @method static string contentType() 当前请求 HTTP_CONTENT_TYPE
|
||||
* @method static string secureKey() 获取当前请求的安全Key
|
||||
* @method static \think\Request setController(string $controller) 设置当前的控制器名
|
||||
* @method static \think\Request setAction(string $action) 设置当前的操作名
|
||||
* @method static string controller(bool $convert = false) 获取当前的控制器名
|
||||
* @method static string action(bool $convert = false) 获取当前的操作名
|
||||
* @method static string getContent() 设置或者获取当前请求的content
|
||||
* @method static string getInput() 获取当前请求的php://input
|
||||
* @method static string buildToken(string $name = '__token__', mixed $type = 'md5') 生成请求令牌
|
||||
* @method static bool checkToken(string $token = '__token__', array $data = []) 检查请求令牌
|
||||
* @method static \think\Request withMiddleware(array $middleware) 设置在中间件传递的数据
|
||||
* @method static \think\Request withGet(array $get) 设置GET数据
|
||||
* @method static \think\Request withPost(array $post) 设置POST数据
|
||||
* @method static \think\Request withCookie(array $cookie) 设置COOKIE数据
|
||||
* @method static \think\Request withSession(Session $session) 设置SESSION数据
|
||||
* @method static \think\Request withServer(array $server) 设置SERVER数据
|
||||
* @method static \think\Request withHeader(array $header) 设置HEADER数据
|
||||
* @method static \think\Request withEnv(Env $env) 设置ENV数据
|
||||
* @method static \think\Request withInput(string $input) 设置php://input数据
|
||||
* @method static \think\Request withFiles(array $files) 设置文件上传数据
|
||||
* @method static \think\Request withRoute(array $route) 设置ROUTE变量
|
||||
* @method static mixed __set(string $name, mixed $value) 设置中间传递数据
|
||||
* @method static mixed __get(string $name) 获取中间传递数据的值
|
||||
* @method static boolean __isset(string $name) 检测中间传递数据的值
|
||||
* @method static bool offsetExists(mixed $name)
|
||||
* @method static mixed offsetGet(mixed $name)
|
||||
* @method static mixed offsetSet(mixed $name, $value)
|
||||
* @method static mixed offsetUnset(mixed $name)
|
||||
*/
|
||||
class Request extends Facade
|
||||
{
|
||||
/**
|
||||
* 获取当前Facade对应类名(或者已经绑定的容器对象标识)
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeClass()
|
||||
{
|
||||
return 'request';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2023 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\facade;
|
||||
|
||||
use think\Facade;
|
||||
use think\route\Dispatch;
|
||||
use think\route\Domain;
|
||||
use think\route\Rule;
|
||||
use think\route\RuleGroup;
|
||||
use think\route\RuleItem;
|
||||
use think\route\RuleName;
|
||||
use think\route\Url as UrlBuild;
|
||||
|
||||
/**
|
||||
* @see \think\Route
|
||||
* @package think\facade
|
||||
* @mixin \think\Route
|
||||
* @method static mixed config(string $name = null)
|
||||
* @method static \think\Route lazy(bool $lazy = true) 设置路由域名及分组(包括资源路由)是否延迟解析
|
||||
* @method static \think\Route mergeRuleRegex(bool $merge = true) 设置路由域名及分组(包括资源路由)是否合并解析
|
||||
* @method static void setGroup(RuleGroup $group) 设置当前分组
|
||||
* @method static RuleGroup getGroup(string $name = null) 获取指定标识的路由分组 不指定则获取当前分组
|
||||
* @method static \think\Route pattern(array $pattern) 注册变量规则
|
||||
* @method static \think\Route option(array $option) 注册路由参数
|
||||
* @method static Domain domain(string|array $name, mixed $rule = null) 注册域名路由
|
||||
* @method static array getDomains() 获取域名
|
||||
* @method static RuleName getRuleName() 获取RuleName对象
|
||||
* @method static \think\Route bind(string $bind, string $domain = null) 设置路由绑定
|
||||
* @method static array getBind() 读取路由绑定信息
|
||||
* @method static string|null getDomainBind(string $domain = null) 读取路由绑定
|
||||
* @method static RuleItem[] getName(string $name = null, string $domain = null, string $method = '*') 读取路由标识
|
||||
* @method static void import(array $name) 批量导入路由标识
|
||||
* @method static void setName(string $name, RuleItem $ruleItem, bool $first = false) 注册路由标识
|
||||
* @method static void setRule(string $rule, RuleItem $ruleItem = null) 保存路由规则
|
||||
* @method static RuleItem[] getRule(string $rule) 读取路由
|
||||
* @method static array getRuleList() 读取路由列表
|
||||
* @method static void clear() 清空路由规则
|
||||
* @method static RuleItem rule(string $rule, mixed $route = null, string $method = '*') 注册路由规则
|
||||
* @method static \think\Route setCrossDomainRule(Rule $rule) 设置跨域有效路由规则
|
||||
* @method static RuleGroup group(string|\Closure $name, mixed $route = null) 注册路由分组
|
||||
* @method static RuleItem any(string $rule, mixed $route) 注册路由
|
||||
* @method static RuleItem get(string $rule, mixed $route) 注册GET路由
|
||||
* @method static RuleItem post(string $rule, mixed $route) 注册POST路由
|
||||
* @method static RuleItem put(string $rule, mixed $route) 注册PUT路由
|
||||
* @method static RuleItem delete(string $rule, mixed $route) 注册DELETE路由
|
||||
* @method static RuleItem patch(string $rule, mixed $route) 注册PATCH路由
|
||||
* @method static RuleItem head(string $rule, mixed $route) 注册HEAD路由
|
||||
* @method static RuleItem options(string $rule, mixed $route) 注册OPTIONS路由
|
||||
* @method static Resource resource(string $rule, string $route) 注册资源路由
|
||||
* @method static RuleItem view(string $rule, string $template = '', array $vars = []) 注册视图路由
|
||||
* @method static RuleItem redirect(string $rule, string $route = '', int $status = 301) 注册重定向路由
|
||||
* @method static \think\Route rest(string|array $name, array|bool $resource = []) rest方法定义和修改
|
||||
* @method static array|null getRest(string $name = null) 获取rest方法定义的参数
|
||||
* @method static RuleItem miss(string|\Closure $route, string $method = '*') 注册未匹配路由规则后的处理
|
||||
* @method static Response dispatch(\think\Request $request, Closure|bool $withRoute = true) 路由调度
|
||||
* @method static Dispatch|false check() 检测URL路由
|
||||
* @method static Dispatch url(string $url) 默认URL解析
|
||||
* @method static UrlBuild buildUrl(string $url = '', array $vars = []) URL生成 支持路由反射
|
||||
* @method static RuleGroup __call(string $method, array $args) 设置全局的路由分组参数
|
||||
*/
|
||||
class Route extends Facade
|
||||
{
|
||||
/**
|
||||
* 获取当前Facade对应类名(或者已经绑定的容器对象标识)
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeClass()
|
||||
{
|
||||
return 'route';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2023 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\facade;
|
||||
|
||||
use think\Facade;
|
||||
|
||||
/**
|
||||
* @see \think\Session
|
||||
* @package think\facade
|
||||
* @mixin \think\Session
|
||||
* @method static mixed getConfig(null|string $name = null, mixed $default = null) 获取Session配置
|
||||
* @method static string|null getDefaultDriver() 默认驱动
|
||||
*/
|
||||
class Session extends Facade
|
||||
{
|
||||
/**
|
||||
* 获取当前Facade对应类名(或者已经绑定的容器对象标识)
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeClass()
|
||||
{
|
||||
return 'session';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2023 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\facade;
|
||||
|
||||
use think\Facade;
|
||||
|
||||
/**
|
||||
* @see \think\Validate
|
||||
* @package think\facade
|
||||
* @mixin \think\Validate
|
||||
* @method static void setLang(\think\Lang $lang) 设置Lang对象
|
||||
* @method static void setDb(\think\Db $db) 设置Db对象
|
||||
* @method static void setRequest(\think\Request $request) 设置Request对象
|
||||
* @method static \think\Validate rule(string|array $name, mixed $rule = '') 添加字段验证规则
|
||||
* @method static \think\Validate extend(string $type, callable $callback = null, string $message = null) 注册验证(类型)规则
|
||||
* @method static void setTypeMsg(string|array $type, string $msg = null) 设置验证规则的默认提示信息
|
||||
* @method static Validate message(array $message) 设置提示信息
|
||||
* @method static \think\Validate scene(string $name) 设置验证场景
|
||||
* @method static bool hasScene(string $name) 判断是否存在某个验证场景
|
||||
* @method static \think\Validate batch(bool $batch = true) 设置批量验证
|
||||
* @method static \think\Validate failException(bool $fail = true) 设置验证失败后是否抛出异常
|
||||
* @method static \think\Validate only(array $fields) 指定需要验证的字段列表
|
||||
* @method static \think\Validate remove(string|array $field, mixed $rule = null) 移除某个字段的验证规则
|
||||
* @method static \think\Validate append(string|array $field, mixed $rule = null) 追加某个字段的验证规则
|
||||
* @method static bool check(array $data, array $rules = []) 数据自动验证
|
||||
* @method static bool checkRule(mixed $value, mixed $rules) 根据验证规则验证数据
|
||||
* @method static bool confirm(mixed $value, mixed $rule, array $data = [], string $field = '') 验证是否和某个字段的值一致
|
||||
* @method static bool different(mixed $value, mixed $rule, array $data = []) 验证是否和某个字段的值是否不同
|
||||
* @method static bool egt(mixed $value, mixed $rule, array $data = []) 验证是否大于等于某个值
|
||||
* @method static bool gt(mixed $value, mixed $rule, array $data = []) 验证是否大于某个值
|
||||
* @method static bool elt(mixed $value, mixed $rule, array $data = []) 验证是否小于等于某个值
|
||||
* @method static bool lt(mixed $value, mixed $rule, array $data = []) 验证是否小于某个值
|
||||
* @method static bool eq(mixed $value, mixed $rule) 验证是否等于某个值
|
||||
* @method static bool must(mixed $value, mixed $rule = null) 必须验证
|
||||
* @method static bool is(mixed $value, string $rule, array $data = []) 验证字段值是否为有效格式
|
||||
* @method static bool token(mixed $value, mixed $rule, array $data) 验证表单令牌
|
||||
* @method static bool activeUrl(mixed $value, mixed $rule = 'MX') 验证是否为合格的域名或者IP 支持A,MX,NS,SOA,PTR,CNAME,AAAA,A6, SRV,NAPTR,TXT 或者 ANY类型
|
||||
* @method static bool ip(mixed $value, mixed $rule = 'ipv4') 验证是否有效IP
|
||||
* @method static bool fileExt(mixed $file, mixed $rule) 验证上传文件后缀
|
||||
* @method static bool fileMime(mixed $file, mixed $rule) 验证上传文件类型
|
||||
* @method static bool fileSize(mixed $file, mixed $rule) 验证上传文件大小
|
||||
* @method static bool image(mixed $file, mixed $rule) 验证图片的宽高及类型
|
||||
* @method static bool dateFormat(mixed $value, mixed $rule) 验证时间和日期是否符合指定格式
|
||||
* @method static bool unique(mixed $value, mixed $rule, array $data = [], string $field = '') 验证是否唯一
|
||||
* @method static bool filter(mixed $value, mixed $rule) 使用filter_var方式验证
|
||||
* @method static bool requireIf(mixed $value, mixed $rule, array $data = []) 验证某个字段等于某个值的时候必须
|
||||
* @method static bool requireCallback(mixed $value, mixed $rule, array $data = []) 通过回调方法验证某个字段是否必须
|
||||
* @method static bool requireWith(mixed $value, mixed $rule, array $data = []) 验证某个字段有值的情况下必须
|
||||
* @method static bool requireWithout(mixed $value, mixed $rule, array $data = []) 验证某个字段没有值的情况下必须
|
||||
* @method static bool in(mixed $value, mixed $rule) 验证是否在范围内
|
||||
* @method static bool notIn(mixed $value, mixed $rule) 验证是否不在某个范围
|
||||
* @method static bool between(mixed $value, mixed $rule) between验证数据
|
||||
* @method static bool notBetween(mixed $value, mixed $rule) 使用notbetween验证数据
|
||||
* @method static bool length(mixed $value, mixed $rule) 验证数据长度
|
||||
* @method static bool max(mixed $value, mixed $rule) 验证数据最大长度
|
||||
* @method static bool min(mixed $value, mixed $rule) 验证数据最小长度
|
||||
* @method static bool after(mixed $value, mixed $rule, array $data = []) 验证日期
|
||||
* @method static bool before(mixed $value, mixed $rule, array $data = []) 验证日期
|
||||
* @method static bool afterWith(mixed $value, mixed $rule, array $data = []) 验证日期
|
||||
* @method static bool beforeWith(mixed $value, mixed $rule, array $data = []) 验证日期
|
||||
* @method static bool expire(mixed $value, mixed $rule) 验证有效期
|
||||
* @method static bool allowIp(mixed $value, mixed $rule) 验证IP许可
|
||||
* @method static bool denyIp(mixed $value, mixed $rule) 验证IP禁用
|
||||
* @method static bool regex(mixed $value, mixed $rule) 使用正则验证数据
|
||||
* @method static array|string getError() 获取错误信息
|
||||
* @method static bool __call(string $method, array $args) 动态方法 直接调用is方法进行验证
|
||||
*/
|
||||
class Validate extends Facade
|
||||
{
|
||||
/**
|
||||
* 始终创建新的对象实例
|
||||
* @var bool
|
||||
*/
|
||||
protected static $alwaysNewInstance = true;
|
||||
|
||||
/**
|
||||
* 获取当前Facade对应类名(或者已经绑定的容器对象标识)
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeClass()
|
||||
{
|
||||
return 'validate';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2023 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\facade;
|
||||
|
||||
use think\Facade;
|
||||
|
||||
/**
|
||||
* @see \think\View
|
||||
* @package think\facade
|
||||
* @mixin \think\View
|
||||
* @method static \think\View engine(string $type = null) 获取模板引擎
|
||||
* @method static \think\View assign(string|array $name, mixed $value = null) 模板变量赋值
|
||||
* @method static \think\View filter(\think\Callable $filter = null) 视图过滤
|
||||
* @method static string fetch(string $template = '', array $vars = []) 解析和获取模板内容 用于输出
|
||||
* @method static string display(string $content, array $vars = []) 渲染内容输出
|
||||
* @method static mixed __set(string $name, mixed $value) 模板变量赋值
|
||||
* @method static mixed __get(string $name) 取得模板显示变量的值
|
||||
* @method static bool __isset(string $name) 检测模板变量是否设置
|
||||
* @method static string|null getDefaultDriver() 默认驱动
|
||||
*/
|
||||
class View extends Facade
|
||||
{
|
||||
/**
|
||||
* 获取当前Facade对应类名(或者已经绑定的容器对象标识)
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeClass()
|
||||
{
|
||||
return 'view';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user