fix:修复BUG/升级1.1.6版本

This commit is contained in:
Ying
2023-04-25 20:11:49 +08:00
parent 445e5f9662
commit 6a6866bbaf
2357 changed files with 456920 additions and 140567 deletions

View File

@@ -10,12 +10,19 @@ declare (strict_types=1);
// | Author: meystack <coolsec@foxmail.com> Apache 2.0 License
// +----------------------------------------------------------------------
namespace app;
use support\Log;
use support\Response;
use think\db\exception\BindParamException;
use think\facade\Db;
use think\helper\Str;
use think\Validate;
use Webman\Http\Request;
use Gregwar\Captcha\CaptchaBuilder;
use Webman\Captcha\CaptchaBuilder;
use PhpOffice\PhpSpreadsheet\Exception;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Shared\Date;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Style\Alignment;
class BaseController
{
@@ -204,14 +211,15 @@ class BaseController
* 返回错误信息
* @param string $msg
* @param int $code
* @param string $app
* @return Response
*/
protected function retResponseError(string $msg = '404 not found', int $code = 404): Response
protected function retResponseError(string $msg = '404 not found', int $code = 404, string $app = 'index'): Response
{
if (\request()->expectsJson()) {
return json(['code' => 404, 'msg' => $msg]);
}
return response(request_error(), $code);
return response(request_error($app), $code);
}
/**
@@ -250,6 +258,195 @@ class BaseController
return response($img_content, 200, ['Content-Type' => 'image/jpeg']);
}
/**
* 导入数据
* @return Response
* @throws Exception
* @throws BindParamException
*/
public function import(): Response
{
$file = request()->file('file');
if (!$file || !$file->isValid()) {
return $this->error('上传文件校验失败!');
}
// 获取临时目录
$filePath = uniqid() . '.' . strtolower($file->getUploadExtension());
$resource = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $filePath;
if (!$file->move($resource)) {
return $this->error('上传文件读写失败!');
}
$ext = pathinfo($filePath, PATHINFO_EXTENSION);
if (!in_array($ext, ['xls', 'xlsx'])) {
return $this->error('仅支持xls xlsx文件格式');
}
try {
// 实例化Excel对象
$fileType = IOFactory::identify($filePath);
$reader = IOFactory::createReader($fileType);
$reader->setReadDataOnly(true);
$spreadsheet = $reader->load($resource);
} catch (\Exception $e) {
return $this->error($e->getMessage());
}
// 默认获取第一张表
$currentSheet = $spreadsheet->getSheet(0);
$listSheetData = $currentSheet->toArray();
// 数据量最小为1条
$listRows = count($listSheetData);
if ($listRows <= 2) {
return $this->error('数据行最小为2');
}
// 获取Excel首行预处理
$fields = $listSheetData[0];
array_shift($listSheetData);
// 获取数据表字段注释
$table = $this->model->getTable();
$columns = Db::query("SHOW FULL COLUMNS FROM {$table}");
$comments = array_column($columns, 'Comment', 'Field');
$columnType = !isset($this->columnType) ? 'comment' : $this->columnType;
// 循环处理要插入的row
$inserts = [];
foreach ($listSheetData as $row => $item) {
foreach ($fields as $key => $value) {
$excelValue = function ($field, $value) {
if (in_array($field, ['create_time', 'update_time']) && !empty($value)) {
$time = Date::excelToTimestamp($value);
$value = strlen((string)$time) >= 12 ? $value : $time;
if ($value <= 1) { // 负值时间戳
$value = time();
}
}
return $value;
};
// 默认首行为注释模式
if (strtolower($columnType) == 'comment') {
$field = array_search($value, $comments);
if (!empty($field)) {
$inserts[$row][$field] = $excelValue($field, $item[$key]);
}
} else if (array_key_exists($value, $comments)) {
$inserts[$row][$value] = $excelValue($value, $item[$key]);
}
}
// 录入登录用户ID
if (array_key_exists('admin_id', $comments)) {
$entry_id = $inserts[$row]['admin_id'] ?? 0;
if (empty($entry_id)) {
$inserts[$row]['admin_id'] = get_admin_id();
}
}
}
// 判断是否有可导入的数据
if (count($inserts) == 0) {
return $this->error('没有可导入的数据!');
}
try {
// 批量插入数据
$this->model->insertAll($inserts);
unlink($resource);
} catch (\Exception $e) {
return $this->error($e->getMessage());
}
return $this->success('导入成功!', '/');
}
/**
* 导出数据
* @return Response
* @throws BindParamException
*/
public function export(): Response
{
if (\request()->isAjax()) {
// 获取分页
$page = input('page', 1);
$limit = input('limit', 1000);
// 查询表数据
$table = $this->model->getTable();
$columns = Db::query("SHOW FULL COLUMNS FROM {$table}");
$titles = array_column($columns, 'Comment', 'Field');
$data = $this->model->limit($limit)->page($page)->select()->toArray();
$folder = date('Y-m-d', time());
// 使用表注释为文件名称
$tableInfo = Db::query("SHOW TABLE STATUS LIKE '{$table}'");
$Comment = $tableInfo[0]['Comment'] ?: '数据_';
$fileName = $Comment . $folder . '.xlsx';
$filePath = public_path('upload/files') . DIRECTORY_SEPARATOR . $folder . DIRECTORY_SEPARATOR . $fileName;
if (!$this->exportThread($titles, $data, $filePath)) {
return $this->error('导出失败!');
}
$downUrl = str_replace(public_path(), '', $filePath);
return $this->success('导出成功!', $downUrl);
}
return $this->error('非法请求!');
}
/**
* @param array $titles
* @param array $data
* @param string $filePath
* @return bool
*/
protected function exportThread(array $titles, array $data, string $filePath): bool
{
// 实例化Xls接口
$spreadSheet = new Spreadsheet();
$activeSheet = $spreadSheet->getActiveSheet();
// 设表列头样式居中
$activeSheet->getStyle('A1:AZ1')->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
$columnType = !isset($this->columnType) ? 'comment' : $this->columnType;
try {
$titCol = 'A';
foreach ($titles as $key => $value) {
$value = $columnType == 'comment' ? $value : $key;
$activeSheet->setCellValue($titCol . '1', $value);
$titCol++;
}
$rowLine = 2;
foreach ($data as $item) {
$rowCol = 'A';
foreach ($item as $value) {
$activeSheet->setCellValue($rowCol . $rowLine, $value);
$rowCol++;
}
$rowLine++;
}
$writer = IOFactory::createWriter($spreadSheet, 'Xlsx');
mk_dirs(dirname($filePath));
$writer->save($filePath);
$spreadSheet->disconnectWorksheets();
unset($spreadsheet);
} catch (\Throwable $e) {
Log::error($e->getMessage());
return false;
}
return true;
}
/**
* 检查验证码
* @param string $text

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
// +----------------------------------------------------------------------
// | swiftAdmin 极速开发框架 [基于WebMan开发]
// +----------------------------------------------------------------------
@@ -14,7 +14,11 @@ namespace app\admin\controller;
use app\AdminController;
use app\common\library\ResultCode;
use app\common\library\Upload;
use Psr\SimpleCache\InvalidArgumentException;
use support\Response;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
/**
* Ajax类
@@ -23,6 +27,15 @@ use support\Response;
*/
class Ajax extends AdminController
{
/**
* 初始化方法
* @return void
* @throws \Exception
*/
public function __construct()
{
parent::__construct();
}
/**
* 测试接口
* @return Response
@@ -51,6 +64,10 @@ class Ajax extends AdminController
/**
* 远程下载图片
* @return Response
* @throws InvalidArgumentException
* @throws DataNotFoundException
* @throws DbException
* @throws ModelNotFoundException
*/
public function getImage(): Response
{

View File

@@ -400,7 +400,8 @@ class Index extends AdminController
return $this->error($th->getMessage());
}
// 清理系统缓存
// 清理系统核心缓存
Cache::tag('core_system')->clear();
$configList = Cache::get('config_list');
foreach ($configList as $item) {
Cache::delete($item);

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
// +----------------------------------------------------------------------
// | swiftAdmin 极速开发框架 [基于WebMan开发]
// +----------------------------------------------------------------------

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
// +----------------------------------------------------------------------
// | swiftAdmin 极速开发框架 [基于WebMan开发]
// +----------------------------------------------------------------------

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
// +----------------------------------------------------------------------
// | swiftAdmin 极速开发框架 [基于WebMan开发]
// +----------------------------------------------------------------------

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
// +----------------------------------------------------------------------
// | swiftAdmin 极速开发框架 [基于WebMan开发]
// +----------------------------------------------------------------------

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
// +----------------------------------------------------------------------
// | swiftAdmin 极速开发框架 [基于WebMan开发]
// +----------------------------------------------------------------------

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
// +----------------------------------------------------------------------
// | swiftAdmin 极速开发框架 [基于WebMan开发]
// +----------------------------------------------------------------------

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
// +----------------------------------------------------------------------
// | swiftAdmin 极速开发框架 [基于WebMan开发]
// +----------------------------------------------------------------------
@@ -17,7 +17,6 @@ use support\Response;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
use Webman\Http\Request;
/**
* 字典管理

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
// +----------------------------------------------------------------------
// | swiftAdmin 极速开发框架 [基于WebMan开发]
// +----------------------------------------------------------------------

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
namespace app\admin\controller\system;
use app\AdminController;

View File

@@ -81,7 +81,7 @@ class Plugin extends AdminController
return $this->error('请勿重复安装插件');
}
try {
// try {
$pluginZip = self::downLoad($name, ['name' => $name, 'token' => input('token')]);
ZipArchives::unzip($pluginZip, plugin_path(), '', true);
@@ -95,10 +95,10 @@ class Plugin extends AdminController
self::pluginMenu($name);
self::executeSql($name);
self::enabled($name);
} catch (\Throwable $th) {
recursive_delete($pluginPath);
return $this->error($th->getMessage(), null, self::$ServerBody, $th->getCode());
}
// } catch (\Throwable $th) {
// recursive_delete($pluginPath);
// return $this->error($th->getMessage(), null, self::$ServerBody, $th->getCode());
// }
return $this->success('插件安装成功', null, get_plugin_config($name, true));
}
@@ -125,7 +125,7 @@ class Plugin extends AdminController
$pluginPath = plugin_path($name);
$pluginClass = get_plugin_instance($name);
$pluginClass->uninstall();
if (getenv('APP_DEBUG') && Auth::instance()->SuperAdmin()) {
if (get_env('APP_DEBUG') && Auth::instance()->SuperAdmin()) {
self::executeSql($name, 'uninstall');
}

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
// +----------------------------------------------------------------------
// | swiftAdmin 极速开发框架 [基于WebMan开发]
// +----------------------------------------------------------------------

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
// +----------------------------------------------------------------------
// | swiftAdmin 极速开发框架 [基于WebMan开发]
// +----------------------------------------------------------------------

View File

@@ -26,7 +26,7 @@
<div class="layui-col-md8">
<img src="{$AdminLogin.face}" class="layui-admin-avatar">
<div class="layui-admin-content">
<span class="h4">早安{$AdminLogin.nickname|default=$AdminLogin.name},开始您一天的工作吧!</span>
<span class="h4">欢迎您{$AdminLogin.nickname|default=$AdminLogin.name},开始您一天的工作吧!</span>
<span>今日多云转阴18℃ - 22℃出门记得穿外套哦~</span>
</div>
</div>

View File

@@ -138,7 +138,7 @@
<div class="layui-card">
<div class="layui-card-body" style="padding: 25px;">
<div class="text-center layui-text">
<div class="user-info-head" id="imgHead" lay-upload="imgHead" data-url="{:url('/ajax/upload/')}?action=avatar" callback="imgHead">
<div class="user-info-head" id="imgHead" lay-upload="imgHead" data-size="1024" data-url="{:url('/Ajax/upload/')}" callback="imgHead">
<img src="{$data.face}" class="imgHead" />
</div>
<h2 style="padding-top: 20px;">{$data.nickname|default='没有昵称'}</h2>
@@ -281,70 +281,72 @@
<script>
layui.use(['admin'],function() {
var admin = layui.admin;
var jquery = layui.jquery;
let $ = layui.jquery;
let admin = layui.admin;
admin.callback.imgHead = function (clickthis, colletction) {
var res = colletction.res;
if (res.code === 200) { // 查找元素
jquery('.imgHead').attr('src',res.url);
// // 执行后端投递工作
// jquery.post('{:url("/system/admin/modify")}',{
// field: 'face'
// ,face: res.url
// },function(res) {
// layer.msg("{:__('上传成功')}");
// })
}
else {
$('.imgHead').attr('src', res.url);
// 执行后端投递工作
$.post('{:url("/system/admin/modify")}', {
field: 'face'
, face: res.url
}, function (res) {
layer.msg("{:__('上传成功')}");
})
} else {
layer.error(res.msg);
}
}
// 编辑签名
jquery('.userMood').dblclick(function() {
var that = jquery(this),
html = that.text(); that.hide();
jquery(that).parent().append('<input class="editMood layui-input" type="text" maxlength="12" value="' + html +'">');
$('.userMood').dblclick(function () {
var that = $(this),
html = that.text();
that.hide();
$(that).parent().append('<input class="editMood layui-input" type="text" maxlength="12" value="' + html + '">');
})
jquery('.layui-card-body').on('blur','.editMood',function() {
var that = jquery(this),
html = that.val(); that.remove();
jquery('.userMood').text(html);
jquery('.userMood').show();
jquery.post('{:url("/system/admin/modify")}',{
$('.layui-card-body').on('blur', '.editMood', function () {
var that = $(this),
html = that.val();
that.remove();
$('.userMood').text(html);
$('.userMood').show();
$.post('{:url("/system/admin/modify")}', {
field: 'mood'
, mood: html
}, function (res) {
})
})
jquery('.layui-inputags').click(function(){
if (jquery('.editTags').length <= 0) {
jquery(this).parent().append('<input class="editTags layui-input" type="text" maxlength="10">');
$('.layui-inputags').click(function () {
if ($('.editTags').length <= 0) {
$(this).parent().append('<input class="editTags layui-input" type="text" maxlength="10">');
}
})
// 添加标签
jquery('.layui-card-body').on('blur','.editTags',function() {
var that = jquery(this),
html = that.val(); that.remove();
if (html == '') {
$('.layui-card-body').on('blur', '.editTags', function () {
var that = $(this),
html = that.val();
that.remove();
if (html === '') {
return;
}
jquery.post('{:url("/system/admin/modify")}',{
$.post('{:url("/system/admin/modify")}', {
field: 'tags'
, tags: html
}, function (res) {
if (res.code == 200) {
if (res.code === 200) {
var elem = '\n';
elem += '<span class="layui-badge layui-bg-gray">';
elem += '<i class="layui-icon layui-icon-close"></i>';
elem += html;
elem += '</span>';
jquery('.layui-badge-list').append(elem);
$('.layui-badge-list').append(elem);
} else {
layer.error(res.msg);
}
@@ -352,15 +354,15 @@
})
// 删除标签
jquery('.layui-card-body').on('click','.layui-badge-list i',function() {
var that = jquery(this),
$('.layui-card-body').on('click', '.layui-badge-list i', function () {
var that = $(this),
html = that.parent('span').text();
jquery.post('{:url("/system/admin/modify")}',{
$.post('{:url("/system/admin/modify")}', {
field: 'tags'
, del: 1
, tags: html
}, function (res) {
if (res.code == 200) {
if (res.code === 200) {
that.parent('span').remove();
} else {
layer.error(res.msg);

View File

@@ -25,7 +25,7 @@
</style>
<div class="layui-col-md3">
<div class="layui-fluid" >
<div class="layui-card" style="height: 500px">
<div class="layui-card" style="padding-bottom: 20px">
<div class="layui-card-header layadmin-card-header-auto">
<h5> <i class="layui-icon layui-icon-user"></i> {:__('公司结构')}</h5>
</div>
@@ -186,8 +186,10 @@
<!-- // 列表编辑框 -->
<script type="text/html" id="tableBar">
<if (check_admin_auth(url("/system/admin/edit")))>
<a class="layui-table-text" data-title="{:__('编辑')} {{d.name}}" callback="edits" data-url="#adminforms" data-area="710px,550px" lay-event="edit" >{:__('编辑')}</a>
<div class="layui-divider layui-divider-vertical"></div>
</if>
<a class="layui-table-text" data-title="{:__('访问权限')}"
callback="rulecates" data-url="#authForms" data-area="300px" lay-event="rules" >{:__('权限')}</a>
<div class="layui-divider layui-divider-vertical"></div>

View File

@@ -50,7 +50,7 @@
<i class="layui-icon layui-icon-edit"></i>{:__('修改')}
</button>
<!-- // 删除所有 -->
<button class="layui-btn icon-btn layui-btn-danger" lay-batch="" data-table="lay-tree" data-url="{:url('/system/Dictionary/del')}" >
<button class="layui-btn icon-btn layui-btn-danger" lay-batch="" data-table="lay-tableGroup" data-url="{:url('/system/Dictionary/del')}" >
<i class="layui-icon layui-icon-delete"></i>{:__('删除')}
</button>
</div>
@@ -216,7 +216,6 @@
// 获取最后点击
if (obj.checked === true) {
window.tableElem = obj;
$('#editforms').find('.pid').attr('value',obj.data.id);
}
}
@@ -241,18 +240,15 @@
$.post(_pageUrl,
post.field, function(res){
if (res.code === 200) {
if (typeof window.tableElem !== 'undefined') {
window.tableElem.update(JSON.parse(JSON.stringify(post.field)))
} else {
table.reloadData('lay-tableGroup');
}
table.reloadData('lay-tableList');
// 关闭当前窗口
layer.msg(res.msg);
layer.close(colletction.index);
pageThat.attr("disabled",true);
}
else {
layer.error(res.msg);
layer.error(res.msg,'error');
}
}, 'json');

View File

@@ -75,7 +75,6 @@
</select>
</div>
<div class="layui-inline">
<div class="layui-form-label">{:__('账号')}</div>
<div class="layui-input-inline ">
@@ -87,6 +86,10 @@
<button class="layui-btn icon-btn" lay-filter="formSearch" lay-submit><i
class="layui-icon layui-icon-search"></i>{:__('搜索')}
</button>
<!-- // 默认导出 -->
<button class="layui-btn icon-btn" lay-ajax="" data-url="{:url('/system/LoginLog/export')}" data-jump="true" ><i
class="layui-icon layui-icon-export"></i>{:__('导出')}
</button>
<!-- // 删除所有 -->
<button class="layui-btn icon-btn layui-btn-danger" lay-batch="" data-table="lay-tableList" data-url="{:url('/system/LoginLog/del')}" >
<i class="layui-icon layui-icon-delete"></i>{:__('删除')}

View File

@@ -90,7 +90,7 @@
</div>
<div class="layui-footer layui-form-item layui-center " >
<button class="layui-btn layui-btn-primary" type="button" sa-event="closePageDialog" >{:__('取消')}</button>
<button class="layui-btn" lay-add="{:url('/system/User/add')}" lay-edit="{:url('/system/User/edit')}" lay-filter="submitPage" lay-submit>{:__('提交')}</button>
<button class="layui-btn" lay-add="{:url('/system/User/add')}" lay-edit="{:url('/system/User/edit')}" lay-filter="submitPage" data-reload="self" lay-submit>{:__('提交')}</button>
</div>
</form>
</div>

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
namespace app\api\controller;

View File

@@ -20,9 +20,8 @@ class ExceptionHandle extends ExceptionHandler
];
/**
*
* 异常日志记录
* @param Throwable $exception
* @return void|mixed
* @throws DataNotFoundException
* @throws DbException
* @throws ModelNotFoundException
@@ -30,8 +29,8 @@ class ExceptionHandle extends ExceptionHandler
public function report(Throwable $exception)
{
try {
if (saenv('system_exception')
&& !empty($exception->getMessage())) {
if (saenv('system_exception') && !empty($exception->getMessage())) {
$data = [
'module' => request()->app,
'controller' => request()->controller,
@@ -65,9 +64,12 @@ class ExceptionHandle extends ExceptionHandler
*/
public function render(Request $request, Throwable $exception): Response
{
if ($exception instanceof \RuntimeException) {
return \response($exception->getMessage());
}
if (!file_exists(root_path() . '.env')) {
return parent::render($request, $exception);
}
return getenv('APP_DEBUG') ? parent::render($request, $exception) : view(config('app.exception_tpl'), ['trace' => $exception]);
return get_env('APP_DEBUG') ? parent::render($request, $exception) : view(config('app.exception_tpl'), ['trace' => $exception]);
}
}

View File

@@ -35,7 +35,7 @@ class Auth
/**
* 用户ID
*/
public int $user_id = 0;
public mixed $user_id = 0;
/**
* 用户数据
@@ -103,7 +103,7 @@ class Auth
// 禁止批量注册
$where[] = ['create_ip', '=', request()->getRealIp()];
$where[] = ['create_time', '>', linux_extime(1)];
$where[] = ['create_time', '>', linux_time(1)];
$totalMax = UserModel::where($where)->count();
if ($totalMax >= saenv('user_register_second')) {

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
namespace app\common\library;
@@ -22,7 +22,7 @@ class DataBase {
$sql = file_get_contents($sqlPath);
$sqlRecords = str_ireplace("\r", "\n", $sql);
$sqlRecords = explode(";\n", $sqlRecords);
$sqlRecords = str_replace("__PREFIX__", getenv('DATABASE_PREFIX'), $sqlRecords);
$sqlRecords = str_replace("__PREFIX__", get_env('DATABASE_PREFIX'), $sqlRecords);
foreach ($sqlRecords as $line) {
if (empty($line)) {
continue;
@@ -49,7 +49,7 @@ class DataBase {
preg_match_all($regex, file_get_contents($sqlFile), $matches);
if (isset($matches[2])) {
foreach ($matches[2] as $match) {
$tables[] = str_replace('__PREFIX__', getenv('DATABASE_PREFIX'), $match);
$tables[] = str_replace('__PREFIX__', get_env('DATABASE_PREFIX'), $match);
}
}
}

View File

@@ -5,7 +5,7 @@
* @author chenxin<chenxin619315@gmail.com>
* @date 2015-10-29
*/
declare (strict_types = 1);
namespace app\common\library;
use Exception;
defined('INDEX_BLOCK_LENGTH') or define('INDEX_BLOCK_LENGTH', 12);

View File

@@ -12,8 +12,6 @@ declare(strict_types=1);
// +----------------------------------------------------------------------
namespace app\common\library;
use Psr\SimpleCache\InvalidArgumentException;
/**
* 全局模型数据处理类
* 1、自动设置字段属性
@@ -21,7 +19,6 @@ use Psr\SimpleCache\InvalidArgumentException;
*/
class ParseData
{
/**
* 获取标题拼音
* @access public
@@ -55,7 +52,6 @@ class ParseData
return $letter;
}
/**
* 自动获取描述
* @access public
@@ -77,7 +73,7 @@ class ParseData
* @access public
* @param string $content
* @return string
* @throws InvalidArgumentException
*/
public static function setContentAttr(string $content): string
{
@@ -91,11 +87,11 @@ class ParseData
/**
* 获取内容数据
* @access public
* @param string $content
* @param $content
* @return string
* @throws InvalidArgumentException
*/
public static function getContentAttr(string $content): string
public static function getContentAttr($content): string
{
if (!empty($content)) {
@@ -114,7 +110,7 @@ class ParseData
}
}
return $content;
return $content ?? '';
}
/**
@@ -124,7 +120,7 @@ class ParseData
* @param $data
* @param bool $ready
* @return string
* @throws InvalidArgumentException
*/
public static function setImageAttr(string $image, $data, bool $ready = false): string
{
@@ -144,7 +140,7 @@ class ParseData
* @access public
* @param string $image
* @return string
* @throws InvalidArgumentException
*/
public static function getImageAttr(string $image): string
{
@@ -165,7 +161,6 @@ class ParseData
* @param string $image 图片地址
* @param bool $bool 链接OR替换
* @return string
* @throws InvalidArgumentException
*/
protected static function changeImages(string $image, bool $bool = true): string
{

View File

@@ -278,7 +278,7 @@ class Upload
try {
$this->getFileSavePath($file);
// 分片上传使用ID作为文件名
$this->resource = $this->filepath . DS . sha1($params['chunkId']) . '.' . $fileExt;
$this->resource = public_path(). $this->filepath . DS . sha1($params['chunkId']) . '.' . $fileExt;
$file->move($this->resource);
} catch (\Exception $e) {
Event::emit('uploadExceptionDelete', [

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
namespace app\common\model\system;

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
namespace app\common\model\system;

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
namespace app\common\model\system;

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
namespace app\common\model\system;

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
namespace app\common\model\system;

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
namespace app\common\model\system;
use Psr\SimpleCache\InvalidArgumentException;
@@ -80,20 +80,18 @@ class User extends Model
*/
public function getAvatarAttr(string $value, array $data): string
{
if ($value && strpos($value,'://')) {
return $value;
}
if (empty($value)) {
$value = '/static/images/user_default.jpg';
}
$prefix = cdn_Prefix();
if (!empty($prefix) && $value) {
if (!str_contains($value,'data:image')) {
if (!str_contains($value,'data:image')
&& !str_contains($value,'http')) {
return $prefix.$value;
}
} else if (empty($value)) {
$value = '/static/images/user_default.jpg';
}
return $value;

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
namespace app\common\model\system;

View File

@@ -40,5 +40,4 @@ class UserNotice extends Model
// 钩子消息推送
Event::emit('sendUserNotice', $data);
}
}

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
namespace app\common\model\system;

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
namespace app\common\model\system;

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
namespace app\common\validate\system;

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
namespace app\common\validate\system;

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
namespace app\common\validate\system;

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
namespace app\common\validate\system;

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
namespace app\common\validate\system;

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
namespace app\common\validate\system;

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
namespace app\common\validate\system;
@@ -16,7 +16,7 @@ class UploadFile extends Validate
public $rule = [
'images'=>[
'fileSize' => 419430400,
'fileExt' => 'jpg,jpeg,png,bmp,gif,svg',
'fileExt' => 'jpg,jpeg,png,bmp,gif,svg,webp',
'fileMime' => 'image/jpeg,image/png,image/gif,image/svg+xml'],
'video'=>[
'fileSize' => 419430400,

View File

@@ -43,18 +43,6 @@ if (!function_exists('hook')) {
}
}
if (!function_exists('halt')) {
/**
* 调试变量并且中断输出
* @param mixed $vars 调试变量或者信息
* @throws Exception
*/
function halt(...$vars)
{
throw new \Exception(...$vars);
}
}
/**
* @param $config
* @return string
@@ -103,7 +91,8 @@ if (!function_exists('token')) {
{
try {
return \request()->buildToken($name, $type);
} catch (\Psr\SimpleCache\InvalidArgumentException $e) {}
} catch (\Psr\SimpleCache\InvalidArgumentException $e) {
}
return '';
}
@@ -319,7 +308,6 @@ if (!function_exists('var_exports')) {
}
}
if (!function_exists('recursive_delete')) {
/**
* 递归删除目录
@@ -373,6 +361,61 @@ if (!function_exists('traverse_scanDir')) {
}
}
if (!function_exists('copydirs')) {
/**
* 复制文件夹
* @param string $source 源文件夹
* @param string $dest 目标文件夹
*/
function copydirs(string $source, string $dest)
{
if (!is_dir($dest)) {
mkdir($dest, 0755, true);
}
$handle = opendir($source);
while (($file = readdir($handle)) !== false) {
if ($file != "." && $file != "..") {
if (is_dir($source . "/" . $file)) {
copydirs($source . "/" . $file, $dest . "/" . $file);
} else {
copy($source . "/" . $file, $dest . "/" . $file);
}
}
}
closedir($handle);
}
}
if (!function_exists('remove_empty_dir')) {
/**
* 删除空目录
* @param string $dir 目录
*/
function remove_empty_dir(string $dir)
{
try {
if (is_dir($dir)) {
$handle = opendir($dir);
while (($file = readdir($handle)) !== false) {
if ($file != "." && $file != "..") {
remove_empty_dir($dir . "/" . $file);
}
}
if (!readdir($handle)) {
@rmdir($dir);
}
closedir($handle);
}
} catch (\Exception $e) {
}
}
}
// +----------------------------------------------------------------------
// | 字符串函数开始
// +----------------------------------------------------------------------
@@ -487,13 +530,7 @@ if (!function_exists('pinyin')) {
function pinyin($chinese, bool $onlyFirst = false, string $delimiter = '', bool $ucFirst = false): string
{
$pinyin = new Overtrue\Pinyin\Pinyin();
if ($onlyFirst) {
$result = $pinyin->abbr($chinese, $delimiter);
} else {
$result = $pinyin->permalink($chinese, $delimiter);
}
$result = $onlyFirst ? $pinyin->abbr($chinese, $delimiter) : $pinyin->permalink($chinese, $delimiter);
if ($ucFirst) {
$pinyinArr = explode($delimiter, $result);
$result = implode($delimiter, array_map('ucfirst', $pinyinArr));
@@ -631,9 +668,10 @@ if (!function_exists('saenv')) {
{
$redis = 'config_' . $name;
$config = Cache::get($redis);
try {
$configList = Cache::get('config_list') ?? [];
if (empty($config)) {
if (is_array($config) ? empty($config) : is_empty($config)) {
$config = Config::all($name, $group);
if (!empty($config)) {
// 是否开启分组查询
@@ -645,7 +683,9 @@ if (!function_exists('saenv')) {
Cache::set('config_list', $configList);
}
}
} catch (\Exception $e) {}
} catch (\Exception $e) {
}
return $config;
}
}
@@ -654,24 +694,21 @@ if (!function_exists('system_cache')) {
/**
* 全局缓存控制函数
* @param string $name
* @param mixed $value
* @param null $options
* @param null $tag
* @return mixed
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
function system_cache(string $name = '', $value = '', $options = null, $tag = null)
function system_cache(string $name = '', mixed $value = '', $options = null, $tag = null)
{
// 调试模式关闭缓存
if (getenv('APP_DEBUG') || !saenv('cache_status')) {
return false;
}
if (is_null($name)) {
return [];
}
if ('' === $value) {
// 获取缓存
return 0 === strpos($name, '?') ? Cache::has(substr($name, 1)) : Cache::get($name);
return str_starts_with($name, '?') ? Cache::has(substr($name, 1)) : Cache::get($name);
} elseif (is_null($value)) {
// 删除缓存
return Cache::delete($name);
@@ -760,7 +797,7 @@ if (!function_exists('list_search')) {
/**
* 从数组查找数据返回
* @param array $list 原始数据
* @param array $condition 规则['id'=>'??']
* @param mixed $condition 规则['id'=>'??']
* @return mixed
*/
function list_search(array $list, array $condition)
@@ -803,7 +840,7 @@ if (!function_exists('list_to_tree')) {
* @param int $level
* @return mixed
*/
function list_to_tree($list, string $id = 'id', string $pid = 'pid', string $child = 'children', int $level = 0) : array
function list_to_tree($list, string $id = 'id', string $pid = 'pid', string $child = 'children', int $level = 0)
{
// 创建Tree
$tree = $refer = array();
@@ -934,13 +971,13 @@ if (!function_exists('encryptPwd')) {
// +----------------------------------------------------------------------
// | 时间相关函数开始
// +----------------------------------------------------------------------
if (!function_exists('linux_extime')) {
if (!function_exists('linux_time')) {
/**
* 获取某天前时间戳
* @param $day
* @return int
*/
function linux_extime($day): int
function linux_time($day): int
{
$day = intval($day);
return mktime(23, 59, 59, intval(date("m")), intval(date("d")) - $day, intval(date("y")));
@@ -998,7 +1035,6 @@ if (!function_exists('published_date')) {
{
if (!$unix) {
$time = strtotime($time);
}
$currentTime = time() - $time;
@@ -1081,6 +1117,25 @@ if (!function_exists('check_user_third')) {
}
}
if (!function_exists('check_admin_auth')) {
/**
* 检查admin权限
* @param $method
* @return bool
*/
function check_admin_auth($method): bool
{
if (\app\admin\library\Auth::instance()->SuperAdmin()) {
return true;
}
$app = '/' . request()->app;
$pattern = '#^' . $app . '#';
$method = preg_replace($pattern, '', $method, 1);
return \app\admin\library\Auth::instance()->check($method, get_admin_id());
}
}
if (!function_exists('supplement_id')) {
/**用户ID风格
* @param string $id
@@ -1098,19 +1153,24 @@ if (!function_exists('createOrderId')) {
/**
* 生成订单号
* @param string $letter
* @param int $length
* @return string
*/
function createOrderId(string $letter = ''): string
function createOrderId(string $letter = '', int $length = 3): string
{
$gradual = 0;
$orderId = date('YmdHis') . mt_rand(10000000, 99999999);
$length = strlen($orderId);
$lengths = strlen($orderId);
// 循环处理随机数
for ($i = 0; $i < $length; $i++) {
for ($i = 0; $i < $lengths; $i++) {
$gradual += (int)(substr($orderId, $i, 1));
}
if (empty($letter)) {
$letter = get_order_letter($length);
}
$code = (100 - $gradual % 100) % 100;
return $letter . $orderId . str_pad((string)$code, 2, '0', STR_PAD_LEFT);
}
@@ -1120,14 +1180,35 @@ if (!function_exists('createOrderShortId')) {
/**
* 生成订单短ID
* @param string $letter
* @param int $length
* @return string
*/
function createOrderShortId(string $letter = ''): string
function createOrderShortId(string $letter = '', int $length = 5): string
{
return $letter . date('Ymd') . substr(implode('', array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 8);
if (empty($letter)) {
$letter = get_order_letter($length);
}
return $letter . date('Ymd') . substr(implode('', array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 12);
}
}
if (!function_exists('get_order_letter')) {
/**
* 生成订单短ID
* @param int $length
* @return string
*/
function get_order_letter(int $length = 2): string
{
$letter_all = range('A', 'Z');
shuffle($letter_all);
$letter_array = array_diff($letter_all, ['I', 'O']);
$letter = array_rand(array_flip($letter_array), $length);
return implode('', $letter);
}
}
if (!function_exists('distance_day')) {
/**
* 计算天数
@@ -1204,7 +1285,7 @@ if (!function_exists('plugin_path')) {
* @param string $string
* @return string
*/
function plugin_path(string $string = ''): string
function plugin_path(string $string = '')
{
return $string ? root_path('plugin' . DIRECTORY_SEPARATOR . $string) : root_path('plugin');
}
@@ -1293,61 +1374,6 @@ if (!function_exists('get_plugin_list')) {
}
}
if (!function_exists('copydirs')) {
/**
* 复制文件夹
* @param string $source 源文件夹
* @param string $dest 目标文件夹
*/
function copydirs(string $source, string $dest)
{
if (!is_dir($dest)) {
mkdir($dest, 0755, true);
}
$handle = opendir($source);
while (($file = readdir($handle)) !== false) {
if ($file != "." && $file != "..") {
if (is_dir($source . "/" . $file)) {
copydirs($source . "/" . $file, $dest . "/" . $file);
} else {
copy($source . "/" . $file, $dest . "/" . $file);
}
}
}
closedir($handle);
}
}
if (!function_exists('remove_empty_dir')) {
/**
* 删除空目录
* @param string $dir 目录
*/
function remove_empty_dir(string $dir)
{
try {
if (is_dir($dir)) {
$handle = opendir($dir);
while (($file = readdir($handle)) !== false) {
if ($file != "." && $file != "..") {
remove_empty_dir($dir . "/" . $file);
}
}
if (!readdir($handle)) {
@rmdir($dir);
}
closedir($handle);
}
} catch (\Exception $e) {
}
}
}
if (!function_exists('get_plugin_config')) {
/**
* 获取插件配置
@@ -1360,7 +1386,7 @@ if (!function_exists('get_plugin_config')) {
{
$array = [];
$cache = sha1('PLUGIN_' . $name);
if (!$force || !getenv('APP_DEBUG')) {
if (!$force || !get_env('APP_DEBUG')) {
if ($array = Cache::get($cache)) {
return $array;
}

View File

@@ -1,5 +1,5 @@
<?php
declare (strict_types = 1);
// +----------------------------------------------------------------------
// | swiftAdmin 极速开发框架 [基于WebMan开发]
// +----------------------------------------------------------------------

View File

@@ -30,6 +30,13 @@ class Index extends HomeController
*/
public function index(): Response
{
$data = [
'欢迎使用swiftAdmin极速开发框架',
__DIR__.'\Index.php 正在使用halt函数输出到浏览器',
'请在app\index\controller\Index.php中删除halt函数',
];
halt($data);
return $this->view('index/index', ['name' => 'meystack']);
}
}

View File

@@ -21,7 +21,7 @@
<p>SwiftAdmin框架主张简单就是高效的原则在设计和运维上采用最精简最高效的做法去完成业务系统的需求并且基于ant Design的设计原则是一款优秀的前后台极速开发解决方案。相信你第一眼就有立刻想体验SwiftAdmin框架的冲动和热情</p>
<div class="layui-swift-desc">
<a href="#" onclick="javascript:layui.layer.msg('基于高性能WebMan');return false;" target="_blank">
<img src="https://badgen.net/badge/WebMan/1.4LTS/red" alt="WebMan">
<img src="https://badgen.net/badge/WebMan/1LTS/red" alt="WebMan">
</a>
<a href="#" onclick="javascript:layui.layer.msg('前端采用Layui经典规范');return false;" target="_blank">
<img src="https://badgen.net/badge/layui/2DEV/" alt="layui">

View File

@@ -42,7 +42,7 @@
<input name="captcha" placeholder="{:__('请输入验证码')}" type="text" class="layui-input" autocomplete="off" lay-verify="required" maxlength="10"/>
</div>
<button id="send" class="layui-btn layui-btn-normal" type="button"
lay-ajax data-url="/ajax/smssend" data-object="mobile:string,event:event">{:__('获取')}
lay-ajax data-url="/ajax/smsSend" data-object="mobile:string,event:event">{:__('获取')}
</button>
</div>
<div class="layui-form-item">
@@ -73,7 +73,7 @@
if (regx.test(val)) {
string.attr('name','mobile');
send.attr('data-object','mobile:string,event:event');
send.attr('data-url','/ajax/smssend');
send.attr('data-url','/ajax/smsSend');
} else {
string.attr('name','email');
send.attr('data-object','email:string,event:event');

View File

@@ -57,7 +57,7 @@
<input type="text" name="captcha" placeholder="{:__('验证码')}" class="layui-input captcha">
<div class="captcha fr">
<button id="captcha" type="button" class="layui-btn layui-btn-normal"
lay-ajax data-url="/ajax/smssend" data-object="mobile:mobile,event:event"
lay-ajax data-url="/ajax/smsSend" data-object="mobile:mobile,event:event"
>获取验证码
</button>
</div>

View File

@@ -13,7 +13,7 @@ DATABASE_DEBUG = 0
CACHE_DRIVER = file
CACHE_HOSTNAME = 127.0.0.1
CACHE_HOSTPORT = 6379
CACHE_SELECT = 1
CACHE_SELECT = 3
CACHE_USERNAME =
CACHE_PASSWORD =
LANG_DEFAULT_LANG = zh-CN

View File

@@ -11,7 +11,7 @@
Target Server Version : 50738
File Encoding : 65001
Date: 19/12/2022 19:20:36
Date: 25/04/2023 20:00:37
*/
SET NAMES utf8mb4;
@@ -51,13 +51,13 @@ CREATE TABLE `__PREFIX__admin` (
INDEX `id`(`id`) USING BTREE,
INDEX `name`(`name`) USING BTREE,
INDEX `pwd`(`pwd`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '后台管理员表' ROW_FORMAT = DYNAMIC;
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '后台管理员表' ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of __PREFIX__admin
-- ----------------------------
INSERT INTO `__PREFIX__admin` VALUES (1, '1', '2', '3', 'admin', 'meystack', '13682bec405cf4b9002e6e8306312ce6', 1, 'a:3:{i:0;s:12:\"测试效果\";i:1;s:15:\"隔壁帅小伙\";i:2;s:9:\"技术宅\";}', '/upload/avatars/f8e34ec67a2a0233_100x100.jpg', '海阔天空,有容乃大', 'admin@swiftadmin.net', '0310', '15188888888', '高级管理人员', 371, '河北省邯郸市', '127.0.0.1', 1671360587, '3232254977', 1, NULL, 1596682835, 1671360587, NULL);
INSERT INTO `__PREFIX__admin` VALUES (2, '2', '4', '5,6', 'ceshi', '测试用户', '13682bec405cf4b9002e6e8306312ce6', 1, 'a:3:{i:0;s:6:\"呵呵\";i:1;s:5:\"Think\";i:2;s:12:\"铁血柔肠\";}', '/upload/avatars/a0b923820dcc509a_100x100.png', 'PHP是全世界最好的语言', 'baimei@your.com', '0310', '15188888888', '我原本以为吕布已经天下无敌了,没想到还有比吕布勇猛的,这谁的部将?', 56, '河北省邯郸市廉颇大道110号指挥中心', '127.0.0.1', 1669816238, '3232254977', 1, '违规', 1609836672, 1669816238, NULL);
INSERT INTO `__PREFIX__admin` VALUES (1, '1', '2', '3', 'admin', '超级管理员', '13682bec405cf4b9002e6e8306312ce6', 1, 'a:3:{i:0;s:12:\"测试效果\";i:1;s:15:\"隔壁帅小伙\";i:2;s:9:\"技术宅\";}', '/upload/avatars/f8e34ec67a2a0233_100x100.jpg', '海阔天空,有容乃大', 'admin@swiftadmin.net', '0310', '15188888888', '高级管理人员', 391, '河北省邯郸市', '127.0.0.1', 1682411837, '3232254977', 1, NULL, 1596682835, 1682411837, NULL);
INSERT INTO `__PREFIX__admin` VALUES (2, '2', '4', '5,6', 'ceshi', '测试用户', '13682bec405cf4b9002e6e8306312ce6', 1, 'a:3:{i:0;s:6:\"呵呵\";i:1;s:5:\"Think\";i:2;s:12:\"铁血柔肠\";}', '/upload/avatars/a0b923820dcc509a_100x100.png', 'PHP是全世界最好的语言', 'baimei@your.com', '0310', '15188888888', '我原本以为吕布已经天下无敌了,没想到还有比吕布勇猛的,这谁的部将?', 57, '河北省邯郸市廉颇大道110号指挥中心', '127.0.0.1', 1682221728, '3232254977', 1, '违规', 1609836672, 1682221728, NULL);
-- ----------------------------
-- Table structure for __PREFIX__admin_access
@@ -75,8 +75,9 @@ CREATE TABLE `__PREFIX__admin_access` (
-- ----------------------------
-- Records of __PREFIX__admin_access
-- ----------------------------
INSERT INTO `__PREFIX__admin_access` VALUES (1, '1', NULL, NULL);
INSERT INTO `__PREFIX__admin_access` VALUES (2, '2', '5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,115,116,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,85,86,87,88,89,90,91,92,93,100,101,102,103,104,105,106,107,108,109,110,111,112', '8');
INSERT INTO `__PREFIX__admin_access` VALUES (1, '1', '5,11,12,13,15,16,17,18,19,20,21,22,23,24,25,26,115,116', NULL);
INSERT INTO `__PREFIX__admin_access` VALUES (2, '2', '5,11,12,13,15,16,17,18,19,20,21,22,23,24,25,26,115,116', '8');
INSERT INTO `__PREFIX__admin_access` VALUES (3, '1', NULL, NULL);
-- ----------------------------
-- Table structure for __PREFIX__admin_group
@@ -102,8 +103,8 @@ CREATE TABLE `__PREFIX__admin_group` (
-- ----------------------------
-- Records of __PREFIX__admin_group
-- ----------------------------
INSERT INTO `__PREFIX__admin_group` VALUES (1, 0, 1, '超级管理员', 'admin', 1, 1, '网站超级管理员组的', NULL, NULL, 'layui-bg-blue', 1607832158, NULL);
INSERT INTO `__PREFIX__admin_group` VALUES (2, 1, 2, '网站编辑', 'editor', 1, 1, '负责公司软文的编写', '55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84', '5', 'layui-bg-cyan', 1607832158, NULL);
INSERT INTO `__PREFIX__admin_group` VALUES (1, 0, 1, '超级管理员', 'admin', 1, 1, '网站超级管理员组的', '100,107,108,109,110,111,112', NULL, 'layui-bg-blue', 1607832158, NULL);
INSERT INTO `__PREFIX__admin_group` VALUES (2, 1, 2, '网站编辑', 'editor', 1, 1, '负责公司软文的编写', '', '5', 'layui-bg-cyan', 1607832158, NULL);
-- ----------------------------
-- Table structure for __PREFIX__admin_log
@@ -181,7 +182,7 @@ CREATE TABLE `__PREFIX__admin_rules` (
PRIMARY KEY (`id`) USING BTREE,
INDEX `id`(`id`) USING BTREE,
INDEX `sort`(`sort`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1682 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '菜单权限表' ROW_FORMAT = DYNAMIC;
) ENGINE = InnoDB AUTO_INCREMENT = 123 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '菜单权限表' ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of __PREFIX__admin_rules
@@ -399,7 +400,7 @@ INSERT INTO `__PREFIX__config` VALUES (22, 'cache_type', 0, 'cache', 'string', '
INSERT INTO `__PREFIX__config` VALUES (23, 'cache_time', 0, 'cache', 'string', '6000', '缓存时间');
INSERT INTO `__PREFIX__config` VALUES (24, 'cache_host', 0, 'cache', 'string', '127.0.0.1', '服务器IP');
INSERT INTO `__PREFIX__config` VALUES (25, 'cache_port', 0, 'cache', 'string', '6379', '端口');
INSERT INTO `__PREFIX__config` VALUES (26, 'cache_select', 0, 'cache', 'string', '1', '缓存数据库');
INSERT INTO `__PREFIX__config` VALUES (26, 'cache_select', 0, 'cache', 'string', '2', '缓存数据库');
INSERT INTO `__PREFIX__config` VALUES (27, 'cache_user', 0, 'cache', 'string', '', '用户名');
INSERT INTO `__PREFIX__config` VALUES (28, 'cache_pass', 0, 'cache', 'string', '', '密码');
INSERT INTO `__PREFIX__config` VALUES (29, 'upload_path', 0, 'upload', 'string', 'upload', '上传路径');
@@ -426,8 +427,8 @@ INSERT INTO `__PREFIX__config` VALUES (49, 'upload_water_img', 0, 'upload', 'str
INSERT INTO `__PREFIX__config` VALUES (50, 'upload_water_pos', 0, 'upload', 'string', '9', '水印位置');
INSERT INTO `__PREFIX__config` VALUES (51, 'play', 0, NULL, 'array', '{\"play_width\":\"960\",\"play_height\":\"450\",\"play_show\":\"0\",\"play_second\":\"10\",\"play_area\":\"大陆,香港,中国台湾,美国,韩国,日本,泰国,印度,英国,法国,俄罗斯,新加坡,其它\",\"play_year\":\"2022,2021,2020,2019,2018,2017,2016,2015,2014,2013,2012,2011,2010,2009,2008,2007,2006,2005,2004,2003,2002,2001,2000,1999\",\"play_version\":\"高清版,剧场版,抢先版,OVA,TV,影院版\",\"play_language\":\"国语,英语,粤语,韩语,日语,法语,德语,泰语,俄语,其它\",\"play_week\":\"周一,周二,周三,周四,周五,周六,周日\",\"play_playad\":\"http:\\/\\/www.swiftadmin.net\\/api\\/show.html\",\"play_down\":\"http:\\/\\/www.swiftadmin.net\\/api\\/show.html\",\"play_downgorup\":\"http:\\/\\/down.swiftadmin.net\\/\"}', '播放器数据');
INSERT INTO `__PREFIX__config` VALUES (52, 'cloud_status', 0, NULL, 'string', '0', '是否开启OSS上传');
INSERT INTO `__PREFIX__config` VALUES (53, 'cloud_type', 0, NULL, 'string', 'aliyun_oss', 'OSS上传类型');
INSERT INTO `__PREFIX__config` VALUES (54, 'aliyun_oss', 0, NULL, 'array', '{\"accessId\":\"LTAI5tR*****nVMe1vC\",\"accessSecret\":\"knwIiD8rINV********3ysvbU0pk\",\"bucket\":\"bucket\",\"endpoint\":\"oss-cn-beijing.aliyuncs.com\",\"url\":\"http:\\/\\/oss-cn-beijing.aliyuncs.com\"}', '阿里云OSS');
INSERT INTO `__PREFIX__config` VALUES (53, 'cloud_type', 0, NULL, 'string', 'qcloud_oss', 'OSS上传类型');
INSERT INTO `__PREFIX__config` VALUES (54, 'aliyun_oss', 0, NULL, 'array', '{\"accessId\":\"LTAI5tD8a1uQrge6836nfdtH\",\"accessSecret\":\"DUQNpLVvzyY\",\"bucket\":\"bucket\",\"endpoint\":\"oss-cn-beijing.aliyuncs.com\",\"url\":\"http:\\/\\/oss-cn-beijing.aliyuncs.com\"}', '阿里云OSS');
INSERT INTO `__PREFIX__config` VALUES (55, 'qcloud_oss', 0, NULL, 'array', '{\"app_id\":\"1252296528\",\"secret_id\":\"LTAI5333k*****NnVMe1vC\",\"secret_key\":\"kFStrm******aJdocxsSScjRt9A\",\"bucket\":\"testpack\",\"region\":\"ap-beijing\",\"url\":\"\"}', '腾讯云OSS');
INSERT INTO `__PREFIX__config` VALUES (56, 'email', 0, NULL, 'array', '{\"smtp_debug\":\"0\",\"smtp_host\":\"smtp.163.com\",\"smtp_port\":\"587\",\"smtp_name\":\"管理员\",\"smtp_user\":\"domain@163.com\",\"smtp_pass\":\"KNWSGPUYBMFATCIZ\",\"smtp_test\":\"youremail@foxmail.com\"}', '邮箱配置');
INSERT INTO `__PREFIX__config` VALUES (57, 'qq', 0, NULL, 'array', '{\"app_id\":\"\",\"app_key\":\"\",\"callback\":\"\"}', 'QQ登录');
@@ -441,7 +442,7 @@ INSERT INTO `__PREFIX__config` VALUES (64, 'alisms', 0, NULL, 'array', '{\"app_i
INSERT INTO `__PREFIX__config` VALUES (65, 'tensms', 0, NULL, 'array', '{\"app_id\":\"150****8888\",\"app_sign\":\"河北*****有限公司\",\"secret_id\":\"kFStrmkXjHjw9sankaJdoIXXSScjRt9A\",\"secret_key\":\"kFStrmkXjHjw9sankaJdoIXXSScjRt9A\"}', '腾讯云短信');
INSERT INTO `__PREFIX__config` VALUES (66, 'mpwechat', 0, NULL, 'array', '{\"app_id\":\"wx********\",\"secret\":\"3d9****2\",\"token\":\"M1qhe****utsreGp6PS\",\"aes_key\":\"wxd****4\"}', '微信公众号');
INSERT INTO `__PREFIX__config` VALUES (67, 'user_status', 0, 'user', 'string', '1', '注册状态');
INSERT INTO `__PREFIX__config` VALUES (68, 'user_register', 0, 'user', 'string', 'mobile', '注册方式');
INSERT INTO `__PREFIX__config` VALUES (68, 'user_register', 0, 'user', 'string', 'normal', '注册方式');
INSERT INTO `__PREFIX__config` VALUES (69, 'user_document', 0, 'user', 'string', '1', '用户投稿');
INSERT INTO `__PREFIX__config` VALUES (70, 'user_sensitive', 0, 'user', 'string', '1', '开启违禁词检测');
INSERT INTO `__PREFIX__config` VALUES (71, 'user_document_integra', 0, 'user', 'string', '1', '投稿获得积分');
@@ -462,7 +463,7 @@ INSERT INTO `__PREFIX__config` VALUES (85, 'rewrite', 0, NULL, 'string', '', 'UR
INSERT INTO `__PREFIX__config` VALUES (86, 'database', 0, NULL, 'string', '', '数据库维护');
INSERT INTO `__PREFIX__config` VALUES (87, 'variable', 0, NULL, 'array', '{\"test\":\"我是值2\",\"ceshi\":\"我是测试变量的值\"}', '自定义变量');
INSERT INTO `__PREFIX__config` VALUES (88, 'param', 0, NULL, 'string', '', '测试代码');
INSERT INTO `__PREFIX__config` VALUES (89, 'full_status', 0, NULL, 'string', '1', '全文检索');
INSERT INTO `__PREFIX__config` VALUES (89, 'full_status', 0, NULL, 'string', '0', '全文检索');
INSERT INTO `__PREFIX__config` VALUES (90, 'editor', 0, NULL, 'string', 'lay-editor', '编辑器选项');
INSERT INTO `__PREFIX__config` VALUES (91, 'minify_page', 0, NULL, 'string', '0', '模板mini压缩');
@@ -520,14 +521,14 @@ CREATE TABLE `__PREFIX__dictionary` (
-- ----------------------------
-- Records of __PREFIX__dictionary
-- ----------------------------
INSERT INTO `__PREFIX__dictionary` VALUES (1, 0, '内容属2', 'content', 1, '', 1, 1669805492, 1637738903, NULL);
INSERT INTO `__PREFIX__dictionary` VALUES (1, 0, '内容属性', 'content', 1, '', 1, 1682217587, 1637738903, NULL);
INSERT INTO `__PREFIX__dictionary` VALUES (2, 1, '头条', '1', 2, '', 1, 1669690446, 1638093403, NULL);
INSERT INTO `__PREFIX__dictionary` VALUES (3, 1, '推荐', '2', 3, '', 1, 1669690444, 1638093425, NULL);
INSERT INTO `__PREFIX__dictionary` VALUES (4, 1, '幻灯', '3', 4, '', 1, 1669690440, 1638093430, NULL);
INSERT INTO `__PREFIX__dictionary` VALUES (5, 1, '滚动', '4', 5, '', 1, 1669690442, 1638093435, NULL);
INSERT INTO `__PREFIX__dictionary` VALUES (6, 1, '图文', '5', 6, '', 1, 1638093456, 1638093456, NULL);
INSERT INTO `__PREFIX__dictionary` VALUES (7, 1, '跳转', '6', 7, '', 1, 1638093435, 1638093435, NULL);
INSERT INTO `__PREFIX__dictionary` VALUES (8, 0, '友链2类型', 'friendlink', 8, '', 1, 1669805499, 1638093456, NULL);
INSERT INTO `__PREFIX__dictionary` VALUES (8, 0, '友链类型', 'friendlink', 8, '', 1, 1682217595, 1638093456, NULL);
INSERT INTO `__PREFIX__dictionary` VALUES (9, 8, '资源', '1', 9, '', 1, 1638093430, 1638093430, NULL);
INSERT INTO `__PREFIX__dictionary` VALUES (10, 8, '社区', '2', 10, '', 1, 1638093435, 1638093435, NULL);
INSERT INTO `__PREFIX__dictionary` VALUES (11, 8, '合作伙伴', '3', 11, '', 1, 1659450310, 1638093456, NULL);
@@ -645,13 +646,12 @@ CREATE TABLE `__PREFIX__user` (
INDEX `create_time`(`create_time`) USING BTREE,
INDEX `login_time`(`login_time`) USING BTREE,
INDEX `invite_id`(`invite_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '会员管理' ROW_FORMAT = DYNAMIC;
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '会员管理' ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of __PREFIX__user
-- ----------------------------
INSERT INTO `__PREFIX__user` VALUES (1, 1, 'aa', '513bd12b00b512d0b879962b777b5560', 'wdONQC', NULL, NULL, '/upload/avatars/a0b923820dcc509a_100x100.png', '这个人很懒,什么都没有留下~ ', 'test@swiftadmin.net', NULL, '林自图', 0, '2022-11-04 20:04:55', '15253325632533', '河北省邯郸市中华区人民东路023号', '', 0, 100, 1983.56, '你的幸运数字是?', 'aa', 1, 1, 10001, 'xDqmQGyBNUlwRXtkKPVCiM', NULL, NULL, NULL, NULL, NULL, NULL, 1, '127.0.0.1', 1670750078, 160, NULL, '1861775580', 1657332918, NULL);
INSERT INTO `__PREFIX__user` VALUES (2, 1, 'faker', '513bd12b00b512d0b879962b777b5560', 'wdONQC', NULL, NULL, '/upload/avatars/a0b923820dcc509a_100x100.png', '这个人很懒,什么都没有留下~ ', 'test@swiftadmin.net', NULL, NULL, 0, NULL, NULL, '河北省邯郸市中华区人民东路023号', NULL, 0, 100, NULL, '你家的宠物叫啥?', '23', 1, 1, 10001, 'lLtSvJGyFQCVuTdjRIhqza', NULL, NULL, NULL, NULL, NULL, NULL, 1, '23.21.25.23', 1662098397, 131, NULL, '1861775580', 1657332918, NULL);
INSERT INTO `__PREFIX__user` VALUES (1, 1, '创始人', '513bd12b00b512d0b879962b777b5560', 'wdONQC', NULL, NULL, '/upload/avatars/a0b923820dcc509a_100x100.png', '这个人很懒,什么都没有留下~ ', 'test@swiftadmin.net', NULL, '林自图', 0, '2022-11-04 20:04:55', '15253325632533', '河北省邯郸市中华区人民东路023号', '', 0, 100, 1983.56, '你的幸运数字是?', 'aa', 1, 1, 10001, 'myKDalrGjpEVxWPQcXzwFu', NULL, NULL, NULL, NULL, NULL, NULL, 1, '127.0.0.1', 1682390408, 162, NULL, '1861775580', 1657332918, NULL);
-- ----------------------------
-- Table structure for __PREFIX__user_group
@@ -698,7 +698,7 @@ CREATE TABLE `__PREFIX__user_log` (
`create_time` int(11) NULL DEFAULT NULL COMMENT '登录时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `user_ip`(`login_ip`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户登录记录表' ROW_FORMAT = DYNAMIC;
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户记录表' ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of __PREFIX__user_log

View File

@@ -28,29 +28,26 @@
"php": ">=8.0",
"psr/container": "1.1.1",
"monolog/monolog": "^2.0",
"workerman/webman-framework": "1.4.7",
"workerman/webman-framework": "1.5.5",
"webman/think-orm": "^1.0",
"webman/redis-queue": "^1.2",
"webman/think-cache": "^1.0",
"webman/console": "1.2.12",
"webman/console": "1.2.33",
"webman/event": "^1.0",
"webman/captcha": "^1.0",
"webman/gateway-worker": "^1.0",
"topthink/think-validate": "^2.0",
"topthink/think-template": "^2.0",
"topthink/think-image": "^1.0",
"gregwar/captcha": "1.*",
"vlucas/phpdotenv": "^5.4",
"phpmailer/phpmailer": "^6.6",
"guzzlehttp/guzzle": "^7.4",
"symfony/translation": "^5.4",
"overtrue/pinyin": "^4.0",
"symfony/var-dumper": "^6.0",
"endroid/qr-code": "^4.3",
"php-di/php-di": "^6.4",
"yansongda/pay": "~3.1.0",
"overtrue/wechat": "~5.0",
"ext-json": "*",
"ext-zip": "*",
"ext-posix": "*"
"overtrue/pinyin": "5.0",
"phpoffice/phpspreadsheet": "^1.28"
},
"suggest": {
"ext-event": "For better performance. "

1972
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -16,7 +16,7 @@ use support\Request;
return [
'debug' => getenv('APP_DEBUG') ?: false,
'debug' => get_env('APP_DEBUG') ?: false,
'support_php_files' => false,
'controller_reuse' => true,
'default_timezone' => 'Asia/Shanghai',
@@ -38,7 +38,7 @@ return [
'dispatch_success' => app_path() . '/admin/view/public/jumptpl.html',
'exception_tpl' => app_path() . '/admin/view/error/500.html',
'error_message' => '页面错误!请稍后再试~',
'version' => 'v1.1.5',
'version' => 'v1.1.6',
'cors_domain' => ['*', '127.0.0.1'],
'api_url' => 'https://api.swiftadmin.net/',
'show_error_msg' => false,

View File

@@ -12,6 +12,8 @@
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use app\common\exception\ExceptionHandle;
return [
'' => \app\common\exception\ExceptionHandle::class,
'' => ExceptionHandle::class,
];

View File

@@ -15,7 +15,7 @@
return [
'default' => [
'host' => '127.0.0.1',
'password' => getenv('REDIS_PASSWORD'),
'password' => get_env('REDIS_PASSWORD'),
'port' => 6379,
'database' => 1,
],

View File

@@ -59,14 +59,21 @@ Route::any('/static/system/js/plugin.js', function () {
* @var array $response
*/
Route::fallback(function ($request) {
$pathInfo = parse_url(request()->url());
if (!isset($pathInfo['path'])) {
$parseApp = ['index'];
} elseif ($pathInfo['path'] == '/') {
// 默认应用路由
return redirect('/index');
} else {
$parseApp = explode('/', ltrim($pathInfo['path'], '/'));
}
// 判断是否为API接口
if ($request->expectsJson()) {
return json(['code' => 404, 'msg' => '404 not found']);
}
return response(request_error(current($parseApp)), 404);
});

View File

@@ -13,17 +13,17 @@
*/
return [
'type' => getenv('CACHE_DRIVER') ?: 'file', // or redis or redis_cluster
'handler' => getenv('CACHE_DRIVER') == 'redis' ? Webman\Session\RedisSessionHandler::class : Webman\Session\FileSessionHandler::class,
'type' => get_env('CACHE_DRIVER') ?: 'file', // or redis or redis_cluster
'handler' => get_env('CACHE_DRIVER') == 'redis' ? Webman\Session\RedisSessionHandler::class : Webman\Session\FileSessionHandler::class,
'config' => [
'file' => [
'save_path' => runtime_path() . '/sessions',
],
'redis' => [
'host' => getenv('CACHE_HOSTNAME') ?: '127.0.0.1',
'port' => getenv('CACHE_HOSTPORT') ?: 6379,
'database' => getenv('CACHE_SELECT') ?: 0,
'auth' => getenv('CACHE_PASSWORD') ?: '',
'host' => get_env('CACHE_HOSTNAME') ?: '127.0.0.1',
'port' => get_env('CACHE_HOSTPORT') ?: 6379,
'database' => get_env('CACHE_SELECT') ?: 0,
'auth' => get_env('CACHE_PASSWORD') ?: '',
'prefix' => '', // session key prefix
],
'redis_cluster' => [

View File

@@ -1,6 +1,6 @@
<?php
return [
'default' => getenv('CACHE_DRIVER') ?: 'file',
'default' => get_env('CACHE_DRIVER') ?: 'file',
'stores' => [
'file' => [
'type' => 'File',
@@ -13,10 +13,10 @@ return [
],
'redis' => [
'type' => 'redis',
'host' => getenv('CACHE_HOSTNAME') ?: '127.0.0.1',
'port' => getenv('CACHE_HOSTPORT') ?: 6379,
'select' => getenv('CACHE_SELECT') ?: 0,
'password' => getenv('CACHE_PASSWORD') ?: '',
'host' => get_env('CACHE_HOSTNAME') ?: '127.0.0.1',
'port' => get_env('CACHE_HOSTPORT') ?: 6379,
'select' => get_env('CACHE_SELECT') ?: 0,
'password' => get_env('CACHE_PASSWORD') ?: '',
'prefix' => 'redis_',
'expire' => 0,
],

View File

@@ -7,21 +7,21 @@ return [
// 数据库类型
'type' => 'mysql',
// 服务器地址
'hostname' => getenv('DATABASE_HOSTNAME') ?: '127.0.0.1',
'hostname' => get_env('DATABASE_HOSTNAME') ?: '127.0.0.1',
// 数据库名
'database' => getenv('DATABASE_DATABASE') ?: 'swiftadmin',
'database' => get_env('DATABASE_DATABASE') ?: 'swiftadmin',
// 数据库用户名
'username' => getenv('DATABASE_USERNAME') ?: 'root',
'username' => get_env('DATABASE_USERNAME') ?: 'root',
// 数据库密码
'password' => getenv('DATABASE_PASSWORD') ?: '123456',
'password' => get_env('DATABASE_PASSWORD') ?: '123456',
// 数据库连接端口
'hostport' => getenv('DATABASE_HOSTPORT') ?: '3306',
'hostport' => get_env('DATABASE_HOSTPORT') ?: '3306',
// 数据库连接参数
'params' => [],
// 数据库编码默认采用utf8
'charset' => getenv('DATABASE_CHARSET') ?: 'utf8mb4',
'charset' => get_env('DATABASE_CHARSET') ?: 'utf8mb4',
// 数据库表前缀
'prefix' => getenv('DATABASE_PREFIX') ?: 'sa_',
'prefix' => get_env('DATABASE_PREFIX') ?: 'sa_',
// 断线重连
'break_reconnect' => true,
// 关闭SQL监听日志

View File

@@ -17,7 +17,7 @@
*/
return [
// Default language
'locale' => getenv('LANG_DEFAULT_LANG') ?? 'zh-CN',
'locale' => get_env('LANG_DEFAULT_LANG') ?? 'zh-CN',
// Fallback language
'fallback_locale' => ['zh-CN', 'en-US'],
// Folder where language files are stored

View File

@@ -52,7 +52,7 @@ class gitee
{
$state = hash('sha256',uniqid((string)mt_rand()));
session('state', $state);
$queryarr = array(
$queryArr = array(
"response_type" => "code",
"client_id" => $this->config['app_id'],
"redirect_uri" => $this->config['callback'],
@@ -60,9 +60,8 @@ class gitee
"state" => $state,
);
request()->isMobile() && $queryarr['display'] = 'mobile';
$url = self::GET_AUTH_CODE_URL . '?' . http_build_query($queryarr);
return $url;
request()->isMobile() && $queryArr['display'] = 'mobile';
return self::GET_AUTH_CODE_URL . '?' . http_build_query($queryArr);
}
/**
@@ -79,9 +78,9 @@ class gitee
// 获取access_token
$data = isset($params['code']) ? $this->getAccessToken($params['code']) : $params;
$access_token = isset($data['access_token']) ? $data['access_token'] : '';
$refresh_token = isset($data['refresh_token']) ? $data['refresh_token'] : '';
$expires_in = isset($data['expires_in']) ? $data['expires_in'] : 0;
$access_token = $data['access_token'] ?? '';
$refresh_token = $data['refresh_token'] ?? '';
$expires_in = $data['expires_in'] ?? 0;
if ($access_token) {
// 获取用户信息

View File

@@ -580,10 +580,10 @@ a[lay-event="del"] {
#content #cardInfoList .cardInfoUsers li {
display: inline-block;
width: 92px;
width: 89px;
text-align: center;
overflow: hidden;
margin: 2px 0px;
margin: 2px 0;
}
#content #cardInfoList .cardInfoUsers li img.media-object {
@@ -792,14 +792,13 @@ a[lay-event="del"] {
}
#content .vip-coupon-row {
overflow: auto;
overflow: hidden;
white-space: nowrap;
}
#content .vip-coupon-item {
padding: 0 10px;
margin-top: 20px;
padding-right: 15px;
padding: 0 15px 0 10px;
display: inline-block;
border-right: 1px solid rgba(0,0,0,.16);
}

View File

@@ -739,7 +739,6 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form', 'rate', 'table', 'sl
}
}
if (res.code === 200) {
switch (reload) {
@@ -754,10 +753,17 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form', 'rate', 'table', 'sl
break;
default:
}
try {
tableThis ?
tableThis.update(JSON.parse(JSON.stringify(post.field))) :
table.reloadData("lay-tableList");
} catch (error) {
/**
* 如果使用第三方组件在table显示或元素为DIY数据结构
* 则在这里可能会出现错误这里不做处理如果有需求可自行在页面实现数据回显到table行的逻辑
*/
layer.info(error);
}
layer.msg(res.msg);
admin.event.closeDialog(othat);
} else {
@@ -1135,7 +1141,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form', 'rate', 'table', 'sl
callback = $(elem).attr('callback') || undefined,
blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;
var uploadFiles = {
let uploadFiles = {
normal: function (res, name) {
$('input.' + name).prop('value', res.url);
$('img.' + name).prop('src', res.url);
@@ -1148,7 +1154,6 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form', 'rate', 'table', 'sl
$(elem).find('p,i,hr').addClass('layui-hide');
},
multiple: function (res, name) {
let boxList = $(that).parents('.layui-imagesbox').find('.layui-input-inline');
let length = boxList.length;
$(this).parents('form').find('input#' + name + '_clear').remove();
@@ -1162,7 +1167,6 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form', 'rate', 'table', 'sl
html += '<input type="text" name="' + name + '[' + (length - 1) + '][title]" class="layui-input" placeholder="图片简介">';
html += '<span class="layui-badge layui-badge-red" onclick="layui.$(this).parent().remove();">删除</span></div>';
$(elem).parent().before(html);
}
}
@@ -1250,16 +1254,10 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form', 'rate', 'table', 'sl
that.prop("disabled", true);
}, done: function (res, indexObj, fileObj) {
that.prop("disabled", false);
if (typeof callback != 'undefined') {
return admin.callbackfunc(this.item, {res: res, index: indexObj, file: fileObj});
}
/**
* 处理分片回调
*/
if (typeof res.index != 'undefined'
&& typeof res.chunkId != 'undefined') {
if (typeof res.index != 'undefined' && typeof res.chunkId != 'undefined') {
if (res.code !== 200) {
layer.closeAll();
@@ -1318,12 +1316,18 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form', 'rate', 'table', 'sl
return false;
}
if (res.code === 200 && res.url) {
that.prop("disabled", false);
// 关闭分片上传进度条
if (typeof res.chunkId !== 'undefined') {
layer.close(window[res.chunkId]);
}
// 执行自定义回调
if (typeof callback != 'undefined') {
return admin.callbackfunc(this.item, {res: res, index: indexObj, file: fileObj});
} else if (res.code === 200) {
layer.msg(res.msg);
// 执行默认上传成功回调
uploadFiles[type](res, name);
} else {
layer.error(res.msg);
@@ -1481,7 +1485,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form', 'rate', 'table', 'sl
form.on('radio(radioStatus)', function (data) {
var display = $(this).data('display');
if (display != null && display !== 'undefined') {
(data.value === 1) ? $('.' + display).show() : $('.' + display).hide();
(data.value == 1) ? $('.' + display).show() : $('.' + display).hide();
}
})

View File

@@ -20,13 +20,14 @@ class Template extends ThinkPHP
* @param string $template
* @param array $vars
* @param string|null $app
* @return array|false|string|string[]|null
* @param string|null $plugin
* @return string
* @throws DataNotFoundException
* @throws DbException
* @throws InvalidArgumentException
* @throws ModelNotFoundException
*/
public static function render(string $template, array $vars, string $app = null)
public static function render(string $template, array $vars, string $app = null, string $plugin = null): string
{
$content = parent::render($template, $vars, $app);
if (saenv('minify_page')) {

View File

@@ -16,8 +16,8 @@ use Dotenv\Dotenv;
use support\Log;
use Webman\Bootstrap;
use Webman\Config;
use Webman\Route;
use Webman\Middleware;
use Webman\Route;
use Webman\Util;
$worker = $worker ?? null;
@@ -29,16 +29,16 @@ set_error_handler(function ($level, $message, $file = '', $line = 0) {
});
if ($worker) {
register_shutdown_function(function ($start_time) {
if (time() - $start_time <= 1) {
register_shutdown_function(function ($startTime) {
if (time() - $startTime <= 0.1) {
sleep(1);
}
}, time());
}
if (class_exists('Dotenv\Dotenv') && file_exists(base_path() . '/.env')) {
if (method_exists('Dotenv\Dotenv', 'createUnsafeImmutable')) {
Dotenv::createUnsafeImmutable(base_path())->load();
if (method_exists('Dotenv\Dotenv', 'createUnsafeMutable')) {
Dotenv::createUnsafeMutable(base_path())->load();
} else {
Dotenv::createMutable(base_path())->load();
}
@@ -67,30 +67,30 @@ foreach (config('plugin', []) as $firm => $projects) {
}
}
Middleware::load(config('middleware', []), '');
Middleware::load(config('middleware', []));
foreach (config('plugin', []) as $firm => $projects) {
foreach ($projects as $name => $project) {
if (!is_array($project) || $name === 'static') {
continue;
}
Middleware::load($project['middleware'] ?? [], '');
Middleware::load($project['middleware'] ?? []);
}
Middleware::load($projects['middleware'] ?? [], $firm);
if ($static_middlewares = config("plugin.$firm.static.middleware")) {
Middleware::load(['__static__' => $static_middlewares], $firm);
if ($staticMiddlewares = config("plugin.$firm.static.middleware")) {
Middleware::load(['__static__' => $staticMiddlewares], $firm);
}
}
Middleware::load(['__static__' => config('static.middleware', [])], '');
Middleware::load(['__static__' => config('static.middleware', [])]);
foreach (config('bootstrap', []) as $class_name) {
if (!class_exists($class_name)) {
$log = "Warning: Class $class_name setting in config/bootstrap.php not found\r\n";
foreach (config('bootstrap', []) as $className) {
if (!class_exists($className)) {
$log = "Warning: Class $className setting in config/bootstrap.php not found\r\n";
echo $log;
Log::error($log);
continue;
}
/** @var Bootstrap $class_name */
$class_name::start($worker);
/** @var Bootstrap $className */
$className::start($worker);
}
foreach (config('plugin', []) as $firm => $projects) {
@@ -98,26 +98,27 @@ foreach (config('plugin', []) as $firm => $projects) {
if (!is_array($project)) {
continue;
}
foreach ($project['bootstrap'] ?? [] as $class_name) {
if (!class_exists($class_name)) {
$log = "Warning: Class $class_name setting in config/plugin/$firm/$name/bootstrap.php not found\r\n";
foreach ($project['bootstrap'] ?? [] as $className) {
if (!class_exists($className)) {
$log = "Warning: Class $className setting in config/plugin/$firm/$name/bootstrap.php not found\r\n";
echo $log;
Log::error($log);
continue;
}
/** @var Bootstrap $class_name */
$class_name::start($worker);
/** @var Bootstrap $className */
$className::start($worker);
}
}
foreach ($projects['bootstrap'] ?? [] as $class_name) {
if (!class_exists($class_name)) {
$log = "Warning: Class $class_name setting in plugin/$firm/config/bootstrap.php not found\r\n";
foreach ($projects['bootstrap'] ?? [] as $className) {
/** @var string $className */
if (!class_exists($className)) {
$log = "Warning: Class $className setting in plugin/$firm/config/bootstrap.php not found\r\n";
echo $log;
Log::error($log);
continue;
}
/** @var Bootstrap $class_name */
$class_name::start($worker);
/** @var Bootstrap $className */
$className::start($worker);
}
}

View File

@@ -17,132 +17,171 @@ use support\Container;
use support\Request;
use support\Response;
use support\Translation;
use support\view\Raw;
use support\view\Blade;
use support\view\Raw;
use support\view\ThinkPHP;
use support\view\Twig;
use Workerman\Worker;
use Symfony\Component\VarDumper\Caster\ReflectionCaster;
use Symfony\Component\VarDumper\Cloner\VarCloner;
use Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider;
use Symfony\Component\VarDumper\Dumper\ContextualizedDumper;
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
use Webman\App;
use Webman\Config;
use Webman\Route;
// Webman version
define('WEBMAN_VERSION', '1.4');
use Workerman\Worker;
// Project base path
define('BASE_PATH', dirname(__DIR__));
/**
* return the program execute directory
* @param string $path
* @return string
*/
function run_path(string $path = ''): string
{
static $runPath = '';
if (!$runPath) {
$runPath = is_phar() ? dirname(Phar::running(false)) : BASE_PATH;
}
return path_combine($runPath, $path);
}
/**
* if the param $path equal false,will return this program current execute directory
* @param string|false $path
* @return string
*/
function base_path($path = ''): string
{
if (false === $path) {
return run_path();
}
return path_combine(BASE_PATH, $path);
}
/**
* App path
* @param string $path
* @return string
*/
function app_path(string $path = ''): string
{
return path_combine(BASE_PATH . DIRECTORY_SEPARATOR . 'app', $path);
}
/**
* Public path
* @param string $path
* @return string
*/
function public_path(string $path = ''): string
{
static $publicPath = '';
if (!$publicPath) {
$publicPath = \config('app.public_path') ?: run_path('public');
}
return path_combine($publicPath, $path);
}
/**
* Config path
* @param string $path
* @return string
*/
function config_path(string $path = ''): string
{
return path_combine(BASE_PATH . DIRECTORY_SEPARATOR . 'config', $path);
}
/**
* Runtime path
* @param string $path
* @return string
*/
function runtime_path(string $path = ''): string
{
static $runtimePath = '';
if (!$runtimePath) {
$runtimePath = \config('app.runtime_path') ?: run_path('runtime');
}
return path_combine($runtimePath, $path);
}
if (!function_exists('halt')) {
/**
* 调试变量并且中断输出
* @param mixed $vars 调试变量或者信息
*/
function halt(...$vars)
{
ob_start();
$cloner = new VarCloner();
$cloner->addCasters(ReflectionCaster::UNSET_CLOSURE_FILE_INFO);
$dumper = new HtmlDumper();
$dumper = new ContextualizedDumper($dumper, [new SourceContextProvider()]);
foreach ($vars as $var) {
$dumper->dump($cloner->cloneVar($var));
}
$ob_response = (string)ob_get_clean();
throw new \RuntimeException($ob_response, 600);
}
}
if (!function_exists('get_env')) {
/**
* Get environment variable
*/
function get_env($var)
{
$dir = str_replace('\\', '/', realpath(__DIR__ . '/../'));
$env_path = $dir . '/.env';
$env_info = parse_ini_file($env_path, true);
return $env_info[$var] ?? '';
}
}
/**
* Generate paths based on given information
* @param string $front
* @param string $back
* @return string
*/
function path_combine(string $front, string $back)
function path_combine(string $front, string $back): string
{
return $front . ($back ? (DIRECTORY_SEPARATOR . ltrim($back, DIRECTORY_SEPARATOR)) : $back);
}
/**
* return the program execute directory
* @param string $path
* @return string
*/
function run_path(string $path = '')
{
static $run_path = '';
if (!$run_path) {
$run_path = \is_phar() ? \dirname(\Phar::running(false)) : BASE_PATH;
}
return \path_combine($run_path, $path);
}
/**
* if the param $path equal false,will return this program current execute directory
* @param string|false $path
* @return false|string
*/
function base_path($path = '')
{
if (false === $path) {
return \run_path();
}
return \path_combine(BASE_PATH, $path);
}
/**
* @param string $path
* @return string
*/
function app_path(string $path = '')
{
return \path_combine(BASE_PATH . DIRECTORY_SEPARATOR . 'app', $path);
}
/**
* @param string $path
* @return string
*/
function public_path(string $path = '')
{
static $public_path = '';
if (!$public_path) {
$public_path = \config('app.public_path') ? : \run_path('public');
}
return \path_combine($public_path, $path);
}
/**
* @param string $path
* @return string
*/
function config_path(string $path = '')
{
return \path_combine(BASE_PATH . DIRECTORY_SEPARATOR . 'config', $path);
}
/**
* Phar support.
* Compatible with the 'realpath' function in the phar file.
* @param string $path
* @return string
*/
function runtime_path(string $path = '')
{
static $runtime_path = '';
if (!$runtime_path) {
$runtime_path = \config('app.runtime_path') ? : \run_path('runtime');
}
return \path_combine($runtime_path, $path);
}
/**
* Response
* @param int $status
* @param array $headers
* @param string $body
* @return Response
*/
function response($body = '', $status = 200, $headers = [])
function response(string $body = '', int $status = 200, array $headers = []): Response
{
return new Response($status, $headers, $body);
}
/**
* Json response
* @param $data
* @param int $options
* @return Response
*/
function json($data, $options = JSON_UNESCAPED_UNICODE)
function json($data, int $options = JSON_UNESCAPED_UNICODE): Response
{
return new Response(200, ['Content-Type' => 'application/json'], \json_encode($data, $options));
return new Response(200, ['Content-Type' => 'application/json'], json_encode($data, $options));
}
/**
* Xml response
* @param $xml
* @return Response
*/
function xml($xml)
function xml($xml): Response
{
if ($xml instanceof SimpleXMLElement) {
$xml = $xml->asXML();
@@ -151,25 +190,27 @@ function xml($xml)
}
/**
* Jsonp response
* @param $data
* @param string $callback_name
* @param string $callbackName
* @return Response
*/
function jsonp($data, $callback_name = 'callback')
function jsonp($data, string $callbackName = 'callback'): Response
{
if (!\is_scalar($data) && null !== $data) {
$data = \json_encode($data);
if (!is_scalar($data) && null !== $data) {
$data = json_encode($data);
}
return new Response(200, [], "$callback_name($data)");
return new Response(200, [], "$callbackName($data)");
}
/**
* Redirect response
* @param string $location
* @param int $status
* @param array $headers
* @return Response
*/
function redirect(string $location, int $status = 302, array $headers = [])
function redirect(string $location, int $status = 302, array $headers = []): Response
{
$response = new Response($status, ['Location' => $location]);
if (!empty($headers)) {
@@ -179,65 +220,75 @@ function redirect(string $location, int $status = 302, array $headers = [])
}
/**
* @param $template
* View response
* @param string $template
* @param array $vars
* @param null $app
* @param string|null $app
* @param string|null $plugin
* @return Response
*/
function view(string $template, array $vars = [], string $app = null)
function view(string $template, array $vars = [], string $app = null, string $plugin = null): Response
{
$request = \request();
$plugin = $request->plugin ?? '';
$plugin = $plugin === null ? ($request->plugin ?? '') : $plugin;
$handler = \config($plugin ? "plugin.$plugin.view.handler" : 'view.handler');
return new Response(200, [], $handler::render($template, $vars, $app));
return new Response(200, [], $handler::render($template, $vars, $app, $plugin));
}
/**
* Raw view response
* @param string $template
* @param array $vars
* @param string|null $app
* @return Response
* @throws Throwable
*/
function raw_view(string $template, array $vars = [], string $app = null)
function raw_view(string $template, array $vars = [], string $app = null): Response
{
return new Response(200, [], Raw::render($template, $vars, $app));
}
/**
* Blade view response
* @param string $template
* @param array $vars
* @param string|null $app
* @return Response
*/
function blade_view(string $template, array $vars = [], string $app = null)
function blade_view(string $template, array $vars = [], string $app = null): Response
{
return new Response(200, [], Blade::render($template, $vars, $app));
}
/**
* Think view response
* @param string $template
* @param array $vars
* @param string|null $app
* @return Response
*/
function think_view(string $template, array $vars = [], string $app = null)
function think_view(string $template, array $vars = [], string $app = null): Response
{
return new Response(200, [], ThinkPHP::render($template, $vars, $app));
}
/**
* Twig view response
* @param string $template
* @param array $vars
* @param string|null $app
* @return Response
* @throws LoaderError
* @throws RuntimeError
* @throws SyntaxError
*/
function twig_view(string $template, array $vars = [], string $app = null)
function twig_view(string $template, array $vars = [], string $app = null): Response
{
return new Response(200, [], Twig::render($template, $vars, $app));
}
/**
* Get request
* @return \Webman\Http\Request|Request|null
*/
function request()
@@ -246,6 +297,7 @@ function request()
}
/**
* Get config
* @param string|null $key
* @param $default
* @return array|mixed|null
@@ -256,11 +308,12 @@ function config(string $key = null, $default = null)
}
/**
* Create url
* @param string $name
* @param ...$parameters
* @return string
*/
function route(string $name, ...$parameters)
function route(string $name, ...$parameters): string
{
$route = Route::getByName($name);
if (!$route) {
@@ -271,14 +324,15 @@ function route(string $name, ...$parameters)
return $route->url();
}
if (\is_array(\current($parameters))) {
$parameters = \current($parameters);
if (is_array(current($parameters))) {
$parameters = current($parameters);
}
return $route->url($parameters);
}
/**
* Session
* @param mixed $key
* @param mixed $default
* @return mixed
@@ -289,14 +343,14 @@ function session($key = null, $default = null)
if (null === $key) {
return $session;
}
if (\is_array($key)) {
if (is_array($key)) {
$session->put($key);
return null;
}
if (\strpos($key, '.')) {
$key_array = \explode('.', $key);
if (strpos($key, '.')) {
$keyArray = explode('.', $key);
$value = $session->all();
foreach ($key_array as $index) {
foreach ($keyArray as $index) {
if (!isset($value[$index])) {
return $default;
}
@@ -308,43 +362,44 @@ function session($key = null, $default = null)
}
/**
* Translation
* @param string $id
* @param array $parameters
* @param string|null $domain
* @param string|null $locale
* @return string
*/
function trans(string $id, array $parameters = [], string $domain = null, string $locale = null)
function trans(string $id, array $parameters = [], string $domain = null, string $locale = null): string
{
$res = Translation::trans($id, $parameters, $domain, $locale);
return $res === '' ? $id : $res;
}
/**
* @param null|string $locale
* Locale
* @param string|null $locale
* @return string
*/
function locale(string $locale = null)
function locale(string $locale = null): string
{
if (!$locale) {
return Translation::getLocale();
}
Translation::setLocale($locale);
return $locale;
}
/**
* 404 not found
*
* @return Response
*/
function not_found()
function not_found(): Response
{
return new Response(404, [], \file_get_contents(public_path() . '/404.html'));
return new Response(404, [], file_get_contents(public_path() . '/404.html'));
}
/**
* Copy dir.
*
* Copy dir
* @param string $source
* @param string $dest
* @param bool $overwrite
@@ -352,46 +407,46 @@ function not_found()
*/
function copy_dir(string $source, string $dest, bool $overwrite = false)
{
if (\is_dir($source)) {
if (is_dir($source)) {
if (!is_dir($dest)) {
\mkdir($dest);
mkdir($dest);
}
$files = \scandir($source);
$files = scandir($source);
foreach ($files as $file) {
if ($file !== "." && $file !== "..") {
\copy_dir("$source/$file", "$dest/$file");
copy_dir("$source/$file", "$dest/$file");
}
}
} else if (\file_exists($source) && ($overwrite || !\file_exists($dest))) {
\copy($source, $dest);
} else if (file_exists($source) && ($overwrite || !file_exists($dest))) {
copy($source, $dest);
}
}
/**
* Remove dir.
*
* Remove dir
* @param string $dir
* @return bool
*/
function remove_dir(string $dir)
function remove_dir(string $dir): bool
{
if (\is_link($dir) || \is_file($dir)) {
return \unlink($dir);
if (is_link($dir) || is_file($dir)) {
return unlink($dir);
}
$files = \array_diff(\scandir($dir), array('.', '..'));
$files = array_diff(scandir($dir), array('.', '..'));
foreach ($files as $file) {
(\is_dir("$dir/$file") && !\is_link($dir)) ? \remove_dir("$dir/$file") : \unlink("$dir/$file");
(is_dir("$dir/$file") && !is_link($dir)) ? remove_dir("$dir/$file") : unlink("$dir/$file");
}
return \rmdir($dir);
return rmdir($dir);
}
/**
* Bind worker
* @param $worker
* @param $class
*/
function worker_bind($worker, $class)
{
$callback_map = [
$callbackMap = [
'onConnect',
'onMessage',
'onClose',
@@ -399,27 +454,29 @@ function worker_bind($worker, $class)
'onBufferFull',
'onBufferDrain',
'onWorkerStop',
'onWebSocketConnect'
'onWebSocketConnect',
'onWorkerReload'
];
foreach ($callback_map as $name) {
if (\method_exists($class, $name)) {
foreach ($callbackMap as $name) {
if (method_exists($class, $name)) {
$worker->$name = [$class, $name];
}
}
if (\method_exists($class, 'onWorkerStart')) {
\call_user_func([$class, 'onWorkerStart'], $worker);
if (method_exists($class, 'onWorkerStart')) {
call_user_func([$class, 'onWorkerStart'], $worker);
}
}
/**
* @param $process_name
* Start worker
* @param $processName
* @param $config
* @return void
*/
function worker_start($process_name, $config)
function worker_start($processName, $config)
{
$worker = new Worker($config['listen'] ?? null, $config['context'] ?? []);
$property_map = [
$propertyMap = [
'count',
'user',
'group',
@@ -428,81 +485,66 @@ function worker_start($process_name, $config)
'transport',
'protocol',
];
$worker->name = $process_name;
foreach ($property_map as $property) {
$worker->name = $processName;
foreach ($propertyMap as $property) {
if (isset($config[$property])) {
$worker->$property = $config[$property];
}
}
$worker->onWorkerStart = function ($worker) use ($config) {
require_once \base_path() . '/support/bootstrap.php';
foreach ($config['services'] ?? [] as $server) {
if (!\class_exists($server['handler'])) {
echo "process error: class {$server['handler']} not exists\r\n";
continue;
}
$listen = new Worker($server['listen'] ?? null, $server['context'] ?? []);
if (isset($server['listen'])) {
echo "listen: {$server['listen']}\n";
}
$instance = Container::make($server['handler'], $server['constructor'] ?? []);
\worker_bind($listen, $instance);
$listen->listen();
}
require_once base_path('/support/bootstrap.php');
if (isset($config['handler'])) {
if (!\class_exists($config['handler'])) {
if (!class_exists($config['handler'])) {
echo "process error: class {$config['handler']} not exists\r\n";
return;
}
$instance = Container::make($config['handler'], $config['constructor'] ?? []);
\worker_bind($worker, $instance);
worker_bind($worker, $instance);
}
};
}
/**
* Phar support.
* Compatible with the 'realpath' function in the phar file.
*
* @param string $file_path
* Get realpath
* @param string $filePath
* @return string
*/
function get_realpath(string $file_path): string
function get_realpath(string $filePath): string
{
if (\strpos($file_path, 'phar://') === 0) {
return $file_path;
if (strpos($filePath, 'phar://') === 0) {
return $filePath;
} else {
return \realpath($file_path);
return realpath($filePath);
}
}
/**
* Is phar
* @return bool
*/
function is_phar()
function is_phar(): bool
{
return \class_exists(\Phar::class, false) && Phar::running();
return class_exists(Phar::class, false) && Phar::running();
}
/**
* Get cpu count
* @return int
*/
function cpu_count()
function cpu_count(): int
{
// Windows does not support the number of processes setting.
if (\DIRECTORY_SEPARATOR === '\\') {
if (DIRECTORY_SEPARATOR === '\\') {
return 1;
}
$count = 4;
if (\is_callable('shell_exec')) {
if (\strtolower(PHP_OS) === 'darwin') {
$count = (int)\shell_exec('sysctl -n machdep.cpu.core_count');
if (is_callable('shell_exec')) {
if (strtolower(PHP_OS) === 'darwin') {
$count = (int)shell_exec('sysctl -n machdep.cpu.core_count');
} else {
$count = (int)\shell_exec('nproc');
$count = (int)shell_exec('nproc');
}
}
return $count > 0 ? $count : 4;

17
vendor/autoload.php vendored
View File

@@ -3,8 +3,21 @@
// autoload.php @generated by Composer
if (PHP_VERSION_ID < 50600) {
echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
exit(1);
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, $err);
} elseif (!headers_sent()) {
echo $err;
}
}
trigger_error(
$err,
E_USER_ERROR
);
}
require_once __DIR__ . '/composer/autoload_real.php';

View File

@@ -34,5 +34,11 @@
"allow-plugins": {
"ocramius/package-versions": true
}
},
"archive": {
"exclude": [
"/test",
"/phpunit.xml.dist"
]
}
}

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="BaconQrCode Tests">
<directory>./test</directory>
</testsuite>
</testsuites>
</phpunit>

View File

@@ -89,6 +89,9 @@ final class CharacterSetEci extends AbstractEnum
*/
private static $nameToEci;
/**
* @param int[] $values
*/
public function __construct(array $values, string ...$otherEncodingNames)
{
$this->values = $values;

View File

@@ -62,7 +62,7 @@ class FormatInformation
/**
* Offset i holds the number of 1 bits in the binary representation of i.
*
* @var array
* @var int[]
*/
private const BITS_SET_IN_HALF_BYTE = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4];

View File

@@ -42,6 +42,9 @@ final class Mode extends AbstractEnum
*/
private $bits;
/**
* @param int[] $characterCountBitsForVersions
*/
protected function __construct(array $characterCountBitsForVersions, int $bits)
{
$this->characterCountBitsForVersions = $characterCountBitsForVersions;

View File

@@ -37,7 +37,7 @@ final class Encoder
/**
* Codec cache.
*
* @var array
* @var array<string,ReedSolomonCodec>
*/
private static $codecs = [];

View File

@@ -334,7 +334,7 @@ final class SvgImageBackEnd implements ImageBackEndInterface
$this->xmlWriter->writeAttribute('stop-color', $this->getColorString($startColor));
if ($startColor instanceof Alpha) {
$this->xmlWriter->writeAttribute('stop-opacity', $startColor->getAlpha());
$this->xmlWriter->writeAttribute('stop-opacity', (string) $startColor->getAlpha());
}
$this->xmlWriter->endElement();
@@ -344,7 +344,7 @@ final class SvgImageBackEnd implements ImageBackEndInterface
$this->xmlWriter->writeAttribute('stop-color', $this->getColorString($endColor));
if ($endColor instanceof Alpha) {
$this->xmlWriter->writeAttribute('stop-opacity', $endColor->getAlpha());
$this->xmlWriter->writeAttribute('stop-opacity', (string) $endColor->getAlpha());
}
$this->xmlWriter->endElement();

View File

@@ -41,7 +41,7 @@ final class EdgeIterator implements IteratorAggregate
}
/**
* @return Edge[]
* @return Traversable<Edge>
*/
public function getIterator() : Traversable
{

View File

@@ -136,7 +136,7 @@ final class EllipticArc implements OperationInterface
/**
* @return Curve[]
*/
private function createCurves(float $fromX, $fromY) : array
private function createCurves(float $fromX, float $fromY) : array
{
$xAngle = deg2rad($this->xAxisAngle);
list($centerX, $centerY, $radiusX, $radiusY, $startAngle, $deltaAngle) =

View File

@@ -17,10 +17,16 @@ use BaconQrCode\Writer;
use PHPUnit\Framework\TestCase;
use Spatie\Snapshots\MatchesSnapshots;
/**
* @group integration
*/
final class ImagickRenderingTest extends TestCase
{
use MatchesSnapshots;
/**
* @requires extension imagick
*/
public function testGenericQrCode() : void
{
$renderer = new ImageRenderer(
@@ -35,6 +41,9 @@ final class ImagickRenderingTest extends TestCase
unlink($tempName);
}
/**
* @requires extension imagick
*/
public function testIssue79() : void
{
$eye = SquareEye::instance();

120
vendor/bin/var-dump-server vendored Normal file
View File

@@ -0,0 +1,120 @@
#!/usr/bin/env php
<?php
/**
* Proxy PHP file generated by Composer
*
* This file includes the referenced bin path (../symfony/var-dumper/Resources/bin/var-dump-server)
* using a stream wrapper to prevent the shebang from being output on PHP<8
*
* @generated
*/
namespace Composer;
$GLOBALS['_composer_bin_dir'] = __DIR__;
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';
if (PHP_VERSION_ID < 80000) {
if (!class_exists('Composer\BinProxyWrapper')) {
/**
* @internal
*/
final class BinProxyWrapper
{
private $handle;
private $position;
private $realpath;
public function stream_open($path, $mode, $options, &$opened_path)
{
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
$opened_path = substr($path, 17);
$this->realpath = realpath($opened_path) ?: $opened_path;
$opened_path = $this->realpath;
$this->handle = fopen($this->realpath, $mode);
$this->position = 0;
return (bool) $this->handle;
}
public function stream_read($count)
{
$data = fread($this->handle, $count);
if ($this->position === 0) {
$data = preg_replace('{^#!.*\r?\n}', '', $data);
}
$this->position += strlen($data);
return $data;
}
public function stream_cast($castAs)
{
return $this->handle;
}
public function stream_close()
{
fclose($this->handle);
}
public function stream_lock($operation)
{
return $operation ? flock($this->handle, $operation) : true;
}
public function stream_seek($offset, $whence)
{
if (0 === fseek($this->handle, $offset, $whence)) {
$this->position = ftell($this->handle);
return true;
}
return false;
}
public function stream_tell()
{
return $this->position;
}
public function stream_eof()
{
return feof($this->handle);
}
public function stream_stat()
{
return array();
}
public function stream_set_option($option, $arg1, $arg2)
{
return true;
}
public function url_stat($path, $flags)
{
$path = substr($path, 17);
if (file_exists($path)) {
return stat($path);
}
return false;
}
}
}
if (
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
) {
include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server');
exit(0);
}
}
include __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server';

5
vendor/bin/var-dump-server.bat vendored Normal file
View File

@@ -0,0 +1,5 @@
@ECHO OFF
setlocal DISABLEDELAYEDEXPANSION
SET BIN_TARGET=%~dp0/var-dump-server
SET COMPOSER_RUNTIME_BIN_DIR=%~dp0
php "%BIN_TARGET%" %*

View File

@@ -42,6 +42,9 @@ namespace Composer\Autoload;
*/
class ClassLoader
{
/** @var \Closure(string):void */
private static $includeFile;
/** @var ?string */
private $vendorDir;
@@ -106,6 +109,7 @@ class ClassLoader
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
self::initializeIncludeClosure();
}
/**
@@ -425,7 +429,7 @@ class ClassLoader
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
includeFile($file);
(self::$includeFile)($file);
return true;
}
@@ -555,6 +559,11 @@ class ClassLoader
return false;
}
private static function initializeIncludeClosure(): void
{
if (self::$includeFile !== null) {
return;
}
/**
@@ -564,9 +573,9 @@ class ClassLoader
*
* @param string $file
* @return void
* @private
*/
function includeFile($file)
{
self::$includeFile = static function($file) {
include $file;
};
}
}

View File

@@ -8,7 +8,6 @@ $baseDir = dirname($vendorDir);
return array(
'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',
'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',

View File

@@ -6,30 +6,25 @@ $vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
'9b552a3cc426e3287cc811caefa3cf53' => $vendorDir . '/topthink/think-helper/src/helper.php',
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
'8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php',
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
'253c157292f75eb38082b5acb06f3f01' => $vendorDir . '/nikic/fast-route/src/functions.php',
'538ca81a9a966a6716601ecf48f4eaef' => $vendorDir . '/opis/closure/functions.php',
'0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php',
'c5521cebe610a9bf42c44b3a5163adfd' => $vendorDir . '/overtrue/socialite/src/Contracts/FactoryInterface.php',
'ccd11c8e7dd9b33638b248681bdfba27' => $vendorDir . '/overtrue/socialite/src/Contracts/UserInterface.php',
'5649552725dea6ec47381627600e3ac1' => $vendorDir . '/overtrue/socialite/src/Contracts/ProviderInterface.php',
'2cffec82183ee1cea088009cef9a6fc3' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
'35fab96057f1bf5e7aba31a8a6d5fdde' => $vendorDir . '/topthink/think-orm/stubs/load_stubs.php',
'6b998e7ad3182c0d21d23780badfa07b' => $vendorDir . '/yansongda/supports/src/Functions.php',
'dc1275c308c5b416beb314b6317daca2' => $vendorDir . '/overtrue/pinyin/src/const.php',
'f0e7e63bbb278a92db02393536748c5f' => $vendorDir . '/overtrue/wechat/src/Kernel/Support/Helpers.php',
'6747f579ad6817f318cc3a7e7a0abb93' => $vendorDir . '/overtrue/wechat/src/Kernel/Helpers.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
'b33e3d135e5d9e47d845c576147bda89' => $vendorDir . '/php-di/php-di/src/functions.php',
'a1105708a18b76903365ca1c4aa61b02' => $vendorDir . '/symfony/translation/Resources/functions.php',
'667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
'8c783b3a3de2f6d9177022b5ccdcc841' => $vendorDir . '/yansongda/pay/src/Functions.php',
'fe146f35de045d8ffe923710b1f98ecc' => $baseDir . '/support/helpers.php',
);

View File

@@ -6,6 +6,6 @@ $vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'Pimple' => array($vendorDir . '/pimple/pimple/src'),
'HTMLPurifier' => array($vendorDir . '/ezyang/htmlpurifier/library'),
'' => array($baseDir . '/extend'),
);

View File

@@ -9,6 +9,7 @@ return array(
'think\\' => array($vendorDir . '/topthink/think-cache/src', $vendorDir . '/topthink/think-container/src', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-image/src', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/think-template/src', $vendorDir . '/topthink/think-validate/src'),
'support\\' => array($vendorDir . '/workerman/webman-framework/src/support'),
'app\\' => array($baseDir . '/app'),
'ZipStream\\' => array($vendorDir . '/maennchen/zipstream-php/src'),
'Yansongda\\Supports\\' => array($vendorDir . '/yansongda/supports/src'),
'Yansongda\\Pay\\' => array($vendorDir . '/yansongda/pay/src'),
'Workerman\\Redis\\' => array($vendorDir . '/workerman/redis/src'),
@@ -20,26 +21,19 @@ return array(
'Webman\\GatewayWorker\\' => array($vendorDir . '/webman/gateway-worker/src'),
'Webman\\Event\\' => array($vendorDir . '/webman/event/src'),
'Webman\\Console\\' => array($vendorDir . '/webman/console/src'),
'Webman\\Captcha\\' => array($vendorDir . '/webman/captcha/src'),
'Webman\\' => array($vendorDir . '/workerman/webman-framework/src'),
'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'),
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'),
'Symfony\\Polyfill\\Intl\\Grapheme\\' => array($vendorDir . '/symfony/polyfill-intl-grapheme'),
'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
'Symfony\\Contracts\\Translation\\' => array($vendorDir . '/symfony/translation-contracts'),
'Symfony\\Contracts\\Service\\' => array($vendorDir . '/symfony/service-contracts'),
'Symfony\\Contracts\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher-contracts'),
'Symfony\\Contracts\\Cache\\' => array($vendorDir . '/symfony/cache-contracts'),
'Symfony\\Component\\VarExporter\\' => array($vendorDir . '/symfony/var-exporter'),
'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'),
'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'),
'Symfony\\Component\\String\\' => array($vendorDir . '/symfony/string'),
'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'),
'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'),
'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'),
'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'),
'Symfony\\Component\\Cache\\' => array($vendorDir . '/symfony/cache'),
'Symfony\\Bridge\\PsrHttpMessage\\' => array($vendorDir . '/symfony/psr-http-message-bridge'),
'Support\\View\\' => array($vendorDir . '/workerman/webman-framework/src/support/view'),
'Support\\Exception\\' => array($vendorDir . '/workerman/webman-framework/src/support/exception'),
'Support\\Bootstrap\\' => array($vendorDir . '/workerman/webman-framework/src/support/bootstrap'),
@@ -51,29 +45,26 @@ return array(
'Psr\\EventDispatcher\\' => array($vendorDir . '/psr/event-dispatcher/src'),
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'),
'PhpOption\\' => array($vendorDir . '/phpoption/phpoption/src/PhpOption'),
'PhpOffice\\PhpSpreadsheet\\' => array($vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet'),
'PhpDocReader\\' => array($vendorDir . '/php-di/phpdoc-reader/src/PhpDocReader'),
'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'),
'Overtrue\\Socialite\\' => array($vendorDir . '/overtrue/socialite/src'),
'Overtrue\\Pinyin\\' => array($vendorDir . '/overtrue/pinyin/src'),
'Opis\\Closure\\' => array($vendorDir . '/opis/closure/src'),
'MyCLabs\\Enum\\' => array($vendorDir . '/myclabs/php-enum/src'),
'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'),
'Matrix\\' => array($vendorDir . '/markbaker/matrix/classes/src'),
'Laravel\\SerializableClosure\\' => array($vendorDir . '/laravel/serializable-closure/src'),
'Invoker\\' => array($vendorDir . '/php-di/invoker/src'),
'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
'Gregwar\\' => array($vendorDir . '/gregwar/captcha/src/Gregwar'),
'GrahamCampbell\\ResultType\\' => array($vendorDir . '/graham-campbell/result-type/src'),
'GatewayWorker\\' => array($vendorDir . '/workerman/gateway-worker/src'),
'FastRoute\\' => array($vendorDir . '/nikic/fast-route/src'),
'Endroid\\QrCode\\' => array($vendorDir . '/endroid/qr-code/src'),
'EasyWeChat\\' => array($vendorDir . '/overtrue/wechat/src'),
'EasyWeChatComposer\\' => array($vendorDir . '/easywechat-composer/easywechat-composer/src'),
'Dotenv\\' => array($vendorDir . '/vlucas/phpdotenv/src'),
'Doctrine\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector'),
'DI\\' => array($vendorDir . '/php-di/php-di/src'),
'DASPRiD\\Enum\\' => array($vendorDir . '/dasprid/enum/src'),
'Complex\\' => array($vendorDir . '/markbaker/complex/classes/src'),
'BaconQrCode\\' => array($vendorDir . '/bacon/bacon-qr-code/src'),
'' => array($baseDir . '/'),
);

View File

@@ -33,25 +33,18 @@ class ComposerAutoloaderInitfa49c619328634587e27f2ef69b215b7
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInitfa49c619328634587e27f2ef69b215b7::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequirefa49c619328634587e27f2ef69b215b7($fileIdentifier, $file);
}
return $loader;
}
}
/**
* @param string $fileIdentifier
* @param string $file
* @return void
*/
function composerRequirefa49c619328634587e27f2ef69b215b7($fileIdentifier, $file)
{
$filesToLoad = \Composer\Autoload\ComposerStaticInitfa49c619328634587e27f2ef69b215b7::$files;
$requireFile = static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
require $file;
}
};
foreach ($filesToLoad as $fileIdentifier => $file) {
($requireFile)($fileIdentifier, $file);
}
return $loader;
}
}

View File

@@ -7,30 +7,25 @@ namespace Composer\Autoload;
class ComposerStaticInitfa49c619328634587e27f2ef69b215b7
{
public static $files = array (
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
'9b552a3cc426e3287cc811caefa3cf53' => __DIR__ . '/..' . '/topthink/think-helper/src/helper.php',
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
'8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php',
'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',
'253c157292f75eb38082b5acb06f3f01' => __DIR__ . '/..' . '/nikic/fast-route/src/functions.php',
'538ca81a9a966a6716601ecf48f4eaef' => __DIR__ . '/..' . '/opis/closure/functions.php',
'0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php',
'c5521cebe610a9bf42c44b3a5163adfd' => __DIR__ . '/..' . '/overtrue/socialite/src/Contracts/FactoryInterface.php',
'ccd11c8e7dd9b33638b248681bdfba27' => __DIR__ . '/..' . '/overtrue/socialite/src/Contracts/UserInterface.php',
'5649552725dea6ec47381627600e3ac1' => __DIR__ . '/..' . '/overtrue/socialite/src/Contracts/ProviderInterface.php',
'2cffec82183ee1cea088009cef9a6fc3' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
'35fab96057f1bf5e7aba31a8a6d5fdde' => __DIR__ . '/..' . '/topthink/think-orm/stubs/load_stubs.php',
'6b998e7ad3182c0d21d23780badfa07b' => __DIR__ . '/..' . '/yansongda/supports/src/Functions.php',
'dc1275c308c5b416beb314b6317daca2' => __DIR__ . '/..' . '/overtrue/pinyin/src/const.php',
'f0e7e63bbb278a92db02393536748c5f' => __DIR__ . '/..' . '/overtrue/wechat/src/Kernel/Support/Helpers.php',
'6747f579ad6817f318cc3a7e7a0abb93' => __DIR__ . '/..' . '/overtrue/wechat/src/Kernel/Helpers.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
'b33e3d135e5d9e47d845c576147bda89' => __DIR__ . '/..' . '/php-di/php-di/src/functions.php',
'a1105708a18b76903365ca1c4aa61b02' => __DIR__ . '/..' . '/symfony/translation/Resources/functions.php',
'667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
'8c783b3a3de2f6d9177022b5ccdcc841' => __DIR__ . '/..' . '/yansongda/pay/src/Functions.php',
'fe146f35de045d8ffe923710b1f98ecc' => __DIR__ . '/../..' . '/support/helpers.php',
);
@@ -48,6 +43,10 @@ class ComposerStaticInitfa49c619328634587e27f2ef69b215b7
array (
'app\\' => 4,
),
'Z' =>
array (
'ZipStream\\' => 10,
),
'Y' =>
array (
'Yansongda\\Supports\\' => 19,
@@ -64,29 +63,22 @@ class ComposerStaticInitfa49c619328634587e27f2ef69b215b7
'Webman\\GatewayWorker\\' => 21,
'Webman\\Event\\' => 13,
'Webman\\Console\\' => 15,
'Webman\\Captcha\\' => 15,
'Webman\\' => 7,
),
'S' =>
array (
'Symfony\\Polyfill\\Php80\\' => 23,
'Symfony\\Polyfill\\Php73\\' => 23,
'Symfony\\Polyfill\\Mbstring\\' => 26,
'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33,
'Symfony\\Polyfill\\Intl\\Grapheme\\' => 31,
'Symfony\\Polyfill\\Ctype\\' => 23,
'Symfony\\Contracts\\Translation\\' => 30,
'Symfony\\Contracts\\Service\\' => 26,
'Symfony\\Contracts\\EventDispatcher\\' => 34,
'Symfony\\Contracts\\Cache\\' => 24,
'Symfony\\Component\\VarExporter\\' => 30,
'Symfony\\Component\\VarDumper\\' => 28,
'Symfony\\Component\\Translation\\' => 30,
'Symfony\\Component\\String\\' => 25,
'Symfony\\Component\\HttpFoundation\\' => 33,
'Symfony\\Component\\Finder\\' => 25,
'Symfony\\Component\\EventDispatcher\\' => 34,
'Symfony\\Component\\Console\\' => 26,
'Symfony\\Component\\Cache\\' => 24,
'Symfony\\Bridge\\PsrHttpMessage\\' => 30,
'Support\\View\\' => 13,
'Support\\Exception\\' => 18,
'Support\\Bootstrap\\' => 18,
@@ -101,19 +93,20 @@ class ComposerStaticInitfa49c619328634587e27f2ef69b215b7
'Psr\\EventDispatcher\\' => 20,
'Psr\\Container\\' => 14,
'Psr\\Cache\\' => 10,
'PhpOption\\' => 10,
'PhpOffice\\PhpSpreadsheet\\' => 25,
'PhpDocReader\\' => 13,
'PHPMailer\\PHPMailer\\' => 20,
),
'O' =>
array (
'Overtrue\\Socialite\\' => 19,
'Overtrue\\Pinyin\\' => 16,
'Opis\\Closure\\' => 13,
),
'M' =>
array (
'MyCLabs\\Enum\\' => 13,
'Monolog\\' => 8,
'Matrix\\' => 7,
),
'L' =>
array (
@@ -128,8 +121,6 @@ class ComposerStaticInitfa49c619328634587e27f2ef69b215b7
'GuzzleHttp\\Psr7\\' => 16,
'GuzzleHttp\\Promise\\' => 19,
'GuzzleHttp\\' => 11,
'Gregwar\\' => 8,
'GrahamCampbell\\ResultType\\' => 26,
'GatewayWorker\\' => 14,
),
'F' =>
@@ -139,16 +130,17 @@ class ComposerStaticInitfa49c619328634587e27f2ef69b215b7
'E' =>
array (
'Endroid\\QrCode\\' => 15,
'EasyWeChat\\' => 11,
'EasyWeChatComposer\\' => 19,
),
'D' =>
array (
'Dotenv\\' => 7,
'Doctrine\\Inflector\\' => 19,
'DI\\' => 3,
'DASPRiD\\Enum\\' => 13,
),
'C' =>
array (
'Complex\\' => 8,
),
'B' =>
array (
'BaconQrCode\\' => 12,
@@ -174,6 +166,10 @@ class ComposerStaticInitfa49c619328634587e27f2ef69b215b7
array (
0 => __DIR__ . '/../..' . '/app',
),
'ZipStream\\' =>
array (
0 => __DIR__ . '/..' . '/maennchen/zipstream-php/src',
),
'Yansongda\\Supports\\' =>
array (
0 => __DIR__ . '/..' . '/yansongda/supports/src',
@@ -218,6 +214,10 @@ class ComposerStaticInitfa49c619328634587e27f2ef69b215b7
array (
0 => __DIR__ . '/..' . '/webman/console/src',
),
'Webman\\Captcha\\' =>
array (
0 => __DIR__ . '/..' . '/webman/captcha/src',
),
'Webman\\' =>
array (
0 => __DIR__ . '/..' . '/workerman/webman-framework/src',
@@ -226,10 +226,6 @@ class ComposerStaticInitfa49c619328634587e27f2ef69b215b7
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
),
'Symfony\\Polyfill\\Php73\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-php73',
),
'Symfony\\Polyfill\\Mbstring\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
@@ -254,17 +250,9 @@ class ComposerStaticInitfa49c619328634587e27f2ef69b215b7
array (
0 => __DIR__ . '/..' . '/symfony/service-contracts',
),
'Symfony\\Contracts\\EventDispatcher\\' =>
'Symfony\\Component\\VarDumper\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/event-dispatcher-contracts',
),
'Symfony\\Contracts\\Cache\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/cache-contracts',
),
'Symfony\\Component\\VarExporter\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/var-exporter',
0 => __DIR__ . '/..' . '/symfony/var-dumper',
),
'Symfony\\Component\\Translation\\' =>
array (
@@ -274,30 +262,10 @@ class ComposerStaticInitfa49c619328634587e27f2ef69b215b7
array (
0 => __DIR__ . '/..' . '/symfony/string',
),
'Symfony\\Component\\HttpFoundation\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/http-foundation',
),
'Symfony\\Component\\Finder\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/finder',
),
'Symfony\\Component\\EventDispatcher\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/event-dispatcher',
),
'Symfony\\Component\\Console\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/console',
),
'Symfony\\Component\\Cache\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/cache',
),
'Symfony\\Bridge\\PsrHttpMessage\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/psr-http-message-bridge',
),
'Support\\View\\' =>
array (
0 => __DIR__ . '/..' . '/workerman/webman-framework/src/support/view',
@@ -343,9 +311,9 @@ class ComposerStaticInitfa49c619328634587e27f2ef69b215b7
array (
0 => __DIR__ . '/..' . '/psr/cache/src',
),
'PhpOption\\' =>
'PhpOffice\\PhpSpreadsheet\\' =>
array (
0 => __DIR__ . '/..' . '/phpoption/phpoption/src/PhpOption',
0 => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet',
),
'PhpDocReader\\' =>
array (
@@ -355,10 +323,6 @@ class ComposerStaticInitfa49c619328634587e27f2ef69b215b7
array (
0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src',
),
'Overtrue\\Socialite\\' =>
array (
0 => __DIR__ . '/..' . '/overtrue/socialite/src',
),
'Overtrue\\Pinyin\\' =>
array (
0 => __DIR__ . '/..' . '/overtrue/pinyin/src',
@@ -367,10 +331,18 @@ class ComposerStaticInitfa49c619328634587e27f2ef69b215b7
array (
0 => __DIR__ . '/..' . '/opis/closure/src',
),
'MyCLabs\\Enum\\' =>
array (
0 => __DIR__ . '/..' . '/myclabs/php-enum/src',
),
'Monolog\\' =>
array (
0 => __DIR__ . '/..' . '/monolog/monolog/src/Monolog',
),
'Matrix\\' =>
array (
0 => __DIR__ . '/..' . '/markbaker/matrix/classes/src',
),
'Laravel\\SerializableClosure\\' =>
array (
0 => __DIR__ . '/..' . '/laravel/serializable-closure/src',
@@ -391,14 +363,6 @@ class ComposerStaticInitfa49c619328634587e27f2ef69b215b7
array (
0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src',
),
'Gregwar\\' =>
array (
0 => __DIR__ . '/..' . '/gregwar/captcha/src/Gregwar',
),
'GrahamCampbell\\ResultType\\' =>
array (
0 => __DIR__ . '/..' . '/graham-campbell/result-type/src',
),
'GatewayWorker\\' =>
array (
0 => __DIR__ . '/..' . '/workerman/gateway-worker/src',
@@ -411,18 +375,6 @@ class ComposerStaticInitfa49c619328634587e27f2ef69b215b7
array (
0 => __DIR__ . '/..' . '/endroid/qr-code/src',
),
'EasyWeChat\\' =>
array (
0 => __DIR__ . '/..' . '/overtrue/wechat/src',
),
'EasyWeChatComposer\\' =>
array (
0 => __DIR__ . '/..' . '/easywechat-composer/easywechat-composer/src',
),
'Dotenv\\' =>
array (
0 => __DIR__ . '/..' . '/vlucas/phpdotenv/src',
),
'Doctrine\\Inflector\\' =>
array (
0 => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector',
@@ -435,6 +387,10 @@ class ComposerStaticInitfa49c619328634587e27f2ef69b215b7
array (
0 => __DIR__ . '/..' . '/dasprid/enum/src',
),
'Complex\\' =>
array (
0 => __DIR__ . '/..' . '/markbaker/complex/classes/src',
),
'BaconQrCode\\' =>
array (
0 => __DIR__ . '/..' . '/bacon/bacon-qr-code/src',
@@ -446,11 +402,11 @@ class ComposerStaticInitfa49c619328634587e27f2ef69b215b7
);
public static $prefixesPsr0 = array (
'P' =>
'H' =>
array (
'Pimple' =>
'HTMLPurifier' =>
array (
0 => __DIR__ . '/..' . '/pimple/pimple/src',
0 => __DIR__ . '/..' . '/ezyang/htmlpurifier/library',
),
),
);
@@ -462,7 +418,6 @@ class ComposerStaticInitfa49c619328634587e27f2ef69b215b7
public static $classMap = array (
'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',
'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',

File diff suppressed because it is too large Load Diff

View File

@@ -11,18 +11,18 @@
),
'versions' => array(
'bacon/bacon-qr-code' => array(
'pretty_version' => '2.0.7',
'version' => '2.0.7.0',
'reference' => 'd70c840f68657ce49094b8d91f9ee0cc07fbf66c',
'pretty_version' => '2.0.8',
'version' => '2.0.8.0',
'reference' => '8674e51bb65af933a5ffaf1c308a660387c35c22',
'type' => 'library',
'install_path' => __DIR__ . '/../bacon/bacon-qr-code',
'aliases' => array(),
'dev_requirement' => false,
),
'dasprid/enum' => array(
'pretty_version' => '1.0.3',
'version' => '1.0.3.0',
'reference' => '5abf82f213618696dda8e3bf6f64dd042d8542b2',
'pretty_version' => '1.0.4',
'version' => '1.0.4.0',
'reference' => '8e6b6ea76eabbf19ea2bf5b67b98e1860474012f',
'type' => 'library',
'install_path' => __DIR__ . '/../dasprid/enum',
'aliases' => array(),
@@ -37,46 +37,28 @@
'aliases' => array(),
'dev_requirement' => false,
),
'easywechat-composer/easywechat-composer' => array(
'pretty_version' => '1.4.1',
'version' => '1.4.1.0',
'reference' => '3fc6a7ab6d3853c0f4e2922539b56cc37ef361cd',
'type' => 'composer-plugin',
'install_path' => __DIR__ . '/../easywechat-composer/easywechat-composer',
'aliases' => array(),
'dev_requirement' => false,
),
'endroid/qr-code' => array(
'pretty_version' => '4.6.1',
'version' => '4.6.1.0',
'reference' => 'a75c913b0e4d6ad275e49a2c1de1cacffc6c2184',
'pretty_version' => '4.8.2',
'version' => '4.8.2.0',
'reference' => '2436c2333a3931c95e2b96eb82f16f53143d6bba',
'type' => 'library',
'install_path' => __DIR__ . '/../endroid/qr-code',
'aliases' => array(),
'dev_requirement' => false,
),
'graham-campbell/result-type' => array(
'pretty_version' => 'v1.1.0',
'version' => '1.1.0.0',
'reference' => 'a878d45c1914464426dc94da61c9e1d36ae262a8',
'ezyang/htmlpurifier' => array(
'pretty_version' => 'v4.16.0',
'version' => '4.16.0.0',
'reference' => '523407fb06eb9e5f3d59889b3978d5bfe94299c8',
'type' => 'library',
'install_path' => __DIR__ . '/../graham-campbell/result-type',
'aliases' => array(),
'dev_requirement' => false,
),
'gregwar/captcha' => array(
'pretty_version' => 'v1.1.9',
'version' => '1.1.9.0',
'reference' => '4bb668e6b40e3205a020ca5ee4ca8cff8b8780c5',
'type' => 'captcha',
'install_path' => __DIR__ . '/../gregwar/captcha',
'install_path' => __DIR__ . '/../ezyang/htmlpurifier',
'aliases' => array(),
'dev_requirement' => false,
),
'guzzlehttp/guzzle' => array(
'pretty_version' => '7.5.0',
'version' => '7.5.0.0',
'reference' => 'b50a2a1251152e43f6a37f0fa053e730a67d25ba',
'pretty_version' => '7.5.1',
'version' => '7.5.1.0',
'reference' => 'b964ca597e86b752cd994f27293e9fa6b6a95ed9',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
'aliases' => array(),
@@ -92,23 +74,50 @@
'dev_requirement' => false,
),
'guzzlehttp/psr7' => array(
'pretty_version' => '2.4.3',
'version' => '2.4.3.0',
'reference' => '67c26b443f348a51926030c83481b85718457d3d',
'pretty_version' => '2.5.0',
'version' => '2.5.0.0',
'reference' => 'b635f279edd83fc275f822a1188157ffea568ff6',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/psr7',
'aliases' => array(),
'dev_requirement' => false,
),
'laravel/serializable-closure' => array(
'pretty_version' => 'v1.2.2',
'version' => '1.2.2.0',
'reference' => '47afb7fae28ed29057fdca37e16a84f90cc62fae',
'pretty_version' => 'v1.3.0',
'version' => '1.3.0.0',
'reference' => 'f23fe9d4e95255dacee1bf3525e0810d1a1b0f37',
'type' => 'library',
'install_path' => __DIR__ . '/../laravel/serializable-closure',
'aliases' => array(),
'dev_requirement' => false,
),
'maennchen/zipstream-php' => array(
'pretty_version' => 'v2.4.0',
'version' => '2.4.0.0',
'reference' => '3fa72e4c71a43f9e9118752a5c90e476a8dc9eb3',
'type' => 'library',
'install_path' => __DIR__ . '/../maennchen/zipstream-php',
'aliases' => array(),
'dev_requirement' => false,
),
'markbaker/complex' => array(
'pretty_version' => '3.0.2',
'version' => '3.0.2.0',
'reference' => '95c56caa1cf5c766ad6d65b6344b807c1e8405b9',
'type' => 'library',
'install_path' => __DIR__ . '/../markbaker/complex',
'aliases' => array(),
'dev_requirement' => false,
),
'markbaker/matrix' => array(
'pretty_version' => '3.0.1',
'version' => '3.0.1.0',
'reference' => '728434227fe21be27ff6d86621a1b13107a2562c',
'type' => 'library',
'install_path' => __DIR__ . '/../markbaker/matrix',
'aliases' => array(),
'dev_requirement' => false,
),
'meystack/swiftadmin' => array(
'pretty_version' => '2.0.0',
'version' => '2.0.0.0',
@@ -119,14 +128,23 @@
'dev_requirement' => false,
),
'monolog/monolog' => array(
'pretty_version' => '2.8.0',
'version' => '2.8.0.0',
'reference' => '720488632c590286b88b80e62aa3d3d551ad4a50',
'pretty_version' => '2.9.1',
'version' => '2.9.1.0',
'reference' => 'f259e2b15fb95494c83f52d3caad003bbf5ffaa1',
'type' => 'library',
'install_path' => __DIR__ . '/../monolog/monolog',
'aliases' => array(),
'dev_requirement' => false,
),
'myclabs/php-enum' => array(
'pretty_version' => '1.8.4',
'version' => '1.8.4.0',
'reference' => 'a867478eae49c9f59ece437ae7f9506bfaa27483',
'type' => 'library',
'install_path' => __DIR__ . '/../myclabs/php-enum',
'aliases' => array(),
'dev_requirement' => false,
),
'nikic/fast-route' => array(
'pretty_version' => 'v1.3.0',
'version' => '1.3.0.0',
@@ -146,32 +164,14 @@
'dev_requirement' => false,
),
'overtrue/pinyin' => array(
'pretty_version' => '4.0.8',
'version' => '4.0.8.0',
'reference' => '04bdb4d33d50e8fb1aa5a824064c5151c4b15dc2',
'pretty_version' => '5.0.0',
'version' => '5.0.0.0',
'reference' => '4ee638c108f1230389e17ceaf2d1e0aebc3cedee',
'type' => 'library',
'install_path' => __DIR__ . '/../overtrue/pinyin',
'aliases' => array(),
'dev_requirement' => false,
),
'overtrue/socialite' => array(
'pretty_version' => '4.6.3',
'version' => '4.6.3.0',
'reference' => '52033511df3795c568528fe70fbe41459135911b',
'type' => 'library',
'install_path' => __DIR__ . '/../overtrue/socialite',
'aliases' => array(),
'dev_requirement' => false,
),
'overtrue/wechat' => array(
'pretty_version' => '5.31.0',
'version' => '5.31.0.0',
'reference' => 'cfd0feb6e0bee504d2f39d141e2b382d25fc441b',
'type' => 'library',
'install_path' => __DIR__ . '/../overtrue/wechat',
'aliases' => array(),
'dev_requirement' => false,
),
'php-di/invoker' => array(
'pretty_version' => '2.3.3',
'version' => '2.3.3.0',
@@ -200,29 +200,20 @@
'dev_requirement' => false,
),
'phpmailer/phpmailer' => array(
'pretty_version' => 'v6.6.5',
'version' => '6.6.5.0',
'reference' => '8b6386d7417526d1ea4da9edb70b8352f7543627',
'pretty_version' => 'v6.8.0',
'version' => '6.8.0.0',
'reference' => 'df16b615e371d81fb79e506277faea67a1be18f1',
'type' => 'library',
'install_path' => __DIR__ . '/../phpmailer/phpmailer',
'aliases' => array(),
'dev_requirement' => false,
),
'phpoption/phpoption' => array(
'pretty_version' => '1.9.0',
'version' => '1.9.0.0',
'reference' => 'dc5ff11e274a90cc1c743f66c9ad700ce50db9ab',
'phpoffice/phpspreadsheet' => array(
'pretty_version' => '1.28.0',
'version' => '1.28.0.0',
'reference' => '6e81cf39bbd93ebc3a4e8150444c41e8aa9b769a',
'type' => 'library',
'install_path' => __DIR__ . '/../phpoption/phpoption',
'aliases' => array(),
'dev_requirement' => false,
),
'pimple/pimple' => array(
'pretty_version' => 'v3.5.0',
'version' => '3.5.0.0',
'reference' => 'a94b3a4db7fb774b3d78dad2315ddc07629e1bed',
'type' => 'library',
'install_path' => __DIR__ . '/../pimple/pimple',
'install_path' => __DIR__ . '/../phpoffice/phpspreadsheet',
'aliases' => array(),
'dev_requirement' => false,
),
@@ -235,12 +226,6 @@
'aliases' => array(),
'dev_requirement' => false,
),
'psr/cache-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '1.0|2.0',
),
),
'psr/container' => array(
'pretty_version' => '1.1.1',
'version' => '1.1.1.0',
@@ -265,16 +250,10 @@
'aliases' => array(),
'dev_requirement' => false,
),
'psr/event-dispatcher-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '1.0',
),
),
'psr/http-client' => array(
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621',
'pretty_version' => '1.0.2',
'version' => '1.0.2.0',
'reference' => '0955afe48220520692d2d09f7ab7e0f93ffd6a31',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/http-client',
'aliases' => array(),
@@ -287,9 +266,9 @@
),
),
'psr/http-factory' => array(
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be',
'pretty_version' => '1.0.2',
'version' => '1.0.2.0',
'reference' => 'e616d01114759c4c489f93b099585439f795fe35',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/http-factory',
'aliases' => array(),
@@ -302,9 +281,9 @@
),
),
'psr/http-message' => array(
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363',
'pretty_version' => '1.1',
'version' => '1.1.0.0',
'reference' => 'cb6ce4845ce34a8ad9e68117c10ee90a29919eba',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/http-message',
'aliases' => array(),
@@ -317,9 +296,9 @@
),
),
'psr/log' => array(
'pretty_version' => '2.0.0',
'version' => '2.0.0.0',
'reference' => 'ef29f6d262798707a9edd554e2b82517ef3a9376',
'pretty_version' => '3.0.0',
'version' => '3.0.0.0',
'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/log',
'aliases' => array(),
@@ -341,12 +320,6 @@
'aliases' => array(),
'dev_requirement' => false,
),
'psr/simple-cache-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '1.0|2.0',
),
),
'ralouphie/getallheaders' => array(
'pretty_version' => '3.0.3',
'version' => '3.0.3.0',
@@ -356,34 +329,10 @@
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/cache' => array(
'pretty_version' => 'v5.4.15',
'version' => '5.4.15.0',
'reference' => '60e87188abbacd29ccde44d69c5392a33e888e98',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/cache',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/cache-contracts' => array(
'pretty_version' => 'v2.5.2',
'version' => '2.5.2.0',
'reference' => '64be4a7acb83b6f2bf6de9a02cee6dad41277ebc',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/cache-contracts',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/cache-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '1.0|2.0',
),
),
'symfony/console' => array(
'pretty_version' => 'v6.0.15',
'version' => '6.0.15.0',
'reference' => 'b0b910724a0a0326b4481e4f8a30abb2dd442efb',
'pretty_version' => 'v6.0.19',
'version' => '6.0.19.0',
'reference' => 'c3ebc83d031b71c39da318ca8b7a07ecc67507ed',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/console',
'aliases' => array(),
@@ -398,48 +347,6 @@
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/event-dispatcher' => array(
'pretty_version' => 'v6.0.9',
'version' => '6.0.9.0',
'reference' => '5c85b58422865d42c6eb46f7693339056db098a8',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/event-dispatcher',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/event-dispatcher-contracts' => array(
'pretty_version' => 'v3.0.2',
'version' => '3.0.2.0',
'reference' => '7bc61cc2db649b4637d331240c5346dcc7708051',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/event-dispatcher-contracts',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/event-dispatcher-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '2.0|3.0',
),
),
'symfony/finder' => array(
'pretty_version' => 'v6.0.11',
'version' => '6.0.11.0',
'reference' => '09cb683ba5720385ea6966e5e06be2a34f2568b1',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/finder',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/http-foundation' => array(
'pretty_version' => 'v6.0.15',
'version' => '6.0.15.0',
'reference' => 'a93829f4043fdcddebabd8433bdb46c2dcaefe06',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/http-foundation',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/polyfill-ctype' => array(
'pretty_version' => 'v1.27.0',
'version' => '1.27.0.0',
@@ -476,15 +383,6 @@
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/polyfill-php73' => array(
'pretty_version' => 'v1.27.0',
'version' => '1.27.0.0',
'reference' => '9e8ecb5f92152187c4799efd3c96b78ccab18ff9',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php73',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/polyfill-php80' => array(
'pretty_version' => 'v1.27.0',
'version' => '1.27.0.0',
@@ -494,15 +392,6 @@
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/psr-http-message-bridge' => array(
'pretty_version' => 'v2.1.3',
'version' => '2.1.3.0',
'reference' => 'd444f85dddf65c7e57c58d8e5b3a4dbb593b1840',
'type' => 'symfony-bridge',
'install_path' => __DIR__ . '/../symfony/psr-http-message-bridge',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/service-contracts' => array(
'pretty_version' => 'v2.5.2',
'version' => '2.5.2.0',
@@ -513,18 +402,18 @@
'dev_requirement' => false,
),
'symfony/string' => array(
'pretty_version' => 'v6.0.15',
'version' => '6.0.15.0',
'reference' => '51ac0fa0ccf132a00519b87c97e8f775fa14e771',
'pretty_version' => 'v6.0.19',
'version' => '6.0.19.0',
'reference' => 'd9e72497367c23e08bf94176d2be45b00a9d232a',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/string',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/translation' => array(
'pretty_version' => 'v5.4.14',
'version' => '5.4.14.0',
'reference' => 'f0ed07675863aa6e3939df8b1bc879450b585cab',
'pretty_version' => 'v5.4.22',
'version' => '5.4.22.0',
'reference' => '9a401392f01bc385aa42760eff481d213a0cc2ba',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/translation',
'aliases' => array(),
@@ -545,19 +434,19 @@
0 => '2.3',
),
),
'symfony/var-exporter' => array(
'pretty_version' => 'v6.0.10',
'version' => '6.0.10.0',
'reference' => 'e3df004a8d0fb572c420a6915cd23db9254c8366',
'symfony/var-dumper' => array(
'pretty_version' => 'v6.0.19',
'version' => '6.0.19.0',
'reference' => 'eb980457fa6899840fe1687e8627a03a7d8a3d52',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/var-exporter',
'install_path' => __DIR__ . '/../symfony/var-dumper',
'aliases' => array(),
'dev_requirement' => false,
),
'topthink/think-cache' => array(
'pretty_version' => 'v2.0.6',
'version' => '2.0.6.0',
'reference' => '75a56b24affc65b51688fd89ada48c102757fd74',
'pretty_version' => 'v2.0.7',
'version' => '2.0.7.0',
'reference' => '7b6ace7eb9b569fe95000b254000bbafa3c7dfee',
'type' => 'library',
'install_path' => __DIR__ . '/../topthink/think-cache',
'aliases' => array(),
@@ -591,18 +480,18 @@
'dev_requirement' => false,
),
'topthink/think-orm' => array(
'pretty_version' => 'v2.0.55',
'version' => '2.0.55.0',
'reference' => 'e1974a4c3b1b4c5b808fcc0863fc254e711dee13',
'pretty_version' => 'v3.0.8',
'version' => '3.0.8.0',
'reference' => '172ff8f14a62f83f5c060c47b704b1d5ce80561b',
'type' => 'library',
'install_path' => __DIR__ . '/../topthink/think-orm',
'aliases' => array(),
'dev_requirement' => false,
),
'topthink/think-template' => array(
'pretty_version' => 'v2.0.8',
'version' => '2.0.8.0',
'reference' => 'abfc293f74f9ef5127b5c416310a01fe42e59368',
'pretty_version' => 'v2.0.9',
'version' => '2.0.9.0',
'reference' => '6d25642ae0e306166742fd7073dc7a159e18073c',
'type' => 'library',
'install_path' => __DIR__ . '/../topthink/think-template',
'aliases' => array(),
@@ -617,37 +506,37 @@
'aliases' => array(),
'dev_requirement' => false,
),
'vlucas/phpdotenv' => array(
'pretty_version' => 'v5.5.0',
'version' => '5.5.0.0',
'reference' => '1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7',
'webman/captcha' => array(
'pretty_version' => 'v1.0.2',
'version' => '1.0.2.0',
'reference' => '00ea47505c5aa92b116ca914f5733e2eb326719a',
'type' => 'library',
'install_path' => __DIR__ . '/../vlucas/phpdotenv',
'install_path' => __DIR__ . '/../webman/captcha',
'aliases' => array(),
'dev_requirement' => false,
),
'webman/console' => array(
'pretty_version' => 'v1.2.12',
'version' => '1.2.12.0',
'reference' => '3f86741e4c2d9e8a48cd419721c75a8fd74d2a37',
'pretty_version' => 'v1.2.33',
'version' => '1.2.33.0',
'reference' => '081cc2ccb41c48fb6a0e30999e1dd7704efe9e93',
'type' => 'library',
'install_path' => __DIR__ . '/../webman/console',
'aliases' => array(),
'dev_requirement' => false,
),
'webman/event' => array(
'pretty_version' => 'v1.0.2',
'version' => '1.0.2.0',
'reference' => 'db17d2fd6a5a8799f97f587b17a26b814901e01a',
'pretty_version' => 'v1.0.4',
'version' => '1.0.4.0',
'reference' => 'f4478941c3b7efa4d7e9c063f2f6efd7ee3071a7',
'type' => 'library',
'install_path' => __DIR__ . '/../webman/event',
'aliases' => array(),
'dev_requirement' => false,
),
'webman/gateway-worker' => array(
'pretty_version' => 'v1.0.4',
'version' => '1.0.4.0',
'reference' => '4921663553b4f9f15bb4bf5207f6a324b0926e24',
'pretty_version' => 'v1.0.5',
'version' => '1.0.5.0',
'reference' => '9954c7c05934a5938eee79419fc27b4221094233',
'type' => 'library',
'install_path' => __DIR__ . '/../webman/gateway-worker',
'aliases' => array(),
@@ -663,63 +552,63 @@
'dev_requirement' => false,
),
'webman/think-cache' => array(
'pretty_version' => 'v1.0.1',
'version' => '1.0.1.0',
'reference' => '25bd103d7fc9347aca680e677282db761cc90a43',
'pretty_version' => 'v1.0.2',
'version' => '1.0.2.0',
'reference' => '0420d03a564e3513b7578ec475c6699ec02cd081',
'type' => 'library',
'install_path' => __DIR__ . '/../webman/think-cache',
'aliases' => array(),
'dev_requirement' => false,
),
'webman/think-orm' => array(
'pretty_version' => 'v1.0.11',
'version' => '1.0.11.0',
'reference' => '174876df10d917b81a5bbffef56dbc9628e9bd9a',
'pretty_version' => 'v1.1.0',
'version' => '1.1.0.0',
'reference' => 'e044e4ca66d387f489018a998c9d1e409ffc40b6',
'type' => 'library',
'install_path' => __DIR__ . '/../webman/think-orm',
'aliases' => array(),
'dev_requirement' => false,
),
'workerman/gateway-worker' => array(
'pretty_version' => 'v3.0.25',
'version' => '3.0.25.0',
'reference' => '5b47eb9a90c6b2afc25327979e41de352cb3c286',
'pretty_version' => 'v3.0.28',
'version' => '3.0.28.0',
'reference' => 'a7dffc53403133131a51b9fd3c6c6d70869cb6d3',
'type' => 'library',
'install_path' => __DIR__ . '/../workerman/gateway-worker',
'aliases' => array(),
'dev_requirement' => false,
),
'workerman/redis' => array(
'pretty_version' => 'v1.0.11',
'version' => '1.0.11.0',
'reference' => '14f77108d3498fbc84cd8b10cb48c18f09661458',
'pretty_version' => 'v2.0.1',
'version' => '2.0.1.0',
'reference' => '284f93cccc03603e616cf96b8cab847fe6b33b6a',
'type' => 'library',
'install_path' => __DIR__ . '/../workerman/redis',
'aliases' => array(),
'dev_requirement' => false,
),
'workerman/redis-queue' => array(
'pretty_version' => 'v1.0.10',
'version' => '1.0.10.0',
'reference' => 'b8286b4086a852fd588a98453f3dc7ed63bd79fe',
'pretty_version' => 'v1.1.0',
'version' => '1.1.0.0',
'reference' => 'e325f5b09cd170a327597876f1d659cd81510388',
'type' => 'library',
'install_path' => __DIR__ . '/../workerman/redis-queue',
'aliases' => array(),
'dev_requirement' => false,
),
'workerman/webman-framework' => array(
'pretty_version' => 'v1.4.7',
'version' => '1.4.7.0',
'reference' => 'e9815557f08dffd3a41b54f709a98619aab84f16',
'pretty_version' => 'v1.5.5',
'version' => '1.5.5.0',
'reference' => '7c2a987e43077ce85b2ee242f64cae791fd7976f',
'type' => 'library',
'install_path' => __DIR__ . '/../workerman/webman-framework',
'aliases' => array(),
'dev_requirement' => false,
),
'workerman/workerman' => array(
'pretty_version' => 'v4.1.4',
'version' => '4.1.4.0',
'reference' => '83e007acf936e2233ac92d7368b87716f2bae338',
'pretty_version' => 'v4.1.9',
'version' => '4.1.9.0',
'reference' => '1f92d02c26106b5fbe6f61ea776198aad6e426f7',
'type' => 'library',
'install_path' => __DIR__ . '/../workerman/workerman',
'aliases' => array(),

View File

@@ -0,0 +1,47 @@
name: Tests
on: [push, pull_request]
jobs:
php-tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
php: [8.2, 8.1, 8.0, 7.4, 7.3, 7.2, 7.1]
dependency-version: [prefer-stable]
os: [ubuntu-latest, windows-latest]
name: ${{ matrix.os }} - PHP${{ matrix.php }} - ${{ matrix.dependency-version }}
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout code
uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
- name: Install dependencies
run: |
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/phpunit
- name: Code Sniffer
run: vendor/bin/phpcs

View File

@@ -1,6 +1,6 @@
# PHP 7.1 enums
[![Build Status](https://travis-ci.org/DASPRiD/Enum.svg?branch=master)](https://travis-ci.org/DASPRiD/Enum)
[![Build Status](https://github.com/DASPRiD/Enum/actions/workflows/tests.yml/badge.svg)](https://github.com/DASPRiD/Enum/actions?query=workflow%3Atests)
[![Coverage Status](https://coveralls.io/repos/github/DASPRiD/Enum/badge.svg?branch=master)](https://coveralls.io/github/DASPRiD/Enum?branch=master)
[![Latest Stable Version](https://poser.pugx.org/dasprid/enum/v/stable)](https://packagist.org/packages/dasprid/enum)
[![Total Downloads](https://poser.pugx.org/dasprid/enum/downloads)](https://packagist.org/packages/dasprid/enum)

View File

@@ -14,9 +14,12 @@
"enum",
"map"
],
"require": {
"php": ">=7.1 <9.0"
},
"require-dev": {
"phpunit/phpunit": "^7 | ^8 | ^9",
"squizlabs/php_codesniffer": "^3.4"
"squizlabs/php_codesniffer": "*"
},
"autoload": {
"psr-4": {

View File

@@ -88,6 +88,31 @@ final class EnumMap implements Serializable, IteratorAggregate
$this->values = array_fill(0, count($this->keyUniverse), null);
}
public function __serialize(): array
{
$values = [];
foreach ($this->values as $ordinal => $value) {
if (null === $value) {
continue;
}
$values[$ordinal] = $this->unmaskNull($value);
}
return [
'keyType' => $this->keyType,
'valueType' => $this->valueType,
'allowNullValues' => $this->allowNullValues,
'values' => $values,
];
}
public function __unserialize(array $data): void
{
$this->unserialize(serialize($data));
}
/**
* Checks whether the map types match the supplied ones.
*
@@ -261,22 +286,7 @@ final class EnumMap implements Serializable, IteratorAggregate
public function serialize() : string
{
$values = [];
foreach ($this->values as $ordinal => $value) {
if (null === $value) {
continue;
}
$values[$ordinal] = $this->unmaskNull($value);
}
return serialize([
'keyType' => $this->keyType,
'valueType' => $this->valueType,
'allowNullValues' => $this->allowNullValues,
'values' => $values,
]);
return serialize($this->__serialize());
}
public function unserialize($serialized) : void

View File

@@ -1,29 +0,0 @@
<?php
$header = <<<EOF
This file is part of the EasyWeChatComposer.
(c) 张铭阳 <mingyoungcheung@gmail.com>
This source file is subject to the MIT license that is bundled
with this source code in the file LICENSE.
EOF;
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'header_comment' => ['header' => $header],
'declare_strict_types' => true,
'ordered_imports' => true,
'strict_comparison' => true,
'no_empty_comment' => false,
'yoda_style' => false,
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude('vendor')
->notPath('src/Laravel/config.php', 'src/Laravel/routes.php')
->in(__DIR__)
)
;

View File

@@ -1,12 +0,0 @@
language: php
php:
- 7.0
- 7.1
- 7.2
- 7.3
install:
- travis_retry composer install --no-interaction --no-suggest
script: ./vendor/bin/phpunit

View File

@@ -1,55 +0,0 @@
<p align="center">
<h1 align="center">EasyWeChat Composer Plugin</h1>
</p>
<p align="center">
<a href="https://travis-ci.org/mingyoung/easywechat-composer"><img src="https://travis-ci.org/mingyoung/easywechat-composer.svg" alt="Build Status"></a>
<a href="https://scrutinizer-ci.com/g/mingyoung/easywechat-composer/?branch=master"><img src="https://scrutinizer-ci.com/g/mingyoung/easywechat-composer/badges/quality-score.png?b=master" alt="Scrutinizer Code Quality"></a>
<a href="https://packagist.org/packages/easywechat-composer/easywechat-composer"><img src="https://poser.pugx.org/easywechat-composer/easywechat-composer/v/stable.svg" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/easywechat-composer/easywechat-composer"><img src="https://poser.pugx.org/easywechat-composer/easywechat-composer/d/total.svg" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/easywechat-composer/easywechat-composer"><img src="https://poser.pugx.org/easywechat-composer/easywechat-composer/license.svg" alt="License"></a>
</p>
Usage
---
Set the `type` to be `easywechat-extension` in your package composer.json file:
```json
{
"name": "your/package",
"type": "easywechat-extension"
}
```
Specify server observer classes in the extra section:
```json
{
"name": "your/package",
"type": "easywechat-extension",
"extra": {
"observers": [
"Acme\\Observers\\Handler"
]
}
}
```
Examples
---
* [easywechat-composer/open-platform-testcase](https://github.com/mingyoung/open-platform-testcase)
Server Delegation
---
> 目前仅支持 Laravel
1.`config/app.php` 中添加 `EasyWeChatComposer\Laravel\ServiceProvider::class`
2. 在**本地项目**的 `.env` 文件中添加如下配置:
```
EASYWECHAT_DELEGATION=true # false 则不启用
EASYWECHAT_DELEGATION_HOST=https://example.com # 线上域名
```

View File

@@ -1,35 +0,0 @@
{
"name": "easywechat-composer/easywechat-composer",
"description": "The composer plugin for EasyWeChat",
"type": "composer-plugin",
"license": "MIT",
"authors": [
{
"name": "张铭阳",
"email": "mingyoungcheung@gmail.com"
}
],
"require": {
"php": ">=7.0",
"composer-plugin-api": "^1.0 || ^2.0"
},
"require-dev": {
"composer/composer": "^1.0 || ^2.0",
"phpunit/phpunit": "^6.5 || ^7.0"
},
"autoload": {
"psr-4": {
"EasyWeChatComposer\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"EasyWeChatComposer\\Tests\\": "tests/"
}
},
"extra": {
"class": "EasyWeChatComposer\\Plugin"
},
"minimum-stability": "dev",
"prefer-stable": true
}

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.0/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
forceCoversAnnotation="true"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
verbose="true">
<testsuite name="EasyWeChatComposer Test">
<directory suffix="Test.php">tests</directory>
</testsuite>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>

Some files were not shown because too many files have changed in this diff Show More