升级核心框架,layui2.6.6
This commit is contained in:
parent
1a3cc0ec84
commit
8d08968173
@ -20,11 +20,11 @@ class AuthRule extends AdminController
|
||||
$count = count($auth_rules);
|
||||
$res = [];
|
||||
if($auth_rules){
|
||||
$res = ['code'=>0,'msg'=>'','count'=>$count];
|
||||
$res = ['code'=>0,'msg'=>'ok','count'=>$count];
|
||||
|
||||
foreach($auth_rules as $k => $v){
|
||||
//$data = $v->getData();
|
||||
$data = ['id'=>$v['id'],'sort'=>$v['sort'],'title'=>str_repeat('---',$v['level']*2).$v['title'],'name'=>$v['name'],'icon'=>$v['icon'],'status'=>$v['status'],'level'=>$v['level']+1,'ishidden'=>$v['ishidden']];
|
||||
$data = ['id'=>$v['id'],'pid'=>$v['pid'],'title'=>$v['title'],'url'=>$v['name'],'icon'=>$v['icon'],'status'=>$v['status'],'isMenu'=>$v['ishidden'],'sort'=>$v['sort'],'ctime'=>$v['create_time']];
|
||||
$res['data'][] = $data;
|
||||
}
|
||||
}
|
||||
@ -33,6 +33,58 @@ class AuthRule extends AdminController
|
||||
return View::fetch();
|
||||
|
||||
}
|
||||
|
||||
//权限树
|
||||
public function tree()
|
||||
{
|
||||
|
||||
//$res = $this->treeTr($this->getMenus());
|
||||
//var_dump($res);
|
||||
/*
|
||||
支持获取三级菜单
|
||||
*/
|
||||
$result = $this->getMenus();
|
||||
|
||||
$count = count($result);
|
||||
$tree = [];
|
||||
if($result){
|
||||
$tree = ['code'=>0,'msg'=>'','count'=>$count];
|
||||
|
||||
$res = []; //auth_rule储存数据表中的表结构
|
||||
foreach($result as $k => $v){
|
||||
//第一层子权限
|
||||
$children = [];
|
||||
if(isset($v['children'])){
|
||||
|
||||
foreach($v['children'] as $m => $j){
|
||||
//第二层子权限
|
||||
$chichi = [];
|
||||
if(isset($j['children'])){
|
||||
//第三层子权限
|
||||
foreach($j as $s){
|
||||
if(isset($s['children'])){
|
||||
$chichi[] = ['id'=>$s['id'],'title'=>$s['title'],'pid'=>$s['pid']]; //子数据的子数据
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//if($j['level'] < 3){}
|
||||
$children[] = ['id'=>$j['id'],'title'=>$j['title'],'pid'=>$j['pid'],'children'=>$chichi]; //子数据
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$data[] = ['id'=>$v['id'],'title'=>$v['title'],'pid'=>$v['pid'],'children'=>$children];
|
||||
|
||||
}
|
||||
|
||||
//构造一个顶级菜单pid=0的数组。把权限放入顶级菜单下子权限中
|
||||
$tree['data'][] = ['id'=>0,'title'=>'顶级','pid'=>0,'children'=>$data];
|
||||
}
|
||||
|
||||
return json($tree);
|
||||
}
|
||||
|
||||
//添加权限
|
||||
public function add()
|
||||
{
|
||||
@ -66,7 +118,7 @@ class AuthRule extends AdminController
|
||||
$rule = new AuthRuleModel();
|
||||
|
||||
if(Request::isAjax()){
|
||||
$data = Request::param();
|
||||
$data = Request::param(['id','pid','title','name','icon','sort','ishidden']);
|
||||
$ruId = $rule->find($data['pid']); //查询出上级ID
|
||||
if($ruId){
|
||||
$plevel = $ruId->level; //上级level等级
|
||||
|
124
app/admin/controller/FileManager.php
Normal file
124
app/admin/controller/FileManager.php
Normal file
@ -0,0 +1,124 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
header('Content-Type:application/json; charset=utf-8');
|
||||
|
||||
use app\common\controller\AdminController;
|
||||
use think\facade\View;
|
||||
use AngularFilemanager\LocalBridge\FileManagerApi;
|
||||
use AngularFilemanager\LocalBridge\Rest;
|
||||
use taoler\com\Api;
|
||||
|
||||
|
||||
|
||||
include '../extend/AngularFilemanager/LocalBridge/Response.php';
|
||||
include '../extend/AngularFilemanager/LocalBridge/Rest.php';
|
||||
include '../extend/AngularFilemanager/LocalBridge/Translate.php';
|
||||
include '../extend/AngularFilemanager/LocalBridge/FileManagerApi.php';
|
||||
|
||||
|
||||
class FileManager extends AdminController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
public function handler()
|
||||
{
|
||||
$fileManagerApi = new FileManagerApi();
|
||||
|
||||
$rest = new Rest();
|
||||
$rest->post([$fileManagerApi, 'postHandler'])
|
||||
->get([$fileManagerApi, 'getHandler'])
|
||||
->handle();
|
||||
}
|
||||
|
||||
public function data()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
$url = 'http://api.aieok.com/v1/handler';
|
||||
/*
|
||||
$data = json([
|
||||
'action'=>'list',
|
||||
'path'=> '/'
|
||||
])->header([
|
||||
'Cache-control' => 'no-cache,must-revalidate',
|
||||
'Content-Type' => 'application/json'
|
||||
]);
|
||||
|
||||
*/
|
||||
$datas = [
|
||||
'action'=>'list',
|
||||
'path'=> '/'
|
||||
];
|
||||
$jsonStr = json_encode($datas);
|
||||
list($returnCode, $returnContent) = $this->http_post_json($url, $jsonStr);
|
||||
|
||||
if($returnCode == 200){
|
||||
$res = trim($returnContent,'"');
|
||||
return json_decode($res);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//var_dump($data);
|
||||
//$apiRes = Api::urlPost($url,$data);
|
||||
//var_dump($apiRes);
|
||||
|
||||
//return $apiRes;
|
||||
|
||||
|
||||
//$path = app()->getRootPath();
|
||||
// var_dump($path);
|
||||
//Listing (URL: fileManagerConfig.listUrl, Method: POST)
|
||||
|
||||
/*
|
||||
$fileManagerApi = new FileManagerApi();
|
||||
$file = $fileManagerApi->listActionData('/');
|
||||
|
||||
$data['result'] = $file;
|
||||
|
||||
|
||||
*/
|
||||
//$rest = new Rest('post');
|
||||
//$rest->post([$fileManagerApi, 'postHandler'])
|
||||
// ->get([$fileManagerApi, 'getHandler'])
|
||||
// ->handle();
|
||||
|
||||
//$res = $fileManagerApi->postHandler([],['action'=>'list', 'path'=>'../'],'');
|
||||
//$rest = new Rest();
|
||||
//$rest->post([$fileManagerApi, 'postHandler'])
|
||||
//->handle();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function http_post_json($url, $jsonStr)
|
||||
{
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT, 20);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
||||
'Content-Type: application/json; charset=utf-8',
|
||||
|
||||
)
|
||||
);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0); // ÏÔʾ·µ»ØµÄHeaderÇøÓòÄÚÈÝ
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonStr);
|
||||
$response = curl_exec($ch);
|
||||
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_close($ch);
|
||||
|
||||
return array($httpCode,$response);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,42 +7,40 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">上级菜单</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="pid" lay-verify="required">
|
||||
<option value="0">顶级菜单</option>
|
||||
{volist name="AuthRule" id="vo"}
|
||||
<option value="{$vo.id}"><?php echo str_repeat('--',$vo['level']*2) ?>{$vo.title}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
<div id="menuSelectBox" class="ew-xmselect-tree"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">权限名</label>
|
||||
<label class="layui-form-label">菜单名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="title" lay-verify="required" placeholder="请输入权限名" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="title" lay-verify="required" placeholder="请输入菜单名" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">权限地址</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="name" lay-verify="required" placeholder="请输入邮箱" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="name" lay-verify="required" placeholder="请输入权限地址" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">图标</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="icon" lay-verify="" placeholder="请输入角色类型" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="icon" id="iconPicker" lay-filter="iconPicker" style="display:none;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">排序</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="sort" lay-verify="" placeholder="请输入角色类型" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="sort" lay-verify="" placeholder="排序序号" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">显示</label>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">类型</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" name="ishidden" lay-skin="primary" title="隐藏" value="0">
|
||||
<input type="radio" name="ishidden" lay-skin="primary" title="目录" value="-1">
|
||||
<input type="radio" name="ishidden" lay-skin="primary" title="菜单" value="1" checked>
|
||||
<input type="radio" name="ishidden" lay-skin="primary" title="按钮" value="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-hide">
|
||||
@ -57,9 +55,63 @@
|
||||
base: '/static/admin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form'], function(){
|
||||
}).use(['index', 'form','admin', 'xmSelect', 'iconPicker'], function(){
|
||||
var $ = layui.$
|
||||
,form = layui.form ;
|
||||
})
|
||||
var admin = layui.admin;
|
||||
var xmSelect = layui.xmSelect;
|
||||
var iconPicker = layui.iconPicker;
|
||||
|
||||
|
||||
//初始化图标选择
|
||||
iconPicker.render({
|
||||
elem: '#iconPicker',
|
||||
type: 'fontClass',
|
||||
search: false,
|
||||
page: true,
|
||||
limit: 12,
|
||||
click: function (data) {
|
||||
//console.log(data);
|
||||
}
|
||||
});
|
||||
|
||||
//权限菜单结构
|
||||
admin.req({
|
||||
type: "post",
|
||||
url: "{:url('AuthRule/tree')}",
|
||||
data:{},
|
||||
done:function(res){
|
||||
var data = res.data;
|
||||
|
||||
// 渲染下拉树
|
||||
xmSelect.render({
|
||||
el: '#menuSelectBox',
|
||||
name: 'pid',
|
||||
height: '250px',
|
||||
layVerify: 'required',
|
||||
layVerType: 'tips',
|
||||
data: data,
|
||||
initValue: [],
|
||||
model: {label: {type: 'text'}},
|
||||
prop: {
|
||||
name: 'title',
|
||||
value: 'id'
|
||||
},
|
||||
radio: true,
|
||||
clickClose: true,
|
||||
tree: {
|
||||
show: true,
|
||||
indent: 15,
|
||||
strict: false,
|
||||
expandedKeys: true
|
||||
},
|
||||
tips: '请选择上级菜单'
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
{/block}
|
@ -10,16 +10,11 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">上级菜单</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="pid" lay-verify="required">
|
||||
<option value="0">顶级菜单</option>
|
||||
{volist name="AuthRule" id="vo"}
|
||||
<option {if condition="$rules['pid'] eq $vo.id"} selected {/if} value="{$vo.id}"><?php echo str_repeat('--',$vo['level']*2) ?>{$vo.title}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
<div id="menuSelectBox" class="ew-xmselect-tree"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">权限名</label>
|
||||
<label class="layui-form-label">菜单名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="title" lay-verify="required" placeholder="请输入权限名" autocomplete="off" class="layui-input" value="{$rules.title}">
|
||||
</div>
|
||||
@ -27,25 +22,27 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">权限地址</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="name" lay-verify="required" placeholder="请输入邮箱" autocomplete="off" class="layui-input" value="{$rules.name}">
|
||||
<input type="text" name="name" lay-verify="required" placeholder="请输入权限地址" autocomplete="off" class="layui-input" value="{$rules.name}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">图标</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="icon" lay-verify="" placeholder="请输入角色类型" autocomplete="off" class="layui-input" value="{$rules.icon}">
|
||||
<input type="text" name="icon" id="iconPicker" lay-filter="iconPicker" value="{$rules.icon}" style="display:none;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">排序</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="sort" lay-verify="required" placeholder="请输入角色类型" autocomplete="off" class="layui-input" value="{$rules.sort}">
|
||||
<input type="text" name="sort" lay-verify="required" placeholder="排序序号" autocomplete="off" class="layui-input" value="{$rules.sort}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">显示</label>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">类型</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" name="ishidden" lay-skin="primary" title="隐藏" {if condition="$rules.ishidden == 0"}checked{/if}>
|
||||
<input type="radio" name="ishidden" lay-skin="primary" title="目录" value="-1" {if condition="$rules.ishidden == -1"}checked{/if}>
|
||||
<input type="radio" name="ishidden" lay-skin="primary" title="菜单" value="1" {if condition="$rules.ishidden == 1"}checked{/if}>
|
||||
<input type="radio" name="ishidden" lay-skin="primary" title="按钮" value="0" {if condition="$rules.ishidden == 0"}checked{/if}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-hide">
|
||||
@ -60,9 +57,66 @@
|
||||
base: '/static/admin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form'], function(){
|
||||
}).use(['index', 'form','admin', 'xmSelect', 'iconPicker'], function(){
|
||||
var $ = layui.$
|
||||
,form = layui.form ;
|
||||
|
||||
var admin = layui.admin;
|
||||
var xmSelect = layui.xmSelect;
|
||||
var iconPicker = layui.iconPicker;
|
||||
|
||||
|
||||
//初始化图标选择
|
||||
iconPicker.render({
|
||||
elem: '#iconPicker',
|
||||
type: 'fontClass',
|
||||
search: false,
|
||||
page: true,
|
||||
limit: 12,
|
||||
click: function (data) {
|
||||
//console.log(data);
|
||||
}
|
||||
});
|
||||
|
||||
//权限菜单结构
|
||||
admin.req({
|
||||
type: "post",
|
||||
url: "{:url('AuthRule/tree')}",
|
||||
data:{},
|
||||
done:function(res){
|
||||
var data = res.data;
|
||||
|
||||
// 渲染下拉树
|
||||
xmSelect.render({
|
||||
el: '#menuSelectBox',
|
||||
name: 'pid',
|
||||
height: '250px',
|
||||
layVerify: 'required',
|
||||
layVerType: 'tips',
|
||||
data: data,
|
||||
initValue: [{$rules['pid']}],
|
||||
model: {label: {type: 'text'}},
|
||||
prop: {
|
||||
name: 'title',
|
||||
value: 'id'
|
||||
},
|
||||
radio: true,
|
||||
clickClose: true,
|
||||
tree: {
|
||||
show: true,
|
||||
indent: 15,
|
||||
strict: false,
|
||||
expandedKeys: true
|
||||
},
|
||||
tips: '请选择上级菜单'
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
</script>
|
||||
{/block}
|
@ -1,269 +1,319 @@
|
||||
|
||||
{extend name="public:base" /}
|
||||
|
||||
{block name="css"}<link rel="stylesheet" href="/static/admin/tree/css/treeTable.css">{/block}
|
||||
{block name="body"}
|
||||
<div class="layui-fluid">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">权限菜单</div>
|
||||
|
||||
<div class="layui-card-body">
|
||||
<div style="padding-bottom: 10px;">
|
||||
<button class="layui-btn layuiadmin-btn-admin" data-type="add">添加</button>
|
||||
</div>
|
||||
<table id="LAY-user-auth-rule" lay-filter="LAY-user-auth-rule"></table>
|
||||
|
||||
<script type="text/html" id="rules-title">
|
||||
<span >{{# if(d.level !==1){ }}|{{# } }} {{d.title}}</span>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="buttonAuth">
|
||||
{if condition="checkRuleButton('admin/authrule/check')"}<input type="checkbox" name="status" lay-skin="switch" lay-filter="authcheck" lay-text="开启|关闭" {{# if(d.status == 1){ }} checked {{# } }} id="{{d.id}}" >
|
||||
{else /}<button class="layui-btn layui-btn-xs layui-btn-radius layui-btn-disabled">无权限</button>{/if}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="menu">
|
||||
{{# if(d.id == '1' | d.id == '2' | d.id == '9' | d.id == '10' ){ }}
|
||||
<input type="checkbox" name="ishidden" lay-skin="primary" checked disabled >
|
||||
{{# } else { }}
|
||||
{if condition="checkRuleButton('admin/authrule/menushow')"}<input type="checkbox" name="ishidden" lay-skin="primary" lay-filter="menu-show" {{# if(d.ishidden ==1){ }}checked value="0"{{# } else { }}value="1"{{# } }} id="{{d.id}}" >
|
||||
{else /}<input type="checkbox" title="禁用" disabled> {/if}
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="table-authrule-edit">
|
||||
{if condition="checkRuleButton('admin/authrule/edit')"}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
|
||||
{else /}<a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-disabled"><i class="layui-icon layui-icon-edit"></i>编辑</a>{/if}
|
||||
{{# if(d.id == '1' | d.id == '2' | d.id == '9' | d.id == '10' ){ }}
|
||||
<a class="layui-btn layui-btn-disabled layui-btn-xs"><i class="layui-icon layui-icon-delete"></i>删除</a>
|
||||
{{# } else { }}
|
||||
{if condition="checkRuleButton('admin/authrule/delete')"}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
|
||||
{else /}<a class="layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled"><i class="layui-icon layui-icon-delete"></i>删除</a>{/if}
|
||||
{{# } }}
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<body class="layui-hide">
|
||||
|
||||
<div class="page-wrapper">
|
||||
|
||||
<div class="demo-side">
|
||||
<table id="LAY-user-auth-rule"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 表格操作列 -->
|
||||
<script type="text/html" id="tbBar">
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a>
|
||||
<!--a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a-->
|
||||
{{# if(d.id == '1' | d.id == '2' | d.id == '9' | d.id == '10' ){ }}<a class="layui-btn layui-btn-disabled layui-btn-xs">删除</a>
|
||||
{{# } else { }}
|
||||
{if condition="checkRuleButton('admin/authrule/delete')"}<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
||||
{else /}<a class="layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled">删除</a>{/if}
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
|
||||
{block name="js"}
|
||||
<script>
|
||||
var userList = "{:url('User/list')}";
|
||||
var userDelete = "{:url('User/delete')}";
|
||||
var userEdit = "{:url('User/userEdit')}";
|
||||
var adminIndex = "{:url('Admin/index')}";
|
||||
var adminDelete = "{:url('Admin/delete')}";
|
||||
var adminEdit = "{:url('Admin/edit')}";
|
||||
var authGroupList = "{:url('AuthGroup/list')}";
|
||||
var authGroupRoledel = "{:url('AuthGroup/roleDel')}";
|
||||
var authGroupRoleEdit = "{:url('AuthGroup/roleEdit')}";
|
||||
var authAccessIndex = "{:url('AuthAccess/index')}";
|
||||
var authAccessDelete = "{:url('AuthAccess/delete')}";
|
||||
var authAccessEdit = "{:url('AuthAccess/edit')}";
|
||||
var authRuleIndex = "{:url('AuthRule/index')}";
|
||||
var authRuleDelete = "{:url('AuthRule/delete')}";
|
||||
var authRuleEdit = "{:url('AuthRule/edit')}";
|
||||
layui.config({
|
||||
base: '/static/admin/modules/'
|
||||
}).use(['layer', 'util', 'treeTable'], function () {
|
||||
var $ = layui.jquery;
|
||||
var layer = layui.layer;
|
||||
var util = layui.util;
|
||||
var treeTable = layui.treeTable;
|
||||
$('body').removeClass('layui-hide');
|
||||
|
||||
</script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: '/static/admin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'useradmin', 'table', 'form'], function(){
|
||||
var $ = layui.$
|
||||
,form = layui.form
|
||||
,table = layui.table;
|
||||
|
||||
//监听搜索
|
||||
form.on('submit(LAY-user-back-search)', function(data){
|
||||
var field = data.field;
|
||||
|
||||
//执行重载
|
||||
table.reload('LAY-user-auth-rule', {
|
||||
where: field
|
||||
});
|
||||
});
|
||||
//排序
|
||||
table.on('edit(LAY-user-auth-rule)',function(obj){
|
||||
var data = obj.data; //得到所在行所有键值
|
||||
$.ajax({
|
||||
type:'post',
|
||||
url:"{:url('admin/AuthRule/sort')}",
|
||||
data:{id:data.id,sort:data.sort},
|
||||
dataType:'json',
|
||||
success:function(data){
|
||||
if(data.code == 0){
|
||||
layer.msg(data.msg,{
|
||||
icon:6,
|
||||
time:2000
|
||||
}
|
||||
)
|
||||
} else {
|
||||
layer.open({
|
||||
title:'排序失败',
|
||||
content:data.msg,
|
||||
icon:5,
|
||||
adim:6
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//菜单控制
|
||||
form.on('checkbox(menu-show)', function(data){
|
||||
var data = data.elem;
|
||||
if(data.checked == true){
|
||||
data.value = 1;
|
||||
}else{
|
||||
data.value = 0;
|
||||
// 渲染表格
|
||||
var insTb = treeTable.render({
|
||||
elem: '#LAY-user-auth-rule',
|
||||
url: "{:url('AuthRule/index')}",
|
||||
toolbar: 'default',
|
||||
//height: 'full-200',
|
||||
tree: {
|
||||
iconIndex: 2,
|
||||
isPidData: true,
|
||||
idName: 'id',
|
||||
pidName: 'pid'
|
||||
},
|
||||
defaultToolbar: ['filter', 'print', 'exports'],
|
||||
cols: [
|
||||
[
|
||||
{type: 'numbers'},
|
||||
{type: 'checkbox'},
|
||||
{field: 'title', title: '菜单名称', minWidth: 165},
|
||||
{field: 'url', title: '菜单地址', rowspan: 2},
|
||||
{
|
||||
title: '菜单图标', align: 'center',
|
||||
templet: '<p><i class="layui-icon {{d.icon}}"></i></p>'
|
||||
},
|
||||
{field: 'authority', title: '权限标识'},
|
||||
{field: 'isMenu', title: '类型', templet: type, align: 'center', width: 60},
|
||||
//{title: '类型', templet: '<p>{{d.isMenu ? "菜单" : "按钮"}}</p>', align: 'center', width: 60},
|
||||
{field: 'sort', title: '排序', align: 'center', width: 60},
|
||||
{field: 'ctime',title: '创建时间'},
|
||||
{align: 'center', toolbar: '#tbBar', title: '操作', width: 120}
|
||||
]
|
||||
],
|
||||
style: 'margin-top:0;'
|
||||
});
|
||||
|
||||
//自定义“状态”列
|
||||
function type(data) {
|
||||
var isMenu = data.isMenu;
|
||||
var btns = "";
|
||||
if (isMenu == -1) {
|
||||
return "目录";
|
||||
}
|
||||
if (isMenu == 1) {
|
||||
btns += '<span class="layui-btn layui-btn-sm">菜单</span>';
|
||||
//return "菜单";
|
||||
}
|
||||
if (isMenu == 0) {
|
||||
btns += '<span class="layui-btn layui-btn-normal layui-btn-sm">按钮</span>';
|
||||
//return "按钮";
|
||||
}
|
||||
return btns;
|
||||
}
|
||||
$.ajax({
|
||||
type:'post',
|
||||
url:"{:url('admin/AuthRule/menushow')}",
|
||||
data:{"id":data.id,"ishidden":data.value,},
|
||||
dataType:'json',
|
||||
success:function(data){
|
||||
if(data.code == 0){
|
||||
layer.msg(data.msg,{
|
||||
icon:6,
|
||||
time:2000
|
||||
}
|
||||
//,function(){location.reload();}
|
||||
);
|
||||
} else {
|
||||
layer.open({
|
||||
title:'修改失败',
|
||||
content:data.msg,
|
||||
icon:5,
|
||||
adim:6
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
//权限开关
|
||||
form.on('switch(authcheck)', function(data){
|
||||
var data= data.elem;
|
||||
if(data.checked == true){
|
||||
data.value = 1;
|
||||
}else{
|
||||
data.value = 0;
|
||||
}
|
||||
$.ajax({
|
||||
type:'post',
|
||||
url:"{:url('admin/AuthRule/check')}",
|
||||
data:{id:data.id,status:data.value,},
|
||||
dataType:'json',
|
||||
success:function(data){
|
||||
if(data.code == 0){
|
||||
layer.msg(data.msg,{
|
||||
icon:6,
|
||||
time:2000
|
||||
}
|
||||
//,function(){location.reload();}
|
||||
);
|
||||
} else {
|
||||
layer.open({
|
||||
title:'审核失败',
|
||||
content:data.msg,
|
||||
icon:5,
|
||||
adim:6
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
//事件
|
||||
var active = {
|
||||
batchdel: function(){
|
||||
var checkStatus = table.checkStatus('LAY-user-auth-rule')
|
||||
,checkData = checkStatus.data; //得到选中的数据
|
||||
|
||||
if(checkData.length === 0){
|
||||
return layer.msg('请选择数据');
|
||||
}
|
||||
|
||||
layer.prompt({
|
||||
formType: 1
|
||||
,title: '敏感操作,请验证口令'
|
||||
}, function(value, index){
|
||||
layer.close(index);
|
||||
|
||||
layer.confirm('确定删除吗?', function(index) {
|
||||
|
||||
//执行 Ajax 后重载
|
||||
/*
|
||||
admin.req({
|
||||
url: 'xxx'
|
||||
//,……
|
||||
});
|
||||
*/
|
||||
table.reload('LAY-user-auth-rule');
|
||||
layer.msg('已删除');
|
||||
});
|
||||
});
|
||||
}
|
||||
,add: function(){
|
||||
layer.open({
|
||||
type: 2
|
||||
,title: '添加权限'
|
||||
,content: 'add.html'
|
||||
,area: ['420px', '420px']
|
||||
,btn: ['确定', '取消']
|
||||
,yes: function(index, layero){
|
||||
var iframeWindow = window['layui-layer-iframe'+ index]
|
||||
,submitID = 'LAY-user-rule-submit'
|
||||
,submit = layero.find('iframe').contents().find('#'+ submitID);
|
||||
|
||||
//监听提交
|
||||
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
//提交 Ajax 成功后,静态更新表格中的数据
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"{:url('admin/AuthRule/add')}",
|
||||
data:{"pid":field.pid,"title":field.title,"name":field.name,"icon":field.icon,"sort":field.sort,"ishidden":field.ishidden},
|
||||
daType:"json",
|
||||
success:function (data){
|
||||
if (data.code == 0) {
|
||||
layer.msg(data.msg,{
|
||||
icon:6,
|
||||
time:2000
|
||||
}, function(){
|
||||
location.reload();
|
||||
// 工具列点击事件
|
||||
treeTable.on('tool(LAY-user-auth-rule)', function (obj) {
|
||||
var event = obj.event;
|
||||
var data = obj.data;
|
||||
if (event === 'del') {
|
||||
|
||||
layer.prompt({
|
||||
formType: 1
|
||||
,title: '敏感操作,请验证口令'
|
||||
}, function(value, index){
|
||||
layer.close(index);
|
||||
layer.confirm('确定删除此权限?', function(index){
|
||||
$.ajax({
|
||||
type:'post',
|
||||
url:"{:url('AuthRule/delete')}",
|
||||
data:{id:data.id},
|
||||
dataType:'json',
|
||||
success:function(data){
|
||||
if(data.code == 0){
|
||||
layer.msg(data.msg,{
|
||||
icon:6,
|
||||
time:2000
|
||||
},function(){
|
||||
location.reload();
|
||||
});
|
||||
} else {
|
||||
layer.open({
|
||||
title:'删除失败',
|
||||
content:data.msg,
|
||||
icon:5,
|
||||
adim:6
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.open({
|
||||
title:'添加失败',
|
||||
content:data.msg,
|
||||
icon:5,
|
||||
anim:6
|
||||
layer.close(index);
|
||||
});
|
||||
});
|
||||
|
||||
} else if (event === 'edit') {
|
||||
|
||||
layer.open({
|
||||
type: 2
|
||||
,title: '编辑权限'
|
||||
,content: "{:url('AuthRule/edit')}" +'?id='+ data.id
|
||||
,area: ['420px', '550px']
|
||||
,btn: ['确定', '取消']
|
||||
,yes: function(index, layero){
|
||||
var iframeWindow = window['layui-layer-iframe'+ index]
|
||||
,submitID = 'LAY-user-rule-submit'
|
||||
,submit = layero.find('iframe').contents().find('#'+ submitID);
|
||||
|
||||
//监听提交
|
||||
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
//提交 Ajax 成功后,静态更新表格中的数据
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"{:url('AuthRule/edit')}",
|
||||
data:{"id":field.id,"pid":field.pid,"title":field.title,"name":field.name,"icon":field.icon,"sort":field.sort,"ishidden":field.ishidden},
|
||||
daType:"json",
|
||||
success:function (res){
|
||||
if (res.code == 0) {
|
||||
layer.msg(res.msg,{
|
||||
icon:6,
|
||||
time:2000
|
||||
}, function(){
|
||||
location.reload();
|
||||
});
|
||||
} else {
|
||||
layer.open({
|
||||
tiele:'修改失败',
|
||||
content:res.msg,
|
||||
icon:5,
|
||||
anim:6
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//treeTable.reload('LAY-user-auth-rule'); //数据刷新
|
||||
layer.close(index); //关闭弹层
|
||||
});
|
||||
|
||||
submit.trigger('click');
|
||||
}
|
||||
}
|
||||
});
|
||||
table.reload('LAY-user-front-submit'); //数据刷新
|
||||
layer.close(index); //关闭弹层
|
||||
});
|
||||
|
||||
submit.trigger('click');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
$('.layui-btn.layuiadmin-btn-admin').on('click', function(){
|
||||
var type = $(this).data('type');
|
||||
active[type] ? active[type].call(this) : '';
|
||||
,success: function(layero, index){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 头部工具栏点击事件
|
||||
treeTable.on('toolbar(LAY-user-auth-rule)', function (obj) {
|
||||
switch (obj.event) {
|
||||
case 'add':
|
||||
layer.msg('添加');
|
||||
layer.open({
|
||||
type: 2
|
||||
,title: '添加权限'
|
||||
,content: 'add.html'
|
||||
,area: ['420px', '550px']
|
||||
,btn: ['确定', '取消']
|
||||
,yes: function(index, layero){
|
||||
var iframeWindow = window['layui-layer-iframe'+ index]
|
||||
,submitID = 'LAY-user-rule-submit'
|
||||
,submit = layero.find('iframe').contents().find('#'+ submitID);
|
||||
|
||||
//监听提交
|
||||
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
//提交 Ajax 成功后,静态更新表格中的数据
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"{:url('AuthRule/add')}",
|
||||
data:{"pid":field.pid,"title":field.title,"name":field.name,"icon":field.icon,"sort":field.sort,"ishidden":field.ishidden},
|
||||
daType:"json",
|
||||
success:function (data){
|
||||
if (data.code == 0) {
|
||||
layer.msg(data.msg,{
|
||||
icon:6,
|
||||
time:2000
|
||||
}, function(){
|
||||
location.reload();
|
||||
});
|
||||
} else {
|
||||
layer.open({
|
||||
title:'添加失败',
|
||||
content:data.msg,
|
||||
icon:5,
|
||||
anim:6
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
treeTable.reload('LAY-user-auth-rule'); //数据刷新
|
||||
layer.close(index); //关闭弹层
|
||||
});
|
||||
|
||||
submit.trigger('click');
|
||||
}
|
||||
});
|
||||
|
||||
break;
|
||||
case 'delete':
|
||||
layer.msg('删除');
|
||||
break;
|
||||
case 'update':
|
||||
layer.msg('编辑');
|
||||
break;
|
||||
case 'LAYTABLE_TIPS':
|
||||
layer.msg('提示');
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
// 全部展开
|
||||
$('#btnExpandAll').click(function () {
|
||||
insTb.expandAll();
|
||||
});
|
||||
|
||||
// 全部折叠
|
||||
$('#btnFoldAll').click(function () {
|
||||
insTb.foldAll();
|
||||
});
|
||||
|
||||
// 展开指定
|
||||
$('#btnExpand').click(function () {
|
||||
insTb.expand(2);
|
||||
});
|
||||
|
||||
// 折叠指定
|
||||
$('#btnFold').click(function () {
|
||||
insTb.fold(2);
|
||||
});
|
||||
|
||||
// 设置选中
|
||||
$('#btnChecked').click(function () {
|
||||
insTb.expand(4);
|
||||
insTb.setChecked([4]);
|
||||
});
|
||||
|
||||
// 搜索
|
||||
$('#btnSearch').click(function () {
|
||||
var keywords = $('#edtSearch').val();
|
||||
if (keywords) {
|
||||
insTb.filterData(keywords);
|
||||
} else {
|
||||
insTb.clearFilter();
|
||||
}
|
||||
});
|
||||
|
||||
// 清除搜索
|
||||
$('#btnClearSearch').click(function () {
|
||||
insTb.clearFilter();
|
||||
});
|
||||
|
||||
// 重载
|
||||
$('#btnReload').click(function () {
|
||||
insTb.reload();
|
||||
});
|
||||
$('#btnRefresh').click(function () {
|
||||
insTb.refresh();
|
||||
});
|
||||
|
||||
// 获取选中
|
||||
$('#btnGetChecked').click(function () {
|
||||
layer.alert('<pre>' + JSON.stringify(insTb.checkStatus().map(function (d) {
|
||||
return {
|
||||
authorityName: d.authorityName,
|
||||
authorityId: d.authorityId,
|
||||
LAY_INDETERMINATE: d.LAY_INDETERMINATE
|
||||
};
|
||||
}), null, 3) + '</pre>');
|
||||
});
|
||||
|
||||
// 演示侧边栏
|
||||
$('#btnToggleSide').click(function () {
|
||||
$('.demo-side').toggleClass('show');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
</script>
|
||||
{/block}
|
80
app/admin/view/file_manager/index.html
Normal file
80
app/admin/view/file_manager/index.html
Normal file
@ -0,0 +1,80 @@
|
||||
<!doctype html>
|
||||
<html lang="en" data-ng-app="FileManagerApp">
|
||||
<head>
|
||||
<!--
|
||||
* Angular FileManager v1.5.1 (https://github.com/joni2back/angular-filemanager)
|
||||
* Jonas Sciangula Street <joni2back@gmail.com>
|
||||
* Licensed under MIT (https://github.com/joni2back/angular-filemanager/blob/master/LICENSE)
|
||||
-->
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
|
||||
<meta charset="utf-8">
|
||||
<title>angular-filemanager</title>
|
||||
|
||||
<!-- third party -->
|
||||
<script src="/file/node_modules/jquery/dist/jquery.min.js"></script>
|
||||
<script src="/file/node_modules/angular/angular.min.js"></script>
|
||||
<script src="/file/node_modules/angular-translate/dist/angular-translate.min.js"></script>
|
||||
<script src="/file/node_modules/ng-file-upload/dist/ng-file-upload.min.js"></script>
|
||||
<script src="/file/node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<link rel="stylesheet" href="/file/node_modules/bootswatch/paper/bootstrap.min.css" />
|
||||
<!-- /third party -->
|
||||
|
||||
<!-- Uncomment if you need to use raw source code-->
|
||||
<script src="/file/src/js/app.js"></script>
|
||||
<script src="/file/src/js/directives/directives.js"></script>
|
||||
<script src="/file/src/js/filters/filters.js"></script>
|
||||
<script src="/file/src/js/providers/config.js"></script>
|
||||
<script src="/file/src/js/entities/chmod.js"></script>
|
||||
<script src="/file/src/js/entities/item.js"></script>
|
||||
<script src="/file/src/js/services/apihandler.js"></script>
|
||||
<script src="/file/src/js/services/apimiddleware.js"></script>
|
||||
<script src="/file/src/js/services/filenavigator.js"></script>
|
||||
<script src="/file/src/js/providers/translations.js"></script>
|
||||
<script src="/file/src/js/controllers/main.js"></script>
|
||||
<script src="/file/src/js/controllers/selector-controller.js"></script>
|
||||
<link href="/file/src/css/animations.css" rel="stylesheet">
|
||||
<link href="/file/src/css/dialogs.css" rel="stylesheet">
|
||||
<link href="/file/src/css/main.css" rel="stylesheet">
|
||||
|
||||
|
||||
<!-- Comment if you need to use raw source code
|
||||
<link href="/file/dist/angular-filemanager.min.css" rel="stylesheet">
|
||||
<script src="/file/dist/angular-filemanager.min.js"></script>
|
||||
/Comment if you need to use raw source code -->
|
||||
|
||||
<script type="text/javascript">
|
||||
//example to override angular-filemanager default config
|
||||
angular.module('FileManagerApp').config(['fileManagerConfigProvider', function (config) {
|
||||
var defaults = config.$get();
|
||||
config.set({
|
||||
appName: 'angular-filemanager',
|
||||
listUrl: '/FileManager/data',
|
||||
pickCallback: function(item) {
|
||||
var msg = 'Picked %s "%s" for external use'
|
||||
.replace('%s', item.type)
|
||||
.replace('%s', item.fullPath());
|
||||
window.alert(msg);
|
||||
},
|
||||
|
||||
allowedActions: angular.extend(defaults.allowedActions, {
|
||||
pickFiles: false,
|
||||
pickFolders: false,
|
||||
}),
|
||||
});
|
||||
}]);
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="ng-cloak">
|
||||
<angular-filemanager></angular-filemanager>
|
||||
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
ga('create', 'UA-35182652-1', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -26,7 +26,8 @@
|
||||
"phpmailer/phpmailer": "^6.1",
|
||||
"zzstudio/think-addons": "^2.0",
|
||||
"firebase/php-jwt": "^5.2",
|
||||
"lotofbadcode/phpspirit_databackup": "^1.1"
|
||||
"lotofbadcode/phpspirit_databackup": "^1.1",
|
||||
"wamkj/thinkphp6.0-databackup": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/var-dumper": "^4.2",
|
||||
|
178
composer.lock
generated
178
composer.lock
generated
@ -4,20 +4,20 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "f4ac487289cab0dba8660f5759f64a21",
|
||||
"content-hash": "c6dc1dcd45b2b2cd2e7bd36c0e76eb04",
|
||||
"packages": [
|
||||
{
|
||||
"name": "firebase/php-jwt",
|
||||
"version": "v5.2.0",
|
||||
"version": "v5.2.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/firebase/php-jwt.git",
|
||||
"reference": "feb0e820b8436873675fd3aca04f3728eb2185cb"
|
||||
"reference": "f42c9110abe98dd6cfe9053c49bc86acc70b2d23"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/firebase/php-jwt/zipball/feb0e820b8436873675fd3aca04f3728eb2185cb",
|
||||
"reference": "feb0e820b8436873675fd3aca04f3728eb2185cb",
|
||||
"url": "https://api.github.com/repos/firebase/php-jwt/zipball/f42c9110abe98dd6cfe9053c49bc86acc70b2d23",
|
||||
"reference": "f42c9110abe98dd6cfe9053c49bc86acc70b2d23",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -62,9 +62,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/firebase/php-jwt/issues",
|
||||
"source": "https://github.com/firebase/php-jwt/tree/master"
|
||||
"source": "https://github.com/firebase/php-jwt/tree/v5.2.1"
|
||||
},
|
||||
"time": "2020-03-25T18:49:23+00:00"
|
||||
"time": "2021-02-12T00:02:00+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/flysystem",
|
||||
@ -338,16 +338,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpmailer/phpmailer",
|
||||
"version": "v6.2.0",
|
||||
"version": "v6.4.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
||||
"reference": "e38888a75c070304ca5514197d4847a59a5c853f"
|
||||
"reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e38888a75c070304ca5514197d4847a59a5c853f",
|
||||
"reference": "e38888a75c070304ca5514197d4847a59a5c853f",
|
||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/9256f12d8fb0cd0500f93b19e18c356906cbed3d",
|
||||
"reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -371,7 +371,7 @@
|
||||
"yoast/phpunit-polyfills": "^0.2.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mbstring": "Needed to send email in multibyte encoding charset",
|
||||
"ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
|
||||
"hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
|
||||
"league/oauth2-google": "Needed for Google XOAUTH2 authentication",
|
||||
"psr/log": "For optional PSR-3 debug logging",
|
||||
@ -408,7 +408,7 @@
|
||||
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
||||
"support": {
|
||||
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
|
||||
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.2.0"
|
||||
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.4.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -416,7 +416,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2020-11-25T15:24:57+00:00"
|
||||
"time": "2021-04-29T12:25:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/cache",
|
||||
@ -475,16 +475,16 @@
|
||||
},
|
||||
{
|
||||
"name": "psr/container",
|
||||
"version": "1.0.0",
|
||||
"version": "1.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/container.git",
|
||||
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
|
||||
"reference": "8622567409010282b7aeebe4bb841fe98b58dcaf"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
|
||||
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
|
||||
"url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf",
|
||||
"reference": "8622567409010282b7aeebe4bb841fe98b58dcaf",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -494,14 +494,9 @@
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
"php": ">=7.2.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Container\\": "src/"
|
||||
@ -514,7 +509,7 @@
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
"homepage": "https://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common Container Interface (PHP FIG PSR-11)",
|
||||
@ -528,22 +523,22 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/php-fig/container/issues",
|
||||
"source": "https://github.com/php-fig/container/tree/master"
|
||||
"source": "https://github.com/php-fig/container/tree/1.1.1"
|
||||
},
|
||||
"time": "2017-02-14T16:28:37+00:00"
|
||||
"time": "2021-03-05T17:36:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
"version": "1.1.3",
|
||||
"version": "1.1.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/log.git",
|
||||
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
|
||||
"reference": "d49695b909c3b7628b6289db5479a1c204601f11"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
|
||||
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
|
||||
"reference": "d49695b909c3b7628b6289db5479a1c204601f11",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -573,7 +568,7 @@
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
"homepage": "https://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interface for logging libraries",
|
||||
@ -584,9 +579,9 @@
|
||||
"psr-3"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/log/tree/1.1.3"
|
||||
"source": "https://github.com/php-fig/log/tree/1.1.4"
|
||||
},
|
||||
"time": "2020-03-23T09:12:05+00:00"
|
||||
"time": "2021-05-03T11:20:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/simple-cache",
|
||||
@ -706,16 +701,16 @@
|
||||
},
|
||||
{
|
||||
"name": "topthink/framework",
|
||||
"version": "v6.0.7",
|
||||
"version": "v6.0.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/top-think/framework.git",
|
||||
"reference": "db8fe22520a9660dd5e4c87e304034ac49e39270"
|
||||
"reference": "4789343672aef06d571d556da369c0e156609bce"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/framework/zipball/db8fe22520a9660dd5e4c87e304034ac49e39270",
|
||||
"reference": "db8fe22520a9660dd5e4c87e304034ac49e39270",
|
||||
"url": "https://api.github.com/repos/top-think/framework/zipball/4789343672aef06d571d556da369c0e156609bce",
|
||||
"reference": "4789343672aef06d571d556da369c0e156609bce",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -771,9 +766,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/top-think/framework/issues",
|
||||
"source": "https://github.com/top-think/framework/tree/v6.0.7"
|
||||
"source": "https://github.com/top-think/framework/tree/v6.0.8"
|
||||
},
|
||||
"time": "2021-01-25T14:48:29+00:00"
|
||||
"time": "2021-04-27T00:41:08+00:00"
|
||||
},
|
||||
{
|
||||
"name": "topthink/think-captcha",
|
||||
@ -939,16 +934,16 @@
|
||||
},
|
||||
{
|
||||
"name": "topthink/think-orm",
|
||||
"version": "v2.0.36",
|
||||
"version": "v2.0.40",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/top-think/think-orm.git",
|
||||
"reference": "f48dc09050f25029d41a66bfc9c3c403e4f82024"
|
||||
"reference": "1119d979b850849f3725856460cf108eec1c3eb8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/think-orm/zipball/f48dc09050f25029d41a66bfc9c3c403e4f82024",
|
||||
"reference": "f48dc09050f25029d41a66bfc9c3c403e4f82024",
|
||||
"url": "https://api.github.com/repos/top-think/think-orm/zipball/1119d979b850849f3725856460cf108eec1c3eb8",
|
||||
"reference": "1119d979b850849f3725856460cf108eec1c3eb8",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -959,17 +954,23 @@
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"ext-pdo": "*",
|
||||
"php": ">=7.1.0",
|
||||
"psr/log": "~1.0",
|
||||
"psr/simple-cache": "^1.0",
|
||||
"topthink/think-helper": "^3.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^7|^8|^9.5"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"think\\": "src"
|
||||
},
|
||||
"files": []
|
||||
"files": [
|
||||
"stubs/load_stubs.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
@ -988,9 +989,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/top-think/think-orm/issues",
|
||||
"source": "https://github.com/top-think/think-orm/tree/v2.0.36"
|
||||
"source": "https://github.com/top-think/think-orm/tree/v2.0.40"
|
||||
},
|
||||
"time": "2021-01-12T09:08:52+00:00"
|
||||
"time": "2021-04-19T13:29:37+00:00"
|
||||
},
|
||||
{
|
||||
"name": "topthink/think-template",
|
||||
@ -1086,6 +1087,57 @@
|
||||
},
|
||||
"time": "2019-11-06T11:40:13+00:00"
|
||||
},
|
||||
{
|
||||
"name": "wamkj/thinkphp6.0-databackup",
|
||||
"version": "v1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/wamkj/thinkphp6.0-databackup.git",
|
||||
"reference": "28a0e406d827132942723a3c9f69bb20c98e652f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/wamkj/thinkphp6.0-databackup/zipball/28a0e406d827132942723a3c9f69bb20c98e652f",
|
||||
"reference": "28a0e406d827132942723a3c9f69bb20c98e652f",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1.0",
|
||||
"topthink/framework": "^6.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"wamkj\\thinkphp\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"Apache-2.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "wamkj",
|
||||
"email": "1149183529@qq.com"
|
||||
}
|
||||
],
|
||||
"description": "thinkphp6.0的数据库自动备份扩展",
|
||||
"keywords": [
|
||||
"think-databackup",
|
||||
"thinkphp"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/wamkj/thinkphp6.0-databackup/issues",
|
||||
"source": "https://github.com/wamkj/thinkphp6.0-databackup/tree/v1.0"
|
||||
},
|
||||
"time": "2020-02-15T13:04:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "zzstudio/think-addons",
|
||||
"version": "2.0.5",
|
||||
@ -1152,16 +1204,16 @@
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.22.0",
|
||||
"version": "v1.22.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13"
|
||||
"reference": "5232de97ee3b75b0360528dae24e73db49566ab1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f377a3dd1fde44d37b9831d68dc8dea3ffd28e13",
|
||||
"reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1",
|
||||
"reference": "5232de97ee3b75b0360528dae24e73db49566ab1",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -1218,7 +1270,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.0"
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -1234,11 +1286,11 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2021-01-07T16:49:33+00:00"
|
||||
"time": "2021-01-22T09:19:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php72",
|
||||
"version": "v1.22.0",
|
||||
"version": "v1.22.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php72.git",
|
||||
@ -1300,7 +1352,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php72/tree/v1.22.0"
|
||||
"source": "https://github.com/symfony/polyfill-php72/tree/v1.22.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -1320,7 +1372,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php80",
|
||||
"version": "v1.22.0",
|
||||
"version": "v1.22.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php80.git",
|
||||
@ -1389,7 +1441,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php80/tree/v1.22.0"
|
||||
"source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -1409,16 +1461,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"version": "v4.4.19",
|
||||
"version": "v4.4.22",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-dumper.git",
|
||||
"reference": "a1eab2f69906dc83c5ddba4632180260d0ab4f7f"
|
||||
"reference": "c194bcedde6295f3ec3e9eba1f5d484ea97c41a7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/a1eab2f69906dc83c5ddba4632180260d0ab4f7f",
|
||||
"reference": "a1eab2f69906dc83c5ddba4632180260d0ab4f7f",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/c194bcedde6295f3ec3e9eba1f5d484ea97c41a7",
|
||||
"reference": "c194bcedde6295f3ec3e9eba1f5d484ea97c41a7",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -1484,7 +1536,7 @@
|
||||
"dump"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/var-dumper/tree/v4.4.19"
|
||||
"source": "https://github.com/symfony/var-dumper/tree/v4.4.22"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -1500,7 +1552,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2021-01-27T09:09:26+00:00"
|
||||
"time": "2021-04-19T13:36:17+00:00"
|
||||
},
|
||||
{
|
||||
"name": "topthink/think-trace",
|
||||
|
@ -7,7 +7,7 @@ return [
|
||||
//应用名,此项不可更改
|
||||
'appname' => 'TaoLer',
|
||||
//版本配置
|
||||
'version' => '1.7.1',
|
||||
'version' => '1.7.3',
|
||||
//加盐
|
||||
'salt' => 'taoler',
|
||||
//数据库备份目录
|
||||
|
662
extend/AngularFilemanager/LocalBridge/FileManagerApi.php
Normal file
662
extend/AngularFilemanager/LocalBridge/FileManagerApi.php
Normal file
@ -0,0 +1,662 @@
|
||||
<?php
|
||||
namespace AngularFilemanager\LocalBridge;
|
||||
|
||||
use AngularFilemanager\LocalBridge\Translate;
|
||||
|
||||
/**
|
||||
* File Manager API Class
|
||||
*
|
||||
* Made for PHP Local filesystem bridge for angular-filemanager to handle file manipulations
|
||||
* @author Jakub Ďuraš <jakub@duras.me>
|
||||
*/
|
||||
class FileManagerApi
|
||||
{
|
||||
private $basePath = null;
|
||||
|
||||
private $translate;
|
||||
|
||||
public function __construct($basePath = null, $lang = 'en', $muteErrors = true)
|
||||
{
|
||||
if ($muteErrors) {
|
||||
ini_set('display_errors', 0);
|
||||
}
|
||||
|
||||
$this->basePath = $basePath ?: dirname(__DIR__);
|
||||
$this->translate = new Translate($lang);
|
||||
}
|
||||
|
||||
public function postHandler($query, $request, $files)
|
||||
{
|
||||
$t = $this->translate;
|
||||
|
||||
// Probably file upload
|
||||
if (!isset($request['action'])
|
||||
&& (isset($_SERVER["CONTENT_TYPE"])
|
||||
&& strpos($_SERVER["CONTENT_TYPE"], 'multipart/form-data') !== false)
|
||||
) {
|
||||
$uploaded = $this->uploadAction($request['destination'], $files);
|
||||
if ($uploaded === true) {
|
||||
$response = $this->simpleSuccessResponse();
|
||||
} else {
|
||||
$response = $this->simpleErrorResponse($t->upload_failed);
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
switch ($request['action']) {
|
||||
case 'list':
|
||||
$list = $this->listAction($request['path']);
|
||||
|
||||
if (!is_array($list)) {
|
||||
$response = $this->simpleErrorResponse($t->listing_failed);
|
||||
} else {
|
||||
$response = new Response();
|
||||
$response->setData([
|
||||
'result' => $list
|
||||
]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'rename':
|
||||
$renamed = $this->renameAction($request['item'], $request['newItemPath']);
|
||||
if ($renamed === true) {
|
||||
$response = $this->simpleSuccessResponse();
|
||||
} elseif ($renamed === 'notfound') {
|
||||
$response = $this->simpleErrorResponse($t->file_not_found);
|
||||
} else {
|
||||
$response = $this->simpleErrorResponse($t->renaming_failed);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'move':
|
||||
$moved = $this->moveAction($request['items'], $request['newPath']);
|
||||
if ($moved === true) {
|
||||
$response = $this->simpleSuccessResponse();
|
||||
} else {
|
||||
$response = $this->simpleErrorResponse($t->moving_failed);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'copy':
|
||||
$copied = $this->copyAction($request['items'], $request['newPath']);
|
||||
if ($copied === true) {
|
||||
$response = $this->simpleSuccessResponse();
|
||||
} else {
|
||||
$response = $this->simpleErrorResponse($t->copying_failed);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'remove':
|
||||
$removed = $this->removeAction($request['items']);
|
||||
if ($removed === true) {
|
||||
$response = $this->simpleSuccessResponse();
|
||||
} elseif ($removed === 'notempty') {
|
||||
$response = $this->simpleErrorResponse($t->removing_failed_directory_not_empty);
|
||||
} else {
|
||||
$response = $this->simpleErrorResponse($t->removing_failed);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'edit':
|
||||
$edited = $this->editAction($request['item'], $request['content']);
|
||||
if ($edited !== false) {
|
||||
$response = $this->simpleSuccessResponse();
|
||||
} else {
|
||||
$response = $this->simpleErrorResponse($t->saving_failed);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'getContent':
|
||||
$content = $this->getContentAction($request['item']);
|
||||
if ($content !== false) {
|
||||
$response = new Response();
|
||||
$response->setData([
|
||||
'result' => $content
|
||||
]);
|
||||
} else {
|
||||
$response = $this->simpleErrorResponse($t->file_not_found);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'createFolder':
|
||||
$created = $this->createFolderAction($request['newPath']);
|
||||
if ($created === true) {
|
||||
$response = $this->simpleSuccessResponse();
|
||||
} elseif ($created === 'exists') {
|
||||
$response = $this->simpleErrorResponse($t->folder_already_exists);
|
||||
} else {
|
||||
$response = $this->simpleErrorResponse($t->folder_creation_failed);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'changePermissions':
|
||||
$changed = $this->changePermissionsAction($request['items'], $request['perms'], $request['recursive']);
|
||||
if ($changed === true) {
|
||||
$response = $this->simpleSuccessResponse();
|
||||
} elseif ($changed === 'missing') {
|
||||
$response = $this->simpleErrorResponse($t->file_not_found);
|
||||
} else {
|
||||
$response = $this->simpleErrorResponse($t->permissions_change_failed);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'compress':
|
||||
$compressed = $this->compressAction(
|
||||
$request['items'],
|
||||
$request['destination'],
|
||||
$request['compressedFilename']
|
||||
);
|
||||
if ($compressed === true) {
|
||||
$response = $this->simpleSuccessResponse();
|
||||
} else {
|
||||
$response = $this->simpleErrorResponse($t->compression_failed);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'extract':
|
||||
$extracted = $this->extractAction($request['destination'], $request['item'], $request['folderName']);
|
||||
if ($extracted === true) {
|
||||
$response = $this->simpleSuccessResponse();
|
||||
} elseif ($extracted === 'unsupported') {
|
||||
$response = $this->simpleErrorResponse($t->archive_opening_failed);
|
||||
} else {
|
||||
$response = $this->simpleErrorResponse($t->extraction_failed);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
$response = $this->simpleErrorResponse($t->function_not_implemented);
|
||||
break;
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function getHandler($queries)
|
||||
{
|
||||
$t = $this->translate;
|
||||
|
||||
switch ($queries['action']) {
|
||||
case 'download':
|
||||
$downloaded = $this->downloadAction($queries['path']);
|
||||
if ($downloaded === true) {
|
||||
exit;
|
||||
} else {
|
||||
$response = $this->simpleErrorResponse($t->file_not_found);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'downloadMultiple':
|
||||
$downloaded = $this->downloadMultipleAction($queries['items'], $queries['toFilename']);
|
||||
if ($downloaded === true) {
|
||||
exit;
|
||||
} else {
|
||||
$response = $this->simpleErrorResponse($t->file_not_found);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
$response = $this->simpleErrorResponse($t->function_not_implemented);
|
||||
break;
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
private function downloadAction($path)
|
||||
{
|
||||
$file_name = basename($path);
|
||||
$path = $this->canonicalizePath($this->basePath . $path);
|
||||
|
||||
if (!file_exists($path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||
$mime_type = finfo_file($finfo, $path);
|
||||
finfo_close($finfo);
|
||||
|
||||
if (ob_get_level()) {
|
||||
ob_end_clean();
|
||||
}
|
||||
|
||||
header("Content-Disposition: attachment; filename=\"$file_name\"");
|
||||
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
||||
header("Content-Type: $mime_type");
|
||||
header('Pragma: public');
|
||||
header('Content-Length: ' . filesize($path));
|
||||
readfile($path);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function downloadMultipleAction($items, $archiveName)
|
||||
{
|
||||
$archivePath = tempnam('../', 'archive');
|
||||
|
||||
$zip = new \ZipArchive();
|
||||
if ($zip->open($archivePath, \ZipArchive::CREATE) !== true) {
|
||||
unlink($archivePath);
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($items as $path) {
|
||||
$zip->addFile($this->basePath . $path, basename($path));
|
||||
}
|
||||
|
||||
$zip->close();
|
||||
|
||||
header("Content-Disposition: attachment; filename=\"$archiveName\"");
|
||||
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
||||
header("Content-Type: application/zip");
|
||||
header('Pragma: public');
|
||||
header('Content-Length: ' . filesize($archivePath));
|
||||
readfile($archivePath);
|
||||
|
||||
unlink($archivePath);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function uploadAction($path, $files)
|
||||
{
|
||||
$path = $this->canonicalizePath($this->basePath . $path);
|
||||
|
||||
foreach ($_FILES as $file) {
|
||||
$fileInfo = pathinfo($file['name']);
|
||||
$fileName = $this->normalizeName($fileInfo['filename']) . '.' . $fileInfo['extension'];
|
||||
|
||||
$uploaded = move_uploaded_file(
|
||||
$file['tmp_name'],
|
||||
$path . DIRECTORY_SEPARATOR . $fileName
|
||||
);
|
||||
if ($uploaded === false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function listAction($path)
|
||||
{
|
||||
$files = array_values(array_filter(
|
||||
scandir($this->basePath . $path),
|
||||
function ($path) {
|
||||
return !($path === '.' || $path === '..');
|
||||
}
|
||||
));
|
||||
|
||||
$files = array_map(function ($file) use ($path) {
|
||||
$file = $this->canonicalizePath(
|
||||
$this->basePath . $path . DIRECTORY_SEPARATOR . $file
|
||||
);
|
||||
$date = new \DateTime('@' . filemtime($file));
|
||||
|
||||
return [
|
||||
'name' => basename($file),
|
||||
'rights' => $this->parsePerms(fileperms($file)),
|
||||
'size' => filesize($file),
|
||||
'date' => $date->format('Y-m-d H:i:s'),
|
||||
'type' => is_dir($file) ? 'dir' : 'file'
|
||||
];
|
||||
}, $files);
|
||||
|
||||
return $files;
|
||||
}
|
||||
|
||||
public function listActionData($path)
|
||||
{
|
||||
$files = array_values(array_filter(
|
||||
scandir($this->basePath . $path),
|
||||
function ($path) {
|
||||
return !($path === '.' || $path === '..');
|
||||
}
|
||||
));
|
||||
|
||||
$files = array_map(function ($file) use ($path) {
|
||||
$file = $this->canonicalizePath(
|
||||
$this->basePath . $path . DIRECTORY_SEPARATOR . $file
|
||||
);
|
||||
$date = new \DateTime('@' . filemtime($file));
|
||||
|
||||
return [
|
||||
'name' => basename($file),
|
||||
'rights' => $this->parsePerms(fileperms($file)),
|
||||
'size' => filesize($file),
|
||||
'date' => $date->format('Y-m-d H:i:s'),
|
||||
'type' => is_dir($file) ? 'dir' : 'file'
|
||||
];
|
||||
}, $files);
|
||||
|
||||
return $files;
|
||||
}
|
||||
|
||||
private function renameAction($oldPath, $newPath)
|
||||
{
|
||||
$oldPath = $this->basePath . $oldPath;
|
||||
$newPath = $this->basePath . $newPath;
|
||||
|
||||
if (! file_exists($oldPath)) {
|
||||
return 'notfound';
|
||||
}
|
||||
|
||||
return rename($oldPath, $newPath);
|
||||
}
|
||||
|
||||
private function moveAction($oldPaths, $newPath)
|
||||
{
|
||||
$newPath = $this->basePath . $this->canonicalizePath($newPath) . DIRECTORY_SEPARATOR;
|
||||
|
||||
foreach ($oldPaths as $oldPath) {
|
||||
if (!file_exists($this->basePath . $oldPath)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$renamed = rename($this->basePath . $oldPath, $newPath . basename($oldPath));
|
||||
if ($renamed === false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function copyAction($oldPaths, $newPath)
|
||||
{
|
||||
$newPath = $this->basePath . $this->canonicalizePath($newPath) . DIRECTORY_SEPARATOR;
|
||||
|
||||
foreach ($oldPaths as $oldPath) {
|
||||
if (!file_exists($this->basePath . $oldPath)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$copied = copy(
|
||||
$this->basePath . $oldPath,
|
||||
$newPath . basename($oldPath)
|
||||
);
|
||||
if ($copied === false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function removeAction($paths)
|
||||
{
|
||||
foreach ($paths as $path) {
|
||||
$path = $this->canonicalizePath($this->basePath . $path);
|
||||
|
||||
if (is_dir($path)) {
|
||||
$dirEmpty = (new \FilesystemIterator($path))->valid();
|
||||
|
||||
if ($dirEmpty) {
|
||||
return 'notempty';
|
||||
} else {
|
||||
$removed = rmdir($path);
|
||||
}
|
||||
} else {
|
||||
$removed = unlink($path);
|
||||
}
|
||||
|
||||
if ($removed === false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function editAction($path, $content)
|
||||
{
|
||||
$path = $this->basePath . $path;
|
||||
return file_put_contents($path, $content);
|
||||
}
|
||||
|
||||
private function getContentAction($path)
|
||||
{
|
||||
$path = $this->basePath . $path;
|
||||
|
||||
if (! file_exists($path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return file_get_contents($path);
|
||||
}
|
||||
|
||||
private function createFolderAction($path)
|
||||
{
|
||||
$path = $this->basePath . $path;
|
||||
|
||||
if (file_exists($path) && is_dir($path)) {
|
||||
return 'exists';
|
||||
}
|
||||
|
||||
return mkdir($path);
|
||||
}
|
||||
|
||||
private function changePermissionsAction($paths, $permissions, $recursive)
|
||||
{
|
||||
foreach ($paths as $path) {
|
||||
if (!file_exists($this->basePath . $path)) {
|
||||
return 'missing';
|
||||
}
|
||||
|
||||
if (is_dir($path) && $recursive === true) {
|
||||
$iterator = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($path),
|
||||
RecursiveIteratorIterator::SELF_FIRST
|
||||
);
|
||||
|
||||
foreach ($iterator as $item) {
|
||||
$changed = chmod($this->basePath . $item, octdec($permissions));
|
||||
|
||||
if ($changed === false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return chmod($this->basePath . $path, octdec($permissions));
|
||||
}
|
||||
}
|
||||
|
||||
private function compressAction($paths, $destination, $archiveName)
|
||||
{
|
||||
$archivePath = $this->basePath . $destination . $archiveName;
|
||||
|
||||
$zip = new \ZipArchive();
|
||||
if ($zip->open($archivePath, \ZipArchive::CREATE) !== true) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($paths as $path) {
|
||||
$fullPath = $this->basePath . $path;
|
||||
|
||||
if (is_dir($fullPath)) {
|
||||
$dirs = [
|
||||
[
|
||||
'dir' => basename($path),
|
||||
'path' => $this->canonicalizePath($this->basePath . $path),
|
||||
]
|
||||
];
|
||||
|
||||
while (count($dirs)) {
|
||||
$dir = current($dirs);
|
||||
$zip->addEmptyDir($dir['dir']);
|
||||
|
||||
$dh = opendir($dir['path']);
|
||||
while ($file = readdir($dh)) {
|
||||
if ($file != '.' && $file != '..') {
|
||||
$filePath = $dir['path'] . DIRECTORY_SEPARATOR . $file;
|
||||
if (is_file($filePath)) {
|
||||
$zip->addFile(
|
||||
$dir['path'] . DIRECTORY_SEPARATOR . $file,
|
||||
$dir['dir'] . '/' . basename($file)
|
||||
);
|
||||
} elseif (is_dir($filePath)) {
|
||||
$dirs[] = [
|
||||
'dir' => $dir['dir'] . '/' . $file,
|
||||
'path' => $dir['path'] . DIRECTORY_SEPARATOR . $file
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
array_shift($dirs);
|
||||
}
|
||||
} else {
|
||||
$zip->addFile($path, basename($path));
|
||||
}
|
||||
}
|
||||
|
||||
return $zip->close();
|
||||
}
|
||||
|
||||
private function extractAction($destination, $archivePath, $folderName)
|
||||
{
|
||||
$archivePath = $this->basePath . $archivePath;
|
||||
$folderPath = $this->basePath . $this->canonicalizePath($destination) . DIRECTORY_SEPARATOR . $folderName;
|
||||
|
||||
$zip = new \ZipArchive;
|
||||
if ($zip->open($archivePath) === false) {
|
||||
return 'unsupported';
|
||||
}
|
||||
|
||||
mkdir($folderPath);
|
||||
$zip->extractTo($folderPath);
|
||||
return $zip->close();
|
||||
}
|
||||
|
||||
private function simpleSuccessResponse()
|
||||
{
|
||||
$response = new Response();
|
||||
$response->setData([
|
||||
'result' => [
|
||||
'success' => true
|
||||
]
|
||||
]);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
private function simpleErrorResponse($message)
|
||||
{
|
||||
$response = new Response();
|
||||
$response
|
||||
->setStatus(500, 'Internal Server Error')
|
||||
->setData([
|
||||
'result' => [
|
||||
'success' => false,
|
||||
'error' => $message
|
||||
]
|
||||
]);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
private function parsePerms($perms)
|
||||
{
|
||||
if (($perms & 0xC000) == 0xC000) {
|
||||
// Socket
|
||||
$info = 's';
|
||||
} elseif (($perms & 0xA000) == 0xA000) {
|
||||
// Symbolic Link
|
||||
$info = 'l';
|
||||
} elseif (($perms & 0x8000) == 0x8000) {
|
||||
// Regular
|
||||
$info = '-';
|
||||
} elseif (($perms & 0x6000) == 0x6000) {
|
||||
// Block special
|
||||
$info = 'b';
|
||||
} elseif (($perms & 0x4000) == 0x4000) {
|
||||
// Directory
|
||||
$info = 'd';
|
||||
} elseif (($perms & 0x2000) == 0x2000) {
|
||||
// Character special
|
||||
$info = 'c';
|
||||
} elseif (($perms & 0x1000) == 0x1000) {
|
||||
// FIFO pipe
|
||||
$info = 'p';
|
||||
} else {
|
||||
// Unknown
|
||||
$info = 'u';
|
||||
}
|
||||
|
||||
// Owner
|
||||
$info .= (($perms & 0x0100) ? 'r' : '-');
|
||||
$info .= (($perms & 0x0080) ? 'w' : '-');
|
||||
$info .= (($perms & 0x0040) ?
|
||||
(($perms & 0x0800) ? 's' : 'x' ) :
|
||||
(($perms & 0x0800) ? 'S' : '-'));
|
||||
|
||||
// Group
|
||||
$info .= (($perms & 0x0020) ? 'r' : '-');
|
||||
$info .= (($perms & 0x0010) ? 'w' : '-');
|
||||
$info .= (($perms & 0x0008) ?
|
||||
(($perms & 0x0400) ? 's' : 'x' ) :
|
||||
(($perms & 0x0400) ? 'S' : '-'));
|
||||
|
||||
// World
|
||||
$info .= (($perms & 0x0004) ? 'r' : '-');
|
||||
$info .= (($perms & 0x0002) ? 'w' : '-');
|
||||
$info .= (($perms & 0x0001) ?
|
||||
(($perms & 0x0200) ? 't' : 'x' ) :
|
||||
(($perms & 0x0200) ? 'T' : '-'));
|
||||
|
||||
return $info;
|
||||
}
|
||||
|
||||
private function canonicalizePath($path)
|
||||
{
|
||||
$dirSep = DIRECTORY_SEPARATOR;
|
||||
$wrongDirSep = DIRECTORY_SEPARATOR === '/' ? '\\' : '/';
|
||||
|
||||
// Replace incorrect dir separators
|
||||
$path = str_replace($wrongDirSep, $dirSep, $path);
|
||||
|
||||
$path = explode($dirSep, $path);
|
||||
$stack = array();
|
||||
foreach ($path as $seg) {
|
||||
if ($seg == '..') {
|
||||
// Ignore this segment, remove last segment from stack
|
||||
array_pop($stack);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($seg == '.') {
|
||||
// Ignore this segment
|
||||
continue;
|
||||
}
|
||||
|
||||
$stack[] = $seg;
|
||||
}
|
||||
|
||||
// Remove last /
|
||||
if (empty($stack[count($stack) - 1])) {
|
||||
array_pop($stack);
|
||||
}
|
||||
|
||||
return implode($dirSep, $stack);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates ASCII name
|
||||
*
|
||||
* @param string name encoded in UTF-8
|
||||
* @return string name containing only numbers, chars without diacritics, underscore and dash
|
||||
* @copyright Jakub Vrána, https://php.vrana.cz/
|
||||
*/
|
||||
private function normalizeName($name)
|
||||
{
|
||||
$name = preg_replace('~[^\\pL0-9_]+~u', '-', $name);
|
||||
$name = trim($name, "-");
|
||||
//$name = iconv("utf-8", "us-ascii//TRANSLIT", $name);
|
||||
$name = preg_replace('~[^-a-z0-9_]+~', '', $name);
|
||||
return $name;
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 303 KiB |
BIN
extend/AngularFilemanager/t.jpg
Normal file
BIN
extend/AngularFilemanager/t.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 87 KiB |
76
public/file/src/js/providers/config.js
Normal file
76
public/file/src/js/providers/config.js
Normal file
@ -0,0 +1,76 @@
|
||||
(function(angular) {
|
||||
'use strict';
|
||||
angular.module('FileManagerApp').provider('fileManagerConfig', function() {
|
||||
|
||||
var values = {
|
||||
appName: 'angular-filemanager v1.5',
|
||||
defaultLang: 'zh_cn',
|
||||
multiLang: true,
|
||||
|
||||
listUrl: '/FileManager/handler',
|
||||
uploadUrl: '/FileManager/handler/',
|
||||
renameUrl: '/FileManager/handler/',
|
||||
copyUrl: '/FileManager/handler/',
|
||||
moveUrl: '/FileManager/handler/',
|
||||
removeUrl: '/FileManager/handle/r',
|
||||
editUrl: '/FileManager/handler/',
|
||||
getContentUrl: '/FileManager/handler/',
|
||||
createFolderUrl: '/FileManager/handler/',
|
||||
downloadFileUrl: '/FileManager/handler/',
|
||||
downloadMultipleUrl: '/FileManager/handler/',
|
||||
compressUrl: '/FileManager/handler/',
|
||||
extractUrl: '/FileManager/handler/',
|
||||
permissionsUrl: '/FileManager/handler/',
|
||||
basePath: '/',
|
||||
|
||||
searchForm: true,
|
||||
sidebar: true,
|
||||
breadcrumb: true,
|
||||
allowedActions: {
|
||||
upload: true,
|
||||
rename: true,
|
||||
move: true,
|
||||
copy: true,
|
||||
edit: true,
|
||||
changePermissions: true,
|
||||
compress: true,
|
||||
compressChooseName: true,
|
||||
extract: true,
|
||||
download: true,
|
||||
downloadMultiple: true,
|
||||
preview: true,
|
||||
remove: true,
|
||||
createFolder: true,
|
||||
pickFiles: false,
|
||||
pickFolders: false
|
||||
},
|
||||
|
||||
multipleDownloadFileName: 'angular-filemanager.zip',
|
||||
filterFileExtensions: [],
|
||||
showExtensionIcons: true,
|
||||
showSizeForDirectories: false,
|
||||
useBinarySizePrefixes: false,
|
||||
downloadFilesByAjax: true,
|
||||
previewImagesInModal: true,
|
||||
enablePermissionsRecursive: true,
|
||||
compressAsync: false,
|
||||
extractAsync: false,
|
||||
pickCallback: null,
|
||||
|
||||
isEditableFilePattern: /\.(txt|diff?|patch|svg|asc|cnf|cfg|conf|html?|.html|cfm|cgi|aspx?|ini|pl|py|md|css|cs|js|jsp|log|htaccess|htpasswd|gitignore|gitattributes|env|json|atom|eml|rss|markdown|sql|xml|xslt?|sh|rb|as|bat|cmd|cob|for|ftn|frm|frx|inc|lisp|scm|coffee|php[3-6]?|java|c|cbl|go|h|scala|vb|tmpl|lock|go|yml|yaml|tsv|lst)$/i,
|
||||
isImageFilePattern: /\.(jpe?g|gif|bmp|png|svg|tiff?)$/i,
|
||||
isExtractableFilePattern: /\.(gz|tar|rar|g?zip)$/i,
|
||||
tplPath: '/file/src/templates'
|
||||
};
|
||||
|
||||
return {
|
||||
$get: function() {
|
||||
return values;
|
||||
},
|
||||
set: function (constants) {
|
||||
angular.extend(values, constants);
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
})(angular);
|
18
public/lang/de.json
Normal file
18
public/lang/de.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"function_not_implemented": "Funktion nicht implementiert",
|
||||
"file_not_found": "Datei nicht gefunden",
|
||||
"listing_failed": "Auflistung fehlgeschlagen",
|
||||
"moving_failed": "Verschiebung fehlgeschlagen",
|
||||
"renaming_failed": "Umbenennung fehlgeschlagen",
|
||||
"copying_failed": "Kopieren fehlgeschlagen",
|
||||
"removing_failed": "Löschen fehlgeschlagen",
|
||||
"removing_failed_directory_not_empty": "Entfernen fehlgeschlagen, der Ordner, welchen Sie versuchen zu löschen, ist nicht leer.",
|
||||
"saving_failed": "Speichern fehlgeschlagen",
|
||||
"folder_already_exists": "Ordner existiert bereits",
|
||||
"folder_creation_failed": "Ordner Anlage fehlgeschlagen",
|
||||
"permissions_change_failed": "Berechtigungsänderung fehlgeschlagen",
|
||||
"compression_failed": "Kompression fehlgeschlagen",
|
||||
"archive_opening_failed": "Öffnen des Archivs fehlgeschlagen, es ist entweder korrupt oder nicht unterstützt.",
|
||||
"extraction_failed": "Auspacken fehlgeschlagen",
|
||||
"upload_failed": "Hochladen fehlgeschlagen"
|
||||
}
|
18
public/lang/en.json
Normal file
18
public/lang/en.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"function_not_implemented": "Function not implemented",
|
||||
"file_not_found": "File not found",
|
||||
"listing_failed": "Listing failed",
|
||||
"moving_failed": "Moving failed",
|
||||
"renaming_failed": "Renaming failed",
|
||||
"copying_failed": "Copying failed",
|
||||
"removing_failed": "Removing failed",
|
||||
"removing_failed_directory_not_empty": "Removing failed, the directory you are trying to remove is not empty",
|
||||
"saving_failed": "Saving failed",
|
||||
"folder_already_exists": "Folder already exists",
|
||||
"folder_creation_failed": "Folder creation failed",
|
||||
"permissions_change_failed": "Permissions change failed",
|
||||
"compression_failed": "Compression failed",
|
||||
"archive_opening_failed": "Could not open the archive, it is either corrupted or unsupported",
|
||||
"extraction_failed": "Extraction failed",
|
||||
"upload_failed": "Upload failed"
|
||||
}
|
18
public/lang/fr.json
Normal file
18
public/lang/fr.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"function_not_implemented": "Fonction non implémentée",
|
||||
"file_not_found": "Fichier non trouvé",
|
||||
"listing_failed": "Le listing a échoué",
|
||||
"moving_failed": "Le déplacement a échoué",
|
||||
"renaming_failed": "Le renommage a échoué",
|
||||
"copying_failed": "La copie a échouée",
|
||||
"removing_failed": "La suppression a échouée",
|
||||
"removing_failed_directory_not_empty": "La suppression a échouée, le répertoire que vous voulez supprimer n'est pas vide",
|
||||
"saving_failed": "L'enregistrement a échoué",
|
||||
"folder_already_exists": "Le répertoire existe déjà",
|
||||
"folder_creation_failed": "La création du répertoire a échoué",
|
||||
"permissions_change_failed": "Le changement de permission a échoué",
|
||||
"compression_failed": "La compression a échouée",
|
||||
"archive_opening_failed": "L'ouverture de l'archive est impossible, le fichier est corrompu ou non supporté",
|
||||
"extraction_failed": "L'extraction a échouée",
|
||||
"upload_failed": "L'upload a échoué"
|
||||
}
|
18
public/lang/it.json
Normal file
18
public/lang/it.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"function_not_implemented": "Funzione non implementata",
|
||||
"file_not_found": "File non trovato",
|
||||
"listing_failed": "Elenco fallito",
|
||||
"moving_failed": "Spostamento fallito",
|
||||
"renaming_failed": "Rinomina fallita",
|
||||
"copying_failed": "Copia fallita",
|
||||
"removing_failed": "Rimozione fallita",
|
||||
"removing_failed_directory_not_empty": "Rimozione fallita, la cartella che stai tentando di rimuovere non è vuota",
|
||||
"saving_failed": "Salvataggio fallito",
|
||||
"folder_already_exists": "La cartella esiste già",
|
||||
"folder_creation_failed": "Creazione della cartella fallita",
|
||||
"permissions_change_failed": "Modifica dei permessi non riuscita",
|
||||
"compression_failed": "Compressione fallita",
|
||||
"archive_opening_failed": "Impossibile aprire l'archivio, è danneggiato o non supportato",
|
||||
"extraction_failed": "Estrazione fallita",
|
||||
"upload_failed": "Caricamento fallito"
|
||||
}
|
18
public/lang/ko.json
Normal file
18
public/lang/ko.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"function_not_implemented": "구현되지 않은 기능입니다",
|
||||
"file_not_found": "파일을 찾을 수 없습니다",
|
||||
"listing_failed": "목록 작성 실패",
|
||||
"moving_failed": "이동 실패",
|
||||
"renaming_failed": "이름 변경 실패",
|
||||
"copying_failed": "복사 실패",
|
||||
"removing_failed": "삭제 실패",
|
||||
"removing_failed_directory_not_empty": "폴더가 비어 있지 않아, 삭제할 수 없습니다",
|
||||
"saving_failed": "저장 실패",
|
||||
"folder_already_exists": "폴더가 이미 존재합니다",
|
||||
"folder_creation_failed": "폴더 생성 실패",
|
||||
"permissions_change_failed": "권한 변경 실패",
|
||||
"compression_failed": "압축 실패",
|
||||
"archive_opening_failed": "파일이 손상되었거나 지원되지 않아, 압축 파일을 열 수 없습니다",
|
||||
"extraction_failed": "추출 실패",
|
||||
"upload_failed": "업로드 실패"
|
||||
}
|
18
public/lang/sk.json
Normal file
18
public/lang/sk.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"function_not_implemented": "Funkcia nie je implementovaná",
|
||||
"file_not_found": "Súbor nenájdený",
|
||||
"listing_failed": "Výpis súborov zlyhal",
|
||||
"moving_failed": "Presunutie zlyhalo",
|
||||
"renaming_failed": "Premenovanie zlyhalo",
|
||||
"copying_failed": "Kopírovanie zlyhalo",
|
||||
"removing_failed": "Odstraňovanie zlyhalo",
|
||||
"removing_failed_directory_not_empty": "Odstraňovanie zlyhalo, priečinok, ktorý sa snažíte odstrániť nie je prázdny",
|
||||
"saving_failed": "Ukladanie zlyhalo",
|
||||
"folder_already_exists": "Priečinok s daným názvom už existuje",
|
||||
"folder_creation_failed": "Priečinok sa nepodarilo vytvoriť",
|
||||
"permissions_change_failed": "Nepodarilo sa zmeniť oprávnenia",
|
||||
"compression_failed": "Komprimovanie zlyhalo",
|
||||
"archive_opening_failed": "Nepodarilo sa otvoriť archív je buď poškodený alebo nepodporovaného formátu",
|
||||
"extraction_failed": "Extrahovanie zlyhalo",
|
||||
"upload_failed": "Nahrávanie zlyhalo"
|
||||
}
|
400
public/static/admin/modules/iconPicker.js
Normal file
400
public/static/admin/modules/iconPicker.js
Normal file
@ -0,0 +1,400 @@
|
||||
/**
|
||||
* Layui图标选择器
|
||||
* @author wujiawei0926@yeah.net
|
||||
* @version 1.1
|
||||
*/
|
||||
|
||||
layui.define(['laypage', 'form'], function (exports) {
|
||||
"use strict";
|
||||
|
||||
var IconPicker =function () {
|
||||
this.v = '1.1';
|
||||
}, _MOD = 'iconPicker',
|
||||
_this = this,
|
||||
$ = layui.jquery,
|
||||
laypage = layui.laypage,
|
||||
form = layui.form,
|
||||
BODY = 'body',
|
||||
TIPS = '请选择图标';
|
||||
|
||||
/**
|
||||
* 渲染组件
|
||||
*/
|
||||
IconPicker.prototype.render = function(options){
|
||||
var opts = options,
|
||||
// DOM选择器
|
||||
elem = opts.elem,
|
||||
// 数据类型:fontClass/unicode
|
||||
type = opts.type == null ? 'fontClass' : opts.type,
|
||||
// 是否分页:true/false
|
||||
page = opts.page == null ? true : opts.page,
|
||||
// 每页显示数量
|
||||
limit = opts.limit == null ? 12 : opts.limit,
|
||||
// 是否开启搜索:true/false
|
||||
search = opts.search == null ? true : opts.search,
|
||||
// 每个图标格子的宽度:'43px'或'20%'
|
||||
cellWidth = opts.cellWidth,
|
||||
// 点击回调
|
||||
click = opts.click,
|
||||
// 渲染成功后的回调
|
||||
success = opts.success,
|
||||
// json数据
|
||||
data = {},
|
||||
// 唯一标识
|
||||
tmp = new Date().getTime(),
|
||||
// 是否使用的class数据
|
||||
isFontClass = opts.type === 'fontClass',
|
||||
// 初始化时input的值
|
||||
ORIGINAL_ELEM_VALUE = $(elem).val(),
|
||||
TITLE = 'layui-select-title',
|
||||
TITLE_ID = 'layui-select-title-' + tmp,
|
||||
ICON_BODY = 'layui-iconpicker-' + tmp,
|
||||
PICKER_BODY = 'layui-iconpicker-body-' + tmp,
|
||||
PAGE_ID = 'layui-iconpicker-page-' + tmp,
|
||||
LIST_BOX = 'layui-iconpicker-list-box',
|
||||
selected = 'layui-form-selected',
|
||||
unselect = 'layui-unselect';
|
||||
|
||||
var a = {
|
||||
init: function () {
|
||||
data = common.getData[type]();
|
||||
|
||||
a.hideElem().createSelect().createBody().toggleSelect();
|
||||
a.preventEvent().inputListen();
|
||||
common.loadCss();
|
||||
|
||||
if (success) {
|
||||
success(this.successHandle());
|
||||
}
|
||||
|
||||
return a;
|
||||
},
|
||||
successHandle: function(){
|
||||
var d = {
|
||||
options: opts,
|
||||
data: data,
|
||||
id: tmp,
|
||||
elem: $('#' + ICON_BODY)
|
||||
};
|
||||
return d;
|
||||
},
|
||||
/**
|
||||
* 隐藏elem
|
||||
*/
|
||||
hideElem: function () {
|
||||
$(elem).hide();
|
||||
return a;
|
||||
},
|
||||
/**
|
||||
* 绘制select下拉选择框
|
||||
*/
|
||||
createSelect: function () {
|
||||
var oriIcon = '<i class="layui-icon">';
|
||||
|
||||
// 默认图标
|
||||
if(ORIGINAL_ELEM_VALUE === '') {
|
||||
if(isFontClass) {
|
||||
ORIGINAL_ELEM_VALUE = 'layui-icon-circle-dot';
|
||||
} else {
|
||||
ORIGINAL_ELEM_VALUE = '';
|
||||
}
|
||||
}
|
||||
|
||||
if (isFontClass) {
|
||||
oriIcon = '<i class="layui-icon '+ ORIGINAL_ELEM_VALUE +'">';
|
||||
} else {
|
||||
oriIcon += ORIGINAL_ELEM_VALUE;
|
||||
}
|
||||
oriIcon += '</i>';
|
||||
|
||||
var selectHtml = '<div class="layui-iconpicker layui-unselect layui-form-select" id="'+ ICON_BODY +'">' +
|
||||
'<div class="'+ TITLE +'" id="'+ TITLE_ID +'">' +
|
||||
'<div class="layui-iconpicker-item">'+
|
||||
'<span class="layui-iconpicker-icon layui-unselect">' +
|
||||
oriIcon +
|
||||
'</span>'+
|
||||
'<i class="layui-edge"></i>' +
|
||||
'</div>'+
|
||||
'</div>' +
|
||||
'<div class="layui-anim layui-anim-upbit" style="">' +
|
||||
'123' +
|
||||
'</div>';
|
||||
$(elem).after(selectHtml);
|
||||
return a;
|
||||
},
|
||||
/**
|
||||
* 展开/折叠下拉框
|
||||
*/
|
||||
toggleSelect: function () {
|
||||
var item = '#' + TITLE_ID + ' .layui-iconpicker-item,#' + TITLE_ID + ' .layui-iconpicker-item .layui-edge';
|
||||
a.event('click', item, function (e) {
|
||||
var $icon = $('#' + ICON_BODY);
|
||||
if ($icon.hasClass(selected)) {
|
||||
$icon.removeClass(selected).addClass(unselect);
|
||||
} else {
|
||||
// 隐藏其他picker
|
||||
$('.layui-form-select').removeClass(selected);
|
||||
// 显示当前picker
|
||||
$icon.addClass(selected).removeClass(unselect);
|
||||
}
|
||||
e.stopPropagation();
|
||||
});
|
||||
return a;
|
||||
},
|
||||
/**
|
||||
* 绘制主体部分
|
||||
*/
|
||||
createBody: function () {
|
||||
// 获取数据
|
||||
var searchHtml = '';
|
||||
|
||||
if (search) {
|
||||
searchHtml = '<div class="layui-iconpicker-search">' +
|
||||
'<input class="layui-input">' +
|
||||
'<i class="layui-icon"></i>' +
|
||||
'</div>';
|
||||
}
|
||||
|
||||
// 组合dom
|
||||
var bodyHtml = '<div class="layui-iconpicker-body" id="'+ PICKER_BODY +'">' +
|
||||
searchHtml +
|
||||
'<div class="'+ LIST_BOX +'"></div> '+
|
||||
'</div>';
|
||||
$('#' + ICON_BODY).find('.layui-anim').eq(0).html(bodyHtml);
|
||||
a.search().createList().check().page();
|
||||
|
||||
return a;
|
||||
},
|
||||
/**
|
||||
* 绘制图标列表
|
||||
* @param text 模糊查询关键字
|
||||
* @returns {string}
|
||||
*/
|
||||
createList: function (text) {
|
||||
var d = data,
|
||||
l = d.length,
|
||||
pageHtml = '',
|
||||
listHtml = $('<div class="layui-iconpicker-list">')//'<div class="layui-iconpicker-list">';
|
||||
|
||||
// 计算分页数据
|
||||
var _limit = limit, // 每页显示数量
|
||||
_pages = l % _limit === 0 ? l / _limit : parseInt(l / _limit + 1), // 总计多少页
|
||||
_id = PAGE_ID;
|
||||
|
||||
// 图标列表
|
||||
var icons = [];
|
||||
|
||||
for (var i = 0; i < l; i++) {
|
||||
var obj = d[i];
|
||||
|
||||
// 判断是否模糊查询
|
||||
if (text && obj.indexOf(text) === -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 是否自定义格子宽度
|
||||
var style = '';
|
||||
if (cellWidth !== null) {
|
||||
style += ' style="width:' + cellWidth + '"';
|
||||
}
|
||||
|
||||
// 每个图标dom
|
||||
var icon = '<div class="layui-iconpicker-icon-item" title="'+ obj +'" '+ style +'>';
|
||||
if (isFontClass){
|
||||
icon += '<i class="layui-icon '+ obj +'"></i>';
|
||||
} else {
|
||||
icon += '<i class="layui-icon">'+ obj.replace('amp;', '') +'</i>';
|
||||
}
|
||||
icon += '</div>';
|
||||
|
||||
icons.push(icon);
|
||||
}
|
||||
|
||||
// 查询出图标后再分页
|
||||
l = icons.length;
|
||||
_pages = l % _limit === 0 ? l / _limit : parseInt(l / _limit + 1);
|
||||
for (var i = 0; i < _pages; i++) {
|
||||
// 按limit分块
|
||||
var lm = $('<div class="layui-iconpicker-icon-limit" id="layui-iconpicker-icon-limit-' + tmp + (i+1) +'">');
|
||||
|
||||
for (var j = i * _limit; j < (i+1) * _limit && j < l; j++) {
|
||||
lm.append(icons[j]);
|
||||
}
|
||||
|
||||
listHtml.append(lm);
|
||||
}
|
||||
|
||||
// 无数据
|
||||
if (l === 0) {
|
||||
listHtml.append('<p class="layui-iconpicker-tips">无数据</p>');
|
||||
}
|
||||
|
||||
// 判断是否分页
|
||||
if (page){
|
||||
$('#' + PICKER_BODY).addClass('layui-iconpicker-body-page');
|
||||
pageHtml = '<div class="layui-iconpicker-page" id="'+ PAGE_ID +'">' +
|
||||
'<div class="layui-iconpicker-page-count">' +
|
||||
'<span id="'+ PAGE_ID +'-current">1</span>/' +
|
||||
'<span id="'+ PAGE_ID +'-pages">'+ _pages +'</span>' +
|
||||
' (<span id="'+ PAGE_ID +'-length">'+ l +'</span>)' +
|
||||
'</div>' +
|
||||
'<div class="layui-iconpicker-page-operate">' +
|
||||
'<i class="layui-icon" id="'+ PAGE_ID +'-prev" data-index="0" prev></i> ' +
|
||||
'<i class="layui-icon" id="'+ PAGE_ID +'-next" data-index="2" next></i> ' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
}
|
||||
|
||||
|
||||
$('#' + ICON_BODY).find('.layui-anim').find('.' + LIST_BOX).html('').append(listHtml).append(pageHtml);
|
||||
return a;
|
||||
},
|
||||
// 阻止Layui的一些默认事件
|
||||
preventEvent: function() {
|
||||
var item = '#' + ICON_BODY + ' .layui-anim';
|
||||
a.event('click', item, function (e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
return a;
|
||||
},
|
||||
// 分页
|
||||
page: function () {
|
||||
var icon = '#' + PAGE_ID + ' .layui-iconpicker-page-operate .layui-icon';
|
||||
|
||||
$(icon).unbind('click');
|
||||
a.event('click', icon, function (e) {
|
||||
var elem = e.currentTarget,
|
||||
total = parseInt($('#' +PAGE_ID + '-pages').html()),
|
||||
isPrev = $(elem).attr('prev') !== undefined,
|
||||
// 按钮上标的页码
|
||||
index = parseInt($(elem).attr('data-index')),
|
||||
$cur = $('#' +PAGE_ID + '-current'),
|
||||
// 点击时正在显示的页码
|
||||
current = parseInt($cur.html());
|
||||
|
||||
// 分页数据
|
||||
if (isPrev && current > 1) {
|
||||
current=current-1;
|
||||
$(icon + '[prev]').attr('data-index', current);
|
||||
} else if (!isPrev && current < total){
|
||||
current=current+1;
|
||||
$(icon + '[next]').attr('data-index', current);
|
||||
}
|
||||
$cur.html(current);
|
||||
|
||||
// 图标数据
|
||||
$('#'+ ICON_BODY + ' .layui-iconpicker-icon-limit').hide();
|
||||
$('#layui-iconpicker-icon-limit-' + tmp + current).show();
|
||||
e.stopPropagation();
|
||||
});
|
||||
return a;
|
||||
},
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
search: function () {
|
||||
var item = '#' + PICKER_BODY + ' .layui-iconpicker-search .layui-input';
|
||||
a.event('input propertychange', item, function (e) {
|
||||
var elem = e.target,
|
||||
t = $(elem).val();
|
||||
a.createList(t);
|
||||
});
|
||||
return a;
|
||||
},
|
||||
/**
|
||||
* 点击选中图标
|
||||
*/
|
||||
check: function () {
|
||||
var item = '#' + PICKER_BODY + ' .layui-iconpicker-icon-item';
|
||||
a.event('click', item, function (e) {
|
||||
var el = $(e.currentTarget).find('.layui-icon'),
|
||||
icon = '';
|
||||
if (isFontClass) {
|
||||
var clsArr = el.attr('class').split(/[\s\n]/),
|
||||
cls = clsArr[1],
|
||||
icon = cls;
|
||||
$('#' + TITLE_ID).find('.layui-iconpicker-item .layui-icon').html('').attr('class', clsArr.join(' '));
|
||||
} else {
|
||||
var cls = el.html(),
|
||||
icon = cls;
|
||||
$('#' + TITLE_ID).find('.layui-iconpicker-item .layui-icon').html(icon);
|
||||
}
|
||||
|
||||
$('#' + ICON_BODY).removeClass(selected).addClass(unselect);
|
||||
$(elem).val(icon).attr('value', icon);
|
||||
// 回调
|
||||
if (click) {
|
||||
click({
|
||||
icon: icon
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
return a;
|
||||
},
|
||||
// 监听原始input数值改变
|
||||
inputListen: function(){
|
||||
var el = $(elem);
|
||||
a.event('change', elem, function(){
|
||||
var value = el.val();
|
||||
})
|
||||
// el.change(function(){
|
||||
|
||||
// });
|
||||
return a;
|
||||
},
|
||||
event: function (evt, el, fn) {
|
||||
$(BODY).on(evt, el, fn);
|
||||
}
|
||||
};
|
||||
|
||||
var common = {
|
||||
/**
|
||||
* 加载样式表
|
||||
*/
|
||||
loadCss: function () {
|
||||
var css = '.layui-iconpicker {max-width: 280px;}.layui-iconpicker .layui-anim{display:none;position:absolute;left:0;top:42px;padding:5px 0;z-index:899;min-width:100%;border:1px solid #d2d2d2;max-height:300px;overflow-y:auto;background-color:#fff;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,.12);box-sizing:border-box;}.layui-iconpicker-item{border:1px solid #e6e6e6;width:90px;height:38px;border-radius:4px;cursor:pointer;position:relative;}.layui-iconpicker-icon{border-right:1px solid #e6e6e6;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;width:60px;height:100%;float:left;text-align:center;background:#fff;transition:all .3s;}.layui-iconpicker-icon i{line-height:38px;font-size:18px;}.layui-iconpicker-item > .layui-edge{left:70px;}.layui-iconpicker-item:hover{border-color:#D2D2D2!important;}.layui-iconpicker-item:hover .layui-iconpicker-icon{border-color:#D2D2D2!important;}.layui-iconpicker.layui-form-selected .layui-anim{display:block;}.layui-iconpicker-body{padding:6px;}.layui-iconpicker .layui-iconpicker-list{background-color:#fff;border:1px solid #ccc;border-radius:4px;}.layui-iconpicker .layui-iconpicker-icon-item{display:inline-block;width:21.1%;line-height:36px;text-align:center;cursor:pointer;vertical-align:top;height:36px;margin:4px;border:1px solid #ddd;border-radius:2px;transition:300ms;}.layui-iconpicker .layui-iconpicker-icon-item i.layui-icon{font-size:17px;}.layui-iconpicker .layui-iconpicker-icon-item:hover{background-color:#eee;border-color:#ccc;-webkit-box-shadow:0 0 2px #aaa,0 0 2px #fff inset;-moz-box-shadow:0 0 2px #aaa,0 0 2px #fff inset;box-shadow:0 0 2px #aaa,0 0 2px #fff inset;text-shadow:0 0 1px #fff;}.layui-iconpicker-search{position:relative;margin:0 0 6px 0;border:1px solid #e6e6e6;border-radius:2px;transition:300ms;}.layui-iconpicker-search:hover{border-color:#D2D2D2!important;}.layui-iconpicker-search .layui-input{cursor:text;display:inline-block;width:86%;border:none;padding-right:0;margin-top:1px;}.layui-iconpicker-search .layui-icon{position:absolute;top:11px;right:4%;}.layui-iconpicker-tips{text-align:center;padding:8px 0;cursor:not-allowed;}.layui-iconpicker-page{margin-top:6px;margin-bottom:-6px;font-size:12px;padding:0 2px;}.layui-iconpicker-page-count{display:inline-block;}.layui-iconpicker-page-operate{display:inline-block;float:right;cursor:default;}.layui-iconpicker-page-operate .layui-icon{font-size:12px;cursor:pointer;}.layui-iconpicker-body-page .layui-iconpicker-icon-limit{display:none;}.layui-iconpicker-body-page .layui-iconpicker-icon-limit:first-child{display:block;}';
|
||||
var $style = $('head').find('style[iconpicker]');
|
||||
if ($style.length === 0) {
|
||||
$('head').append('<style rel="stylesheet" iconpicker>'+css+'</style>');
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
getData: {
|
||||
fontClass: function () {
|
||||
var arr = ["layui-icon-rate-half","layui-icon-rate","layui-icon-rate-solid","layui-icon-cellphone","layui-icon-vercode","layui-icon-login-wechat","layui-icon-login-qq","layui-icon-login-weibo","layui-icon-password","layui-icon-username","layui-icon-refresh-3","layui-icon-auz","layui-icon-spread-left","layui-icon-shrink-right","layui-icon-snowflake","layui-icon-tips","layui-icon-note","layui-icon-home","layui-icon-senior","layui-icon-refresh","layui-icon-refresh-1","layui-icon-flag","layui-icon-theme","layui-icon-notice","layui-icon-website","layui-icon-console","layui-icon-face-surprised","layui-icon-set","layui-icon-template-1","layui-icon-app","layui-icon-template","layui-icon-praise","layui-icon-tread","layui-icon-male","layui-icon-female","layui-icon-camera","layui-icon-camera-fill","layui-icon-more","layui-icon-more-vertical","layui-icon-rmb","layui-icon-dollar","layui-icon-diamond","layui-icon-fire","layui-icon-return","layui-icon-location","layui-icon-read","layui-icon-survey","layui-icon-face-smile","layui-icon-face-cry","layui-icon-cart-simple","layui-icon-cart","layui-icon-next","layui-icon-prev","layui-icon-upload-drag","layui-icon-upload","layui-icon-download-circle","layui-icon-component","layui-icon-file-b","layui-icon-user","layui-icon-find-fill","layui-icon-loading","layui-icon-loading-1","layui-icon-add-1","layui-icon-play","layui-icon-pause","layui-icon-headset","layui-icon-video","layui-icon-voice","layui-icon-speaker","layui-icon-fonts-del","layui-icon-fonts-code","layui-icon-fonts-html","layui-icon-fonts-strong","layui-icon-unlink","layui-icon-picture","layui-icon-link","layui-icon-face-smile-b","layui-icon-align-left","layui-icon-align-right","layui-icon-align-center","layui-icon-fonts-u","layui-icon-fonts-i","layui-icon-tabs","layui-icon-radio","layui-icon-circle","layui-icon-edit","layui-icon-share","layui-icon-delete","layui-icon-form","layui-icon-cellphone-fine","layui-icon-dialogue","layui-icon-fonts-clear","layui-icon-layer","layui-icon-date","layui-icon-water","layui-icon-code-circle","layui-icon-carousel","layui-icon-prev-circle","layui-icon-layouts","layui-icon-util","layui-icon-templeate-1","layui-icon-upload-circle","layui-icon-tree","layui-icon-table","layui-icon-chart","layui-icon-chart-screen","layui-icon-engine","layui-icon-triangle-d","layui-icon-triangle-r","layui-icon-file","layui-icon-set-sm","layui-icon-add-circle","layui-icon-404","layui-icon-about","layui-icon-up","layui-icon-down","layui-icon-left","layui-icon-right","layui-icon-circle-dot","layui-icon-search","layui-icon-set-fill","layui-icon-group","layui-icon-friends","layui-icon-reply-fill","layui-icon-menu-fill","layui-icon-log","layui-icon-picture-fine","layui-icon-face-smile-fine","layui-icon-list","layui-icon-release","layui-icon-ok","layui-icon-help","layui-icon-chat","layui-icon-top","layui-icon-star","layui-icon-star-fill","layui-icon-close-fill","layui-icon-close","layui-icon-ok-circle","layui-icon-add-circle-fine"];
|
||||
return arr;
|
||||
},
|
||||
unicode: function () {
|
||||
return ["&#xe6c9;","&#xe67b;","&#xe67a;","&#xe678;","&#xe679;","&#xe677;","&#xe676;","&#xe675;","&#xe673;","&#xe66f;","&#xe9aa;","&#xe672;","&#xe66b;","&#xe668;","&#xe6b1;","&#xe702;","&#xe66e;","&#xe68e;","&#xe674;","&#xe669;","&#xe666;","&#xe66c;","&#xe66a;","&#xe667;","&#xe7ae;","&#xe665;","&#xe664;","&#xe716;","&#xe656;","&#xe653;","&#xe663;","&#xe6c6;","&#xe6c5;","&#xe662;","&#xe661;","&#xe660;","&#xe65d;","&#xe65f;","&#xe671;","&#xe65e;","&#xe659;","&#xe735;","&#xe756;","&#xe65c;","&#xe715;","&#xe705;","&#xe6b2;","&#xe6af;","&#xe69c;","&#xe698;","&#xe657;","&#xe65b;","&#xe65a;","&#xe681;","&#xe67c;","&#xe601;","&#xe857;","&#xe655;","&#xe770;","&#xe670;","&#xe63d;","&#xe63e;","&#xe654;","&#xe652;","&#xe651;","&#xe6fc;","&#xe6ed;","&#xe688;","&#xe645;","&#xe64f;","&#xe64e;","&#xe64b;","&#xe62b;","&#xe64d;","&#xe64a;","&#xe64c;","&#xe650;","&#xe649;","&#xe648;","&#xe647;","&#xe646;","&#xe644;","&#xe62a;","&#xe643;","&#xe63f;","&#xe642;","&#xe641;","&#xe640;","&#xe63c;","&#xe63b;","&#xe63a;","&#xe639;","&#xe638;","&#xe637;","&#xe636;","&#xe635;","&#xe634;","&#xe633;","&#xe632;","&#xe631;","&#xe630;","&#xe62f;","&#xe62e;","&#xe62d;","&#xe62c;","&#xe629;","&#xe628;","&#xe625;","&#xe623;","&#xe621;","&#xe620;","&#xe61f;","&#xe61c;","&#xe60b;","&#xe619;","&#xe61a;","&#xe603;","&#xe602;","&#xe617;","&#xe615;","&#xe614;","&#xe613;","&#xe612;","&#xe611;","&#xe60f;","&#xe60e;","&#xe60d;","&#xe60c;","&#xe60a;","&#xe609;","&#xe605;","&#xe607;","&#xe606;","&#xe604;","&#xe600;","&#xe658;","&#x1007;","&#x1006;","&#x1005;","&#xe608;"];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
a.init();
|
||||
return new IconPicker();
|
||||
};
|
||||
|
||||
/**
|
||||
* 选中图标
|
||||
* @param filter lay-filter
|
||||
* @param iconName 图标名称,自动识别fontClass/unicode
|
||||
*/
|
||||
IconPicker.prototype.checkIcon = function (filter, iconName){
|
||||
var el = $('*[lay-filter='+ filter +']'),
|
||||
p = el.next().find('.layui-iconpicker-item .layui-icon'),
|
||||
c = iconName;
|
||||
|
||||
if (c.indexOf('#xe') > 0){
|
||||
p.html(c);
|
||||
} else {
|
||||
p.html('').attr('class', 'layui-icon ' + c);
|
||||
}
|
||||
el.attr('value', c).val(c);
|
||||
};
|
||||
|
||||
var iconPicker = new IconPicker();
|
||||
exports(_MOD, iconPicker);
|
||||
});
|
2265
public/static/admin/modules/treeTable.js
Normal file
2265
public/static/admin/modules/treeTable.js
Normal file
File diff suppressed because it is too large
Load Diff
8
public/static/admin/modules/xmSelect.js
Normal file
8
public/static/admin/modules/xmSelect.js
Normal file
File diff suppressed because one or more lines are too long
@ -524,4 +524,20 @@ html{background-color: #f2f2f2; color: #666;}
|
||||
}
|
||||
|
||||
|
||||
/* xmSelect */
|
||||
.xm-body .xm-option .xm-option-icon {
|
||||
border-color: #1890ff !important;
|
||||
}
|
||||
|
||||
.xm-body .xm-option.selected .xm-option-icon,
|
||||
.xm-body .xm-toolbar .toolbar-tag:hover,
|
||||
.ew-xmselect-tree xm-select .xm-body .xm-option.selected .xm-option-content {
|
||||
color: #1890ff !important;
|
||||
}
|
||||
|
||||
.xm-label .xm-label-block,
|
||||
.xm-body .xm-option.hide-icon.selected {
|
||||
background-color: #1890ff !important;
|
||||
}
|
||||
|
||||
|
||||
|
212
public/static/admin/tree/css/demo.css
Normal file
212
public/static/admin/tree/css/demo.css
Normal file
@ -0,0 +1,212 @@
|
||||
body .layui-layer-tips .layui-layer-content {
|
||||
line-height: 1.5;
|
||||
padding: 8px 12px;
|
||||
border-radius: 4px;
|
||||
background-color: #303133;
|
||||
box-shadow: 0 1px 6px rgba(0, 0, 0, .2);
|
||||
}
|
||||
|
||||
body .layui-layer-tips i.layui-layer-TipsG {
|
||||
border-width: 5px;
|
||||
}
|
||||
|
||||
body .layui-layer-tips i.layui-layer-TipsR, body .layui-layer-tips i.layui-layer-TipsL {
|
||||
top: 11px;
|
||||
}
|
||||
|
||||
body .layui-layer-tips i.layui-layer-TipsT, body .layui-layer-tips i.layui-layer-TipsB {
|
||||
left: 12px;
|
||||
}
|
||||
|
||||
body .layui-layer-tips i.layui-layer-TipsT {
|
||||
bottom: -10px;
|
||||
}
|
||||
|
||||
body .layui-layer-tips i.layui-layer-TipsT {
|
||||
border-right-color: transparent;
|
||||
border-top-style: solid;
|
||||
border-top-color: #303133;
|
||||
}
|
||||
|
||||
body .layui-layer-tips i.layui-layer-TipsB {
|
||||
top: -10px;
|
||||
}
|
||||
|
||||
body .layui-layer-tips i.layui-layer-TipsB {
|
||||
border-right-color: transparent;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-color: #303133;
|
||||
}
|
||||
|
||||
body .layui-layer-tips i.layui-layer-TipsL {
|
||||
right: -10px;
|
||||
}
|
||||
|
||||
body .layui-layer-tips i.layui-layer-TipsL {
|
||||
border-bottom-color: transparent;
|
||||
border-left-style: solid;
|
||||
border-left-color: #303133;
|
||||
}
|
||||
|
||||
body .layui-layer-tips i.layui-layer-TipsR {
|
||||
left: -10px;
|
||||
}
|
||||
|
||||
body .layui-layer-tips i.layui-layer-TipsR {
|
||||
border-bottom-color: transparent;
|
||||
border-right-style: solid;
|
||||
border-right-color: #303133;
|
||||
}
|
||||
|
||||
|
||||
/** loading样式 */
|
||||
.page-loading {
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 19891017;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.page-no-scroll {
|
||||
overflow: hidden;
|
||||
overflow-x: hidden;
|
||||
overflow-y: hidden;
|
||||
min-height: 80px;
|
||||
}
|
||||
|
||||
.rubik-loader, .ball-loader, .signal-loader {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
-ms-transform: translate(-50%, -50%);
|
||||
-webkit-transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.ball-loader > span, .signal-loader > span {
|
||||
background-color: #4aca85;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.ball-loader > span:nth-child(1), .ball-loader.sm > span:nth-child(1), .signal-loader > span:nth-child(1), .signal-loader.sm > span:nth-child(1) {
|
||||
-webkit-animation-delay: 0s;
|
||||
animation-delay: 0s;
|
||||
}
|
||||
|
||||
.ball-loader > span:nth-child(2), .ball-loader.sm > span:nth-child(2), .signal-loader > span:nth-child(2), .signal-loader.sm > span:nth-child(2) {
|
||||
-webkit-animation-delay: 0.1s;
|
||||
animation-delay: 0.1s;
|
||||
}
|
||||
|
||||
.ball-loader > span:nth-child(3), .ball-loader.sm > span:nth-child(3), .signal-loader > span:nth-child(3), .signal-loader.sm > span:nth-child(3) {
|
||||
-webkit-animation-delay: 0.15s;
|
||||
animation-delay: 0.15s;
|
||||
}
|
||||
|
||||
.ball-loader > span:nth-child(4), .ball-loader.sm > span:nth-child(4), .signal-loader > span:nth-child(4), .signal-loader.sm > span:nth-child(4) {
|
||||
-webkit-animation-delay: 0.2s;
|
||||
animation-delay: 0.2s;
|
||||
}
|
||||
|
||||
.ball-loader > span {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin: 0 3px;
|
||||
border-radius: 50%;
|
||||
transform: scale(0);
|
||||
-ms-transform: scale(0);
|
||||
-webkit-transform: scale(0);
|
||||
animation: ball-load 1s ease-in-out infinite;
|
||||
-webkit-animation: 1s ball-load ease-in-out infinite;
|
||||
}
|
||||
|
||||
@-webkit-keyframes ball-load {
|
||||
0% {
|
||||
transform: scale(0);
|
||||
-webkit-transform: scale(0);
|
||||
}
|
||||
50% {
|
||||
transform: scale(1);
|
||||
-webkit-transform: scale(1);
|
||||
}
|
||||
100% {
|
||||
transform: scale(0);
|
||||
-webkit-transform: scale(0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes ball-load {
|
||||
0% {
|
||||
transform: scale(0);
|
||||
-webkit-transform: scale(0);
|
||||
}
|
||||
50% {
|
||||
transform: scale(1);
|
||||
-webkit-transform: scale(1);
|
||||
}
|
||||
100% {
|
||||
transform: scale(0);
|
||||
-webkit-transform: scale(0);
|
||||
}
|
||||
}
|
||||
|
||||
.ball-loader.sm > span {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
margin: 0 2px;
|
||||
}
|
||||
|
||||
.layui-input {
|
||||
border-color: #C9C9C9 !important;
|
||||
}
|
||||
|
||||
.layui-input:focus {
|
||||
border-color: #009688 !important;
|
||||
}
|
||||
|
||||
.layui-btn-sm {
|
||||
padding: 0 8px 0 5px;
|
||||
}
|
||||
|
||||
.page-wrapper {
|
||||
width: 900px;
|
||||
margin: 0 auto;
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.right-desc {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 280px;
|
||||
padding-top: 6px;
|
||||
}
|
||||
|
||||
.desc-item {
|
||||
background-color: #FFF8DB;
|
||||
color: #40485b;
|
||||
padding: 10px 15px;
|
||||
margin: 15px 15px 0 0;
|
||||
font-size: 12px;
|
||||
line-height: 1.6;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0px 0px 6px rgba(0, 0, 0, .15);
|
||||
}
|
||||
|
||||
html, body {
|
||||
min-width: 1200px;
|
||||
background-color: #fff;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1480px) {
|
||||
.page-wrapper {
|
||||
margin: 0 280px auto auto;
|
||||
}
|
||||
}
|
BIN
public/static/admin/tree/css/icon_date.png
Normal file
BIN
public/static/admin/tree/css/icon_date.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 314 B |
437
public/static/admin/tree/css/treeTable.css
Normal file
437
public/static/admin/tree/css/treeTable.css
Normal file
@ -0,0 +1,437 @@
|
||||
/** 最外层容器 */
|
||||
.ew-tree-table {
|
||||
margin: 10px 0;
|
||||
position: relative;
|
||||
border: 1px solid #e6e6e6;
|
||||
border-bottom: none;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.ew-tree-table:before, .ew-tree-table:after, .ew-tree-table .ew-tree-table-head:after {
|
||||
content: "";
|
||||
background-color: #e6e6e6;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.ew-tree-table:before {
|
||||
width: 1px;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.ew-tree-table:after, .ew-tree-table .ew-tree-table-head:after {
|
||||
height: 1px;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.ew-tree-table .layui-table {
|
||||
margin: 0;
|
||||
position: relative;
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
/** 表格 */
|
||||
.ew-tree-table .layui-table td, .ew-tree-table .layui-table th {
|
||||
border-top: none;
|
||||
border-left: none;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-table-box {
|
||||
overflow: auto;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-table-head {
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
background-color: #f2f2f2;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/** loading */
|
||||
.ew-tree-table .ew-tree-table-loading {
|
||||
padding: 10px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-table-loading > i {
|
||||
color: #999;
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-table-loading.ew-loading-float {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
/** 空数据 */
|
||||
.ew-tree-table .ew-tree-table-empty {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
padding: 18px 0;
|
||||
text-align: center;
|
||||
display: none;
|
||||
}
|
||||
|
||||
/** 单元格 */
|
||||
.ew-tree-table-cell.ew-tree-tips-open {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
padding: 0;
|
||||
z-index: 19891015;
|
||||
background-color: #fff;
|
||||
box-shadow: 3px 3px 8px rgba(0, 0, 0, .15);
|
||||
}
|
||||
|
||||
thead .ew-tree-table-cell.ew-tree-tips-open {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
|
||||
.ew-tree-table-cell.ew-tree-tips-open.ew-show-left {
|
||||
right: 0;
|
||||
left: auto;
|
||||
box-shadow: -3px 3px 8px rgba(0, 0, 0, .15);
|
||||
}
|
||||
|
||||
.ew-tree-table-cell.ew-tree-tips-open.ew-show-bottom {
|
||||
bottom: 0;
|
||||
top: auto;
|
||||
box-shadow: 3px -3px 8px rgba(0, 0, 0, .15);
|
||||
}
|
||||
|
||||
.ew-tree-table-cell.ew-tree-tips-open.ew-show-left.ew-show-bottom {
|
||||
box-shadow: -3px -3px 8px rgba(0, 0, 0, .15);
|
||||
}
|
||||
|
||||
.ew-tree-table-cell > .ew-tree-tips-c {
|
||||
position: absolute;
|
||||
right: -6px;
|
||||
top: -3px;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
font-size: 16px;
|
||||
color: #fff;
|
||||
background-color: #666;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
display: none;
|
||||
}
|
||||
|
||||
table tr:first-child .ew-tree-table-cell > .ew-tree-tips-c {
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.ew-tree-table-cell.ew-tree-tips-open > .ew-tree-tips-c {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.ew-tree-table-cell.ew-tree-tips-open.ew-show-left > .ew-tree-tips-c {
|
||||
left: -6px;
|
||||
right: auto;
|
||||
}
|
||||
|
||||
.ew-tree-table-cell > .ew-tree-table-cell-content {
|
||||
padding: 5px 15px;
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
[lay-size="lg"] .ew-tree-table-cell > .ew-tree-table-cell-content {
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
[lay-size="sm"] .ew-tree-table-cell > .ew-tree-table-cell-content {
|
||||
padding: 1px 15px;
|
||||
}
|
||||
|
||||
.ew-tree-table-cell.single-line > .ew-tree-table-cell-content {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.ew-tree-table-cell.ew-tree-tips-open > .ew-tree-table-cell-content {
|
||||
overflow: auto;
|
||||
padding: 9px 15px;
|
||||
height: auto;
|
||||
min-height: 100%;
|
||||
max-height: 110px;
|
||||
line-height: inherit;
|
||||
max-width: 260px;
|
||||
width: 200px;
|
||||
width: max-content;
|
||||
width: -moz-max-content;
|
||||
box-sizing: border-box;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.ew-tree-table-cell > .layui-table-grid-down {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/** 图标列 */
|
||||
.ew-tree-table .ew-tree-pack {
|
||||
cursor: pointer;
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-pack > .layui-icon, .ew-tree-table .ew-tree-pack > .ew-tree-icon {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-pack > * {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* 缩进 */
|
||||
.ew-tree-table .ew-tree-table-indent {
|
||||
margin-right: 5px;
|
||||
padding-left: 16px;
|
||||
}
|
||||
|
||||
/* 箭头 */
|
||||
.ew-tree-table .ew-tree-table-arrow:before {
|
||||
content: "\e623";
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-table-open .ew-tree-table-arrow:before {
|
||||
content: "\e625";
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-table-arrow.arrow2 {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
line-height: 16px;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-table-arrow.arrow2:before {
|
||||
content: "\e602";
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-table-open .ew-tree-table-arrow.arrow2:before {
|
||||
content: "\e61a";
|
||||
}
|
||||
|
||||
.ew-tree-table-arrow.ew-tree-table-arrow-hide {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
/* 箭头变加载中状态 */
|
||||
.ew-tree-table .ew-tree-table-loading > td .ew-tree-table-arrow:before {
|
||||
content: "\e63d" !important;
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-table-loading > td .ew-tree-table-arrow {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-table-loading > td .ew-tree-table-arrow + * {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-table-loading * {
|
||||
pointer-events: none !important;
|
||||
}
|
||||
|
||||
/** 折叠行 */
|
||||
.ew-tree-table .ew-tree-tb-hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/** 特殊列调整 */
|
||||
.ew-tree-table td[data-type="numbers"] > .ew-tree-table-cell,
|
||||
.ew-tree-table th[data-type="numbers"] > .ew-tree-table-cell,
|
||||
.ew-tree-table td[data-type="checkbox"] > .ew-tree-table-cell,
|
||||
.ew-tree-table th[data-type="checkbox"] > .ew-tree-table-cell,
|
||||
.ew-tree-table td[data-type="radio"] > .ew-tree-table-cell,
|
||||
.ew-tree-table th[data-type="radio"] > .ew-tree-table-cell,
|
||||
.ew-tree-table td[data-type="space"] > .ew-tree-table-cell,
|
||||
.ew-tree-table th[data-type="space"] > .ew-tree-table-cell {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
/* 单元格内表单元素样式调整 */
|
||||
.ew-tree-table .layui-form-switch,
|
||||
.ew-tree-table .layui-form-radio {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* checkbox列调整 */
|
||||
.ew-tree-table-checkbox + .layui-form-checkbox {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ew-tree-table-checkbox + .layui-form-checkbox > .layui-icon {
|
||||
font-weight: 600;
|
||||
color: transparent;
|
||||
transition: background-color .1s linear;
|
||||
-webkit-transition: background-color .1s linear;
|
||||
}
|
||||
|
||||
.ew-tree-table-checkbox + .layui-form-checkbox.layui-form-checked > .layui-icon {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* checkbox半选状态 */
|
||||
.ew-form-indeterminate + .layui-form-checkbox .layui-icon:before {
|
||||
content: "";
|
||||
width: 10px;
|
||||
height: 2px;
|
||||
background-color: #f1f1f1;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin: -1px 0 0 -5px;
|
||||
}
|
||||
|
||||
/* radio列调整 */
|
||||
.ew-tree-table-radio + .layui-form-radio {
|
||||
padding: 0;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.ew-tree-table-radio + .layui-form-radio > i {
|
||||
margin: 0;
|
||||
height: 20px;
|
||||
font-size: 20px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
/** 单元格编辑 */
|
||||
.ew-tree-table .layui-table td[data-edit] {
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-table-edit {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 0;
|
||||
box-shadow: 1px 1px 20px rgba(0, 0, 0, .15);
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-table-edit:focus {
|
||||
border-color: #5FB878 !important;
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-table-edit.layui-form-danger {
|
||||
border-color: #FF5722 !important;
|
||||
}
|
||||
|
||||
/** 搜索数据隐藏行 */
|
||||
.ew-tree-table tr.ew-tree-table-filter-hide {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/** 头部工具栏 */
|
||||
.ew-tree-table .ew-tree-table-tool {
|
||||
min-height: 50px;
|
||||
line-height: 30px;
|
||||
padding: 10px 15px;
|
||||
box-sizing: border-box;
|
||||
background-color: #f2f2f2;
|
||||
border-bottom: 1px solid #e6e6e6;
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-table-tool .ew-tree-table-tool-right {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-table-tool .ew-tree-table-tool-item {
|
||||
position: relative;
|
||||
color: #333;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
line-height: 26px;
|
||||
text-align: center;
|
||||
margin-left: 10px;
|
||||
display: inline-block;
|
||||
border: 1px solid #ccc;
|
||||
box-sizing: border-box;
|
||||
vertical-align: middle;
|
||||
-webkit-transition: .3s all;
|
||||
transition: .3s all;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-table-tool .ew-tree-table-tool-item:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-table-tool .ew-tree-table-tool-item:hover {
|
||||
border-color: #999;
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-table-tool-right .layui-table-tool-panel {
|
||||
left: auto;
|
||||
right: -1px;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
/* 列宽拖拽调整 */
|
||||
.ew-tree-table .ew-tb-resize {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 10px;
|
||||
cursor: col-resize;
|
||||
}
|
||||
|
||||
.ew-tree-table-resizing {
|
||||
cursor: col-resize;
|
||||
-ms-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
/* 辅助样式 */
|
||||
.ew-tree-table .layui-form-switch {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.ew-tree-table .pd-tb-0 {
|
||||
padding-top: 0 !important;
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.ew-tree-table .break-all {
|
||||
word-break: break-all !important;
|
||||
}
|
||||
|
||||
/** 扩展图标 */
|
||||
.ew-tree-table .ew-tree-icon-folder:after, .ew-tree-table .ew-tree-icon-file:after {
|
||||
content: "";
|
||||
padding: 2px 10px;
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
-o-background-size: cover;
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAE6UlEQVR4Xu2ZPYhcVRiGny9hC0FsTEBCGkFTWIQE/IlpgmKpWAiLyR0XLbYTxEKxkCAEhRCxEOwsjJnJioKIYClWKgqiskIIaCoLYyASVJT87JGspN37LrOXvec777Tzzrnvz7Nn2dnAr6YbiKbTOzwGoHEIDIABaLyBxuP7BjAAjTfQeHzfAAag8QYaj+8bwAA03kDj8X0DGIDGG2g8/lw3QFlhD9fZN7oOF7gYT3NudL5GaGjTAJQP2c1VXgIOExyGkf4/oXCe4I3oeH+EvY/G0qYAKFOWCV4Hdo8mQb+RL7jBE7HE3/3S9hQyAGXGCeDVSiv6lqscief4t1L/g9mWAChTHiD4ZrTXvVbPu9GxrEnbUWkAzPgeOJCglsXo+ChBji2L0AtAmfEgrP/0Z3hdZoF7Y5HLGcJsRQYFgLeAF7fiYSM540x0LI3Ey7bb6AdgytcEh7bd6VYa2MGhOJrmVpurmX4AZlwCds31lPF9+AI32O8/DYUvccqUKwR3jG/DuR29Gd36F1pNv/pvgKwAFK5RuC+e4eeWCWgXgJurFz6LCY8bgA0aSPwr4P/UhVNc43ir3xK2fQPcAr/wO/AewU/Ar6xRqroVdvAnC6zGIlc369sAbLax8er/ofAJOzkVR9e/uZVeBkCqqTrRyeh4RXFtAJSWatQUno0Jp/usG4C+hup9/yJ72BuPcH2jCAag3oEV50vRccYAKFXl1LwdHS8YgJzj9qcqfBoTnjQA/VVlVXwXHfcbgKzz9uf6IToOGoD+orIqDEDWZcVcBkAsKqvMAGRdVsxlAMSissoMQNZlxVwGQCwqq8wAZF1WzGUAxKKyygxA1mXFXAZALCqrzABkXVbMZQDEorLKDEDWZcVcBkAsKqvMAGRdVsxlAMSissoMQNZlxVwGQCwqq8wAZF1WzGUAxKKyygxA1mXFXAZALCqrzABkXVbMZQDEorLKDEDWZcVcBkAsKqvMAGRdVsxlAMSissoMQNZlxVwGQCwqq8wAZF1WzGUAxKKyygxA1mXFXAZALCqrzABkXVbMZQDEorLKDEDWZcVcBkAsKqvMAGRdVsxlAMSissoMQNZlxVwGQCwqq8wAZF1WzGUAxKKyygxA1mXFXAZALCqrzABkXVbMZQDEorLKDEDWZcVcBkAsKqvMAGRdVsxlAMSissoMQNZlxVwGQCwqq8wAZF1WzGUAxKKyygxA1mXFXAZALCqrzABkXVbMZQDEorLKDEDWZcVcBkAsKqvMAGRdVsxlAMSissoMQNZlxVwGQCwqq8wAZF1WzLUFAMy4BOwSH2jZmBoorMaE/RtZij6/ZcoFgrv7dH5/lA38Eh33zAfAjM+BR0cZz6Y2bqDwY0w4MB8AU04SvOyuq2zg4+h4aj4AzvIwha+qjN+66cLzMeGduQC4+eEy4zywr/U+K8t/hQX2xiJ/zQ/ACgdZ40vgtspKaNducCyOsdJXQO9fAbcOKGc5whofENzVd6jf3/YGTkTHccWFDMD6r4LT3MlOloHHCB4CblceYs3gDfxB4TeCcxReiwmr6hM3BYB6qHX1NGAA6tlqEKcGYJBa6znUANSz1SBODcAgtdZzqAGoZ6tBnBqAQWqt51ADUM9Wgzg1AIPUWs+hBqCerQZxagAGqbWeQw1APVsN4tQADFJrPYcagHq2GsTpf+KxwJB5Cd5mAAAAAElFTkSuQmCC");
|
||||
}
|
||||
|
||||
.ew-tree-table tr.ew-tree-table-open > td .ew-tree-icon-folder:after {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAKwElEQVR4Xu2df9AVVRnHP899gUxmYKhsCpJREEeMakSoiGGCbIxSizIJ7i5OksZkMIxQjlOQyOCQ5o/8RWmkMdz7wjDC5I+hcFSKxEENh4YsEwPJAbVQ8AeQL733NPcKyn3v7r17d8/uvfvus//ec57n+3yf7z179uw5zwp6ZZoByXT0GjwqgIyLQAWgAsg4AxkPX0cAFUDGGch4+DoCqAAyzkDGw9cRQAWQcQYyHr6OACqA5hkw63kfr3IyOQZTIte8BUs9OnibEi/isEcEY8lqpswEHgHMGgbSxTyEyRjGIC1MfM8UGQ4CfyLHWp7jbllEKVNZjBBsIAGYAi7CrcCgCL6S6voM4IrDtqQcptlPQwGYAksRrkpVkIZD5JgmeR5IFe4WgK0rAFPkamBRC3BFd2k4AkwSl83RjfVeC74CMCuZSI6NqQ7d8G9KDJOLK3MEvTwY8BdAga0Io3sBa0vEYWEviCOWEDwFYDoZh+HxWDwmb/R18gzSx0Rv4r0FUORa4EfJ5yomj8IEyfNYTNZTbdZbAAU2IJyb6siOB2+4Qlx+3mvisRiInwC2I4yy6Ke1pgw/E5crWwuiPb373QL+BZzcnpBDobpLHGaF6tnLO6kAenmCG4WXFQH8WhwubURGFn/PhgAMD4nLl7KY4EYxZ0MAcBhhqOTZ14iQrP2eFQGU8/ogeb6qC0LVEs+SAMqRL+ctLpdZlRdFeoH32UBTpLc9Br6XbMMuhLUIm+jmzbZSQUdlV9M++rBTpnI4CWxZGwGS4NSWj2eBh4CbxGG3LaM97agA4mLWnt23gZ+yg8VxbHVTAdhLVNyWHqabKbb3NqgA4k6bTfuG+3GYYvNJRgVgM0FJ2DL8QFxutOVKBWCLyaTsGN6gH0NlKq/bcKkCsMFi0jYMs8XlDhtuVQA2WEzahuH34vJlG25VADZYTN7GPnE4yYZbFYANFlth4y362VjSVgG0Ink2fAon2Xi7qQKwkYxW2OglAtiP4QlgN8LLreAxtT4HcL1cwKGo+FsxAnQDv6HEbTKDv0QNQPtHYyBpAZSPm7mSp/ymS682YCA5ARiWMYS5Mon/tUHcCuEoA0kJ4AZx+KGy3n4MJCGA9eJwXqPQzSJyjGAMJU5s1FZ/r8NAH7roYIdM5T9BeIpXAIaXOMKZcgkH/MCYIp8GvgN8A/hQENDaJhADrwG/oy9X1BNDvAIQZkqee+okfwGGa9qq4FQgblPVaC85xsp09nqhjlMAO9nBCK9tTGYjfdhLJ3BRqqhMK1jDdoYw2msCHqcAypsZ53txZoqVo9pz08pnKnEbLhKXe3tij1MAk8VhQ0+HZjWj6GZ7KklMM2jD3eJW5lpVV5wC+IA47K8RQJEVwMVp5jKV2H3OR8YjAMPL4vLRmuSvoYMjvAoMTCWJ6Qa9Vhy+mdQIsEEcJtcIYCWjybE13TymFL2wVPK1dZ/iGgE8S7KYTi7F8KuUUphu2AlPAsu1eose9/9lwPfSzWRq0Q8Xh53J3AI6+IRM4681AiiwBeEzqaUwrcANh8Slvxf8OG4BXezg/T0XgCpr/afxX4S+aeUxtbgNfxCXSUkJYJs4nKXP/20ll5vFYV4yAjCsEJdve9z/y8/+5TUAvZJmwDBDXArJCADmicPNHgLQ5d+kE3/Mn+Hj4vK3ZARg+KK4POIxAdyEMKFVHGTWb/m7Cc9zgl9tgTgmgd5LwAUOIrrZI3EhGraIyzg/v7YFsFcchnhMAE+nm38kHrw6BMMycfl+MgLwObRoikwDVmk+WsCAcJnkWZ6MAOA6cWo/MGUKXI/optAWpB9KnC0zeDoZAQh5ydf+002BhxHOaQkBWXZqKHGQE+odIrU7BxBGSZ7yd/uqLlOsbArVV8DJi9FzUe54GDYF4L0EvIpTKLEr+djVIz67gOIRgOFpcTnb499f3u69VtPREgbmiMPt9TzbHAHuEYeZHgtASxB+3JLws+40x3iZXv/rb/YE4PNhJlNgPWKnnk3W89l0/APo3+gIuT0BwBfEqf3SqCnwCsKHmwavHaIy8Kw4jGxkxKYAapaAzSoGU2JPIxD6ewwMGDrFxWlk2Y4ADHvE5WMe9//zEf2Cd6MkxPJ7wIqidgQAnieATYGfIFwTS4BqtD4DwjmS59FGNNkRgM+WY1Pkt8DXGoHQ32NgoItB9U5lH/NoRwAwXRxWe6wB9N4vj8SQM4smXxCHU4PYsyOADs6Uafz9eIdmDQM54l8XIAg4bROagXXicGGQ3jYE4L0EXOBcpPZwaBBQ2iYiA4YF4la+AN/wsiGAP4vDWI8ngKsQljZEoA3iYOA8cVgfxHB0Afi8cDBF1mgBiCApiKGN8BHJ80oQy9EFAHPF4VaPCeDzwPAgILSNRQYML4nL4KAWowtAmCh5/lg1AXyAE3mDg0FBaDurDASqynbMY3QBQO0S8Eomkqt9L2A1TDXmx8AScVgYlJ6oAnhRHIZ6TADnI9wQFIS2s8rAheKwLqjFqAJ4UBwu8BBAESEfFIS2s8hAjlNlOi8EtRhNAIZrxWWBxwSwvCh0RlAQ2s4SA4YD4jKoGWvRBCB8S/KVx713L6MTwGb4t932UXGa230dTQAlzpAZ1Sd+TIHxCI/ZjkztBWKg6aLcUQTgtwQ8B6ldFwgEXxtFY8DnXEY9o+EFYHhK3Eqh56rLFCu1gWvqA0SLTHsHYkAY2ezHOMILAJaLw2UeAih/BuaTgQBrI3sM1KkDFM8IADV7zs2d9KV/pQ5Qzl5kaikQA4bHxWV8oLbHNYoyAnxeHDZVPQEUGIvwZLMgtL0VBm4XhznNWgovAI8956aTWRh+2SwIbW+BgQbfZvDzEFYAu8XhFI/7/53Ady2EoyaaZ+AscdjWbLdwAjDcL27tZk9T5ClgTLMgtH1EBhrUAYpjEljzxkkLQUZMYrTuW8UJ98cLOwLUfH3CrORT5JofgqLFrb2PMuD5SB6EnXACgNPFYUfVE0Anl5TPowdxqm2sM3C5OPwijNXmBeCz4GCK3AbMDgNC+0RkwDBOXLaEseIngOeAEZ4GDU+Iy2drngAKbEb4XBgQ2icCAwHqADU/CSzwJFK71fuoobvEYVbV8P9OJfA3tRBkhESG7/qMOIwK2917BCiwDuHrPiPAbHG5o0oAqxlJt3ct2rDAtF9ABnyKcwfsjd8tYDH4bCwUJki++n2/KVbOoXtWow4KRNuFZsDzXGZQa34jgP+xLq8l4CI3gnc9+qBAtF0IBgwH6MdgmcrhEL0rXbwFUP68WxevIQyoMmzYJS7DPCaAGxEmhgWh/UIyIMyXPDeF7O0vgPIvpsB1CFf2MH6fOEzxEIBWAo+ShXB915PnfBFMuO7v9PIcASoCWMEH6VNZ7Hlvl6lhsbhc3WMCOJxuysfA9EqKAUO5+P7MeiVgg0LxFUBFBEW+AtwH9DlqsObQgSlWvgBetTM4qHNt1zQD+zEs7PkU1rSV4zrUFcDRW0G50NMtwDBKjJAZ1f92U2ApUlshPAoo7fsuA12YCt+bgXvpxyMylW6b/DQUwDFnZiWn4fLPqPccm+DVVnQGAgsguiu10I4MqADaMSsJYlIBJEh2O7pSAbRjVhLEpAJIkOx2dKUCaMesJIhJBZAg2e3oSgXQjllJEJMKIEGy29GVCqAds5IgJhVAgmS3oysVQDtmJUFM/wdaDlOuM5Eu/AAAAABJRU5ErkJggg==")
|
||||
}
|
||||
|
||||
.ew-tree-table .ew-tree-icon-file:after {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAJNUlEQVR4Xu2dXYxdVRXHf2tghhYaoba1Qk1owIwmfVBaTKRgQqMPlGjig2nDnDsF0whSnwqJ4SNoU2OLUSNPVDSx2t47hEkxaQMBI1hB/EiE6osYqjGUYPGjCihN6Uy525wzt7UdZu7ZZ87a5949Z52XeVl77bX//9/d52vvM4IdtVZAaj16GzwGQM0hMAAMgJorUPPh2wxgANRcgZoP32YAA6DmCtR8+DYDGADVKuB2s4BB1gMbEYZxLEFYDlxQbSU97+0Ejn8hHMPxR4R9LOZxuZGTVVZW2QzgxlnGBNuBUYSLqhxkNH05jgN7GeIrsoF/VlF3cADcQc7nKHfiuM+M97Q0BUH4GpfxbVnHKc9WcwoLCoBrsRjHYwhr51Rd3Rs5foXwaUl4PZQUwQBwLa4AngZWhiq+JnlfBj4pCX8JMd4gALgxluJ4Hrg8RNE1zHkE4WoZ4Zj22NUBcOMsZILnEFZrF1vrfI5DDHGdbOCEpg76ADTZiXCXZpGWq6OAsFNGuEdTD1UA3B7exwDpdLUgt0jHqwjjwH6EF0NMb7k19DAgO03CKtp8pvNM5AO55TjeZoCVMsLfc2M9A3QBaPEQcGtO328hbOYw+2Qbbc8653WY28YAw3yONrsRLswZ7Pck4TYtQdQAcOMMMckbwMIuxaVPua6VhBe0BjCf8rgWa4Bf5jwVPcEgl8gGJjTGrgfAGDfgeCKnqC2SsEuj8Pmaw7W4HXiw6/iE9TLCkxoa6AHQyopOi5/5cLzCCq4M/WRLQ5Re5ug8Of1z11tox3el0UXrAgPQA6DJQYTru/R9ryTsKFBbbUNdK7vS/3qXH9PPpcE6DYH0AGjxEjA8a1Ft1sgohzSKnu853MNcRburVocl4UMaOugB0MxeYMx+BTt14fKmRtHzPYcb5+LOBfVsp9Pj0mCRhg56ALRw3QqSxPYgFDHMVaSnAVDElQpjDYAKxe7HrgyAfnSlwpoMgArF7seuDIB+dKXCmgyACsXux64MgH50pcKaDIAKxe7HrgyAfnSlwpoMgBnEduO8n0m+j+MahCUV+pHf1dQun18zyBdkA3/Lb9A9wgCYpk9nj8EfEC4tK27Q9o7XGOIjZXf2GADTAWjyQ4Sbg5qnl3yvJGwqk84AePcMkO6VSxdSxnAck4RlZQo1AN4NwF+By8qIWmHbo5Kwokx/BkDcp4A9kpQ7XRkA0wGY2nPw+yguAoVVZTd0GgAz3Qbu5VIGsr0H1wLvLTPFBmj772xJd5vbZJTXyuY3AMoqGHl7AyByA8uWbwCUVTDy9gZA5AaWLd8AKKtg5O0NgMgNLFu+AVBWwcjbGwCRG1i2fAOgrIKRtzcAIjewbPkGQFkFI29vAERuYNnyDYCZXgbZmsAzqmjtto5md7CtCTz3F1E/AGxN4DkE1A+AVvb9fFsT2MGgjgDYmsCz5oD6ARDXKcDWBE6/iC9LbOc7xLYmsK6ngHTcztYE1vc2sOyDldja24Og2BxTrtcAUBY0tnQGQGyOKddrACgLGls6AyA2x5TrNQCUBY0tnQEQm2PK9RoAyoLGls4AiM0x5XoNAGVBY0tnAMTmmHK9BsAMgqp+J1D5u37K/mMATFM02JpApe/6GQCB/8eNC7sgpPR3/QyA0ACEXRNY+rt+BkB4AEKuCSz9XT8DIDQAYU8BpdfwGQChAQj1ncD0IlDhu34GQGAAUoGV1wSqftfPAKgAAG2RQ+Rzu1nAIOuBjQjDOJYgLAcu0Oyv7Crr07VEszdQU7wQudw4y5hgOzCKcFGIPs7OaQCEVtgzvzvI+RzlThz3VWF8p6wJSXRmFJsBPI2eKazzdPIxhLUl0syl6RFJWDmXhtPbGABzVNG1uAJ4GnSMKFSG4zfS4JpCbWYJNgDmoKIbYymO54HL59C8fBPHj6TBLeUTgQFQUEU3zkImeA5hdcGmeuHCRhlhXCOhAVBQRddkJ8JdBZtphr/DIEtkA29qJDUACqjY2aF8BGFBbjPHq0j2K92P8KKMcKxbGzfGKhy/ABbn5N4vCZ/N7d8zwADwFCoNc63sv5XcmtPkLYTNHGafbKPtk76A+dDmwzLKSz55fWIMAB+VUvPHGWKSN4CFXZqcTP+djSS84JmWQuY7xqRB4pvbJ84A8FEpBWCMG3A8kRO+RRJ2eaZMZ5SPAj/zmPbTlEd5h6tkE//wze8TZwD4qDQ1/T8I3D5ruOMVVnClrOOUT8rMfMczCO/JjXdM4vi4jHIoN7ZggAHgKZhrchDh+i7h90rCDp90hcwHB9wiCXt8cheNMQA8FXOt7MJreNbwNmt8fqEFzU/t3ywNfuBZZuEwA8BTMtfkOMKFs4YPcknevblr8jHgKa9pf6qjQtcUnkM5J8wA8FSt7Dr9zHzJLvgWeXYZ3Py0DgPA040yABQ237FVGjzgWVqpME0A/tuVbsfF0uA/partYeO5AtDP5uvOAE3+hPDBWT0aYLXcxO966GGprucCQL+brw3AswifmFVlxz3SYGcpF3rYuCgA7mHW0uYn3ud8x93S4P6qh6h3CmiyC+GLXQAo9KCkaiHy+isCQMf8p3IeG/+/yx6ZrzsDtLgReLyrkI4vSSN7ohbd4QvAHMzfLg2+2itB9GaA9GXJBK93vVeGk7RZ6/PApFeCzNavDwCuxaeAAwV++fdLg7t7OVY1ANJBeL8udXyehEdFssecURx5AAB3AN8EzvMakOMBabDVKzZgkC4AYyynzcveCybgEYQDPgsmAmrgldoDAK88WVCfmK96DXB69K7JNxC+7K9GzSL7yPwwAKSLJid5Fri6Ztb6DHeXJGzxCawqRvUUcGYWmFo2/duerJmvSrni/fSd+UFmgDMQTG2c+Clkf+t+fEeS7CKx744gM8BZEKQrXNPbouv6buTVFHQSx83S4JFquiveS1AAsgvehxhkEXdUvHmyuBL6LZ5hgK39/v4jOABnZoN0+/QkO3DcVOEuWn1bu2V0vA38mPP4Vr8bf3oYlQFwFgjpXcJ6HBshe3u4NMQHFII7ny7UlOy/maYbPtI3oY9yigOyiePB+1bsoHIAFGu3VAoKGAAKIsacwgCI2T2F2g0ABRFjTmEAxOyeQu0GgIKIMacwAGJ2T6F2A0BBxJhTGAAxu6dQuwGgIGLMKf4HAR/hrhUhGSQAAAAASUVORK5CYII=")
|
||||
}
|
2265
public/static/admin/tree/treeTable.js
Normal file
2265
public/static/admin/tree/treeTable.js
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
65
vendor/composer/InstalledVersions.php
vendored
65
vendor/composer/InstalledVersions.php
vendored
@ -26,12 +26,12 @@ private static $installed = array (
|
||||
array (
|
||||
'firebase/php-jwt' =>
|
||||
array (
|
||||
'pretty_version' => 'v5.2.0',
|
||||
'version' => '5.2.0.0',
|
||||
'pretty_version' => 'v5.2.1',
|
||||
'version' => '5.2.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'feb0e820b8436873675fd3aca04f3728eb2185cb',
|
||||
'reference' => 'f42c9110abe98dd6cfe9053c49bc86acc70b2d23',
|
||||
),
|
||||
'league/flysystem' =>
|
||||
array (
|
||||
@ -71,12 +71,12 @@ private static $installed = array (
|
||||
),
|
||||
'phpmailer/phpmailer' =>
|
||||
array (
|
||||
'pretty_version' => 'v6.2.0',
|
||||
'version' => '6.2.0.0',
|
||||
'pretty_version' => 'v6.4.1',
|
||||
'version' => '6.4.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'e38888a75c070304ca5514197d4847a59a5c853f',
|
||||
'reference' => '9256f12d8fb0cd0500f93b19e18c356906cbed3d',
|
||||
),
|
||||
'psr/cache' =>
|
||||
array (
|
||||
@ -89,21 +89,21 @@ private static $installed = array (
|
||||
),
|
||||
'psr/container' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.0',
|
||||
'version' => '1.0.0.0',
|
||||
'pretty_version' => '1.1.1',
|
||||
'version' => '1.1.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'b7ce3b176482dbbc1245ebf52b181af44c2cf55f',
|
||||
'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf',
|
||||
),
|
||||
'psr/log' =>
|
||||
array (
|
||||
'pretty_version' => '1.1.3',
|
||||
'version' => '1.1.3.0',
|
||||
'pretty_version' => '1.1.4',
|
||||
'version' => '1.1.4.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '0f73288fd15629204f9d42b7055f72dacbe811fc',
|
||||
'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
|
||||
),
|
||||
'psr/simple-cache' =>
|
||||
array (
|
||||
@ -116,17 +116,17 @@ private static $installed = array (
|
||||
),
|
||||
'symfony/polyfill-mbstring' =>
|
||||
array (
|
||||
'pretty_version' => 'v1.22.0',
|
||||
'version' => '1.22.0.0',
|
||||
'pretty_version' => 'v1.22.1',
|
||||
'version' => '1.22.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'f377a3dd1fde44d37b9831d68dc8dea3ffd28e13',
|
||||
'reference' => '5232de97ee3b75b0360528dae24e73db49566ab1',
|
||||
),
|
||||
'symfony/polyfill-php72' =>
|
||||
array (
|
||||
'pretty_version' => 'v1.22.0',
|
||||
'version' => '1.22.0.0',
|
||||
'pretty_version' => 'v1.22.1',
|
||||
'version' => '1.22.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
@ -134,8 +134,8 @@ private static $installed = array (
|
||||
),
|
||||
'symfony/polyfill-php80' =>
|
||||
array (
|
||||
'pretty_version' => 'v1.22.0',
|
||||
'version' => '1.22.0.0',
|
||||
'pretty_version' => 'v1.22.1',
|
||||
'version' => '1.22.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
@ -143,12 +143,12 @@ private static $installed = array (
|
||||
),
|
||||
'symfony/var-dumper' =>
|
||||
array (
|
||||
'pretty_version' => 'v4.4.19',
|
||||
'version' => '4.4.19.0',
|
||||
'pretty_version' => 'v4.4.22',
|
||||
'version' => '4.4.22.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'a1eab2f69906dc83c5ddba4632180260d0ab4f7f',
|
||||
'reference' => 'c194bcedde6295f3ec3e9eba1f5d484ea97c41a7',
|
||||
),
|
||||
'taoser/taoler' =>
|
||||
array (
|
||||
@ -170,12 +170,12 @@ private static $installed = array (
|
||||
),
|
||||
'topthink/framework' =>
|
||||
array (
|
||||
'pretty_version' => 'v6.0.7',
|
||||
'version' => '6.0.7.0',
|
||||
'pretty_version' => 'v6.0.8',
|
||||
'version' => '6.0.8.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'db8fe22520a9660dd5e4c87e304034ac49e39270',
|
||||
'reference' => '4789343672aef06d571d556da369c0e156609bce',
|
||||
),
|
||||
'topthink/think-captcha' =>
|
||||
array (
|
||||
@ -206,12 +206,12 @@ private static $installed = array (
|
||||
),
|
||||
'topthink/think-orm' =>
|
||||
array (
|
||||
'pretty_version' => 'v2.0.36',
|
||||
'version' => '2.0.36.0',
|
||||
'pretty_version' => 'v2.0.40',
|
||||
'version' => '2.0.40.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'f48dc09050f25029d41a66bfc9c3c403e4f82024',
|
||||
'reference' => '1119d979b850849f3725856460cf108eec1c3eb8',
|
||||
),
|
||||
'topthink/think-template' =>
|
||||
array (
|
||||
@ -240,6 +240,15 @@ private static $installed = array (
|
||||
),
|
||||
'reference' => 'edce0ae2c9551ab65f9e94a222604b0dead3576d',
|
||||
),
|
||||
'wamkj/thinkphp6.0-databackup' =>
|
||||
array (
|
||||
'pretty_version' => 'v1.0',
|
||||
'version' => '1.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '28a0e406d827132942723a3c9f69bb20c98e652f',
|
||||
),
|
||||
'zzstudio/think-addons' =>
|
||||
array (
|
||||
'pretty_version' => '2.0.5',
|
||||
|
1
vendor/composer/autoload_files.php
vendored
1
vendor/composer/autoload_files.php
vendored
@ -7,6 +7,7 @@ $baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'9b552a3cc426e3287cc811caefa3cf53' => $vendorDir . '/topthink/think-helper/src/helper.php',
|
||||
'35fab96057f1bf5e7aba31a8a6d5fdde' => $vendorDir . '/topthink/think-orm/stubs/load_stubs.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php',
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
|
||||
|
1
vendor/composer/autoload_psr4.php
vendored
1
vendor/composer/autoload_psr4.php
vendored
@ -6,6 +6,7 @@ $vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'wamkj\\thinkphp\\' => array($vendorDir . '/wamkj/thinkphp6.0-databackup/src'),
|
||||
'think\\view\\driver\\' => array($vendorDir . '/topthink/think-view/src'),
|
||||
'think\\trace\\' => array($vendorDir . '/topthink/think-trace/src'),
|
||||
'think\\captcha\\' => array($vendorDir . '/topthink/think-captcha/src'),
|
||||
|
9
vendor/composer/autoload_static.php
vendored
9
vendor/composer/autoload_static.php
vendored
@ -8,6 +8,7 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
|
||||
{
|
||||
public static $files = array (
|
||||
'9b552a3cc426e3287cc811caefa3cf53' => __DIR__ . '/..' . '/topthink/think-helper/src/helper.php',
|
||||
'35fab96057f1bf5e7aba31a8a6d5fdde' => __DIR__ . '/..' . '/topthink/think-orm/stubs/load_stubs.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php',
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
|
||||
@ -17,6 +18,10 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
|
||||
);
|
||||
|
||||
public static $prefixLengthsPsr4 = array (
|
||||
'w' =>
|
||||
array (
|
||||
'wamkj\\thinkphp\\' => 15,
|
||||
),
|
||||
't' =>
|
||||
array (
|
||||
'think\\view\\driver\\' => 18,
|
||||
@ -62,6 +67,10 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
|
||||
);
|
||||
|
||||
public static $prefixDirsPsr4 = array (
|
||||
'wamkj\\thinkphp\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/wamkj/thinkphp6.0-databackup/src',
|
||||
),
|
||||
'think\\view\\driver\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/topthink/think-view/src',
|
||||
|
202
vendor/composer/installed.json
vendored
202
vendor/composer/installed.json
vendored
@ -2,17 +2,17 @@
|
||||
"packages": [
|
||||
{
|
||||
"name": "firebase/php-jwt",
|
||||
"version": "v5.2.0",
|
||||
"version_normalized": "5.2.0.0",
|
||||
"version": "v5.2.1",
|
||||
"version_normalized": "5.2.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/firebase/php-jwt.git",
|
||||
"reference": "feb0e820b8436873675fd3aca04f3728eb2185cb"
|
||||
"reference": "f42c9110abe98dd6cfe9053c49bc86acc70b2d23"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/firebase/php-jwt/zipball/feb0e820b8436873675fd3aca04f3728eb2185cb",
|
||||
"reference": "feb0e820b8436873675fd3aca04f3728eb2185cb",
|
||||
"url": "https://api.github.com/repos/firebase/php-jwt/zipball/f42c9110abe98dd6cfe9053c49bc86acc70b2d23",
|
||||
"reference": "f42c9110abe98dd6cfe9053c49bc86acc70b2d23",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -27,7 +27,7 @@
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": ">=4.8 <=9"
|
||||
},
|
||||
"time": "2020-03-25T18:49:23+00:00",
|
||||
"time": "2021-02-12T00:02:00+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -59,7 +59,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/firebase/php-jwt/issues",
|
||||
"source": "https://github.com/firebase/php-jwt/tree/master"
|
||||
"source": "https://github.com/firebase/php-jwt/tree/v5.2.1"
|
||||
},
|
||||
"install-path": "../firebase/php-jwt"
|
||||
},
|
||||
@ -333,17 +333,17 @@
|
||||
},
|
||||
{
|
||||
"name": "phpmailer/phpmailer",
|
||||
"version": "v6.2.0",
|
||||
"version_normalized": "6.2.0.0",
|
||||
"version": "v6.4.1",
|
||||
"version_normalized": "6.4.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
||||
"reference": "e38888a75c070304ca5514197d4847a59a5c853f"
|
||||
"reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e38888a75c070304ca5514197d4847a59a5c853f",
|
||||
"reference": "e38888a75c070304ca5514197d4847a59a5c853f",
|
||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/9256f12d8fb0cd0500f93b19e18c356906cbed3d",
|
||||
"reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -367,14 +367,14 @@
|
||||
"yoast/phpunit-polyfills": "^0.2.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mbstring": "Needed to send email in multibyte encoding charset",
|
||||
"ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
|
||||
"hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
|
||||
"league/oauth2-google": "Needed for Google XOAUTH2 authentication",
|
||||
"psr/log": "For optional PSR-3 debug logging",
|
||||
"stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication",
|
||||
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)"
|
||||
},
|
||||
"time": "2020-11-25T15:24:57+00:00",
|
||||
"time": "2021-04-29T12:25:04+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -406,7 +406,7 @@
|
||||
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
||||
"support": {
|
||||
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
|
||||
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.2.0"
|
||||
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.4.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -473,17 +473,17 @@
|
||||
},
|
||||
{
|
||||
"name": "psr/container",
|
||||
"version": "1.0.0",
|
||||
"version_normalized": "1.0.0.0",
|
||||
"version": "1.1.1",
|
||||
"version_normalized": "1.1.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/container.git",
|
||||
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
|
||||
"reference": "8622567409010282b7aeebe4bb841fe98b58dcaf"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
|
||||
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
|
||||
"url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf",
|
||||
"reference": "8622567409010282b7aeebe4bb841fe98b58dcaf",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -493,15 +493,10 @@
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
"php": ">=7.2.0"
|
||||
},
|
||||
"time": "2017-02-14T16:28:37+00:00",
|
||||
"time": "2021-03-05T17:36:06+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
@ -515,7 +510,7 @@
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
"homepage": "https://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common Container Interface (PHP FIG PSR-11)",
|
||||
@ -527,21 +522,25 @@
|
||||
"container-interop",
|
||||
"psr"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/php-fig/container/issues",
|
||||
"source": "https://github.com/php-fig/container/tree/1.1.1"
|
||||
},
|
||||
"install-path": "../psr/container"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
"version": "1.1.3",
|
||||
"version_normalized": "1.1.3.0",
|
||||
"version": "1.1.4",
|
||||
"version_normalized": "1.1.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/log.git",
|
||||
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
|
||||
"reference": "d49695b909c3b7628b6289db5479a1c204601f11"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
|
||||
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
|
||||
"reference": "d49695b909c3b7628b6289db5479a1c204601f11",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -553,7 +552,7 @@
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"time": "2020-03-23T09:12:05+00:00",
|
||||
"time": "2021-05-03T11:20:27+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
@ -573,7 +572,7 @@
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
"homepage": "https://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interface for logging libraries",
|
||||
@ -583,6 +582,9 @@
|
||||
"psr",
|
||||
"psr-3"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/log/tree/1.1.4"
|
||||
},
|
||||
"install-path": "../psr/log"
|
||||
},
|
||||
{
|
||||
@ -644,17 +646,17 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.22.0",
|
||||
"version_normalized": "1.22.0.0",
|
||||
"version": "v1.22.1",
|
||||
"version_normalized": "1.22.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13"
|
||||
"reference": "5232de97ee3b75b0360528dae24e73db49566ab1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f377a3dd1fde44d37b9831d68dc8dea3ffd28e13",
|
||||
"reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1",
|
||||
"reference": "5232de97ee3b75b0360528dae24e73db49566ab1",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -669,7 +671,7 @@
|
||||
"suggest": {
|
||||
"ext-mbstring": "For best performance"
|
||||
},
|
||||
"time": "2021-01-07T16:49:33+00:00",
|
||||
"time": "2021-01-22T09:19:47+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
@ -713,7 +715,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.0"
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -733,8 +735,8 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php72",
|
||||
"version": "v1.22.0",
|
||||
"version_normalized": "1.22.0.0",
|
||||
"version": "v1.22.1",
|
||||
"version_normalized": "1.22.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php72.git",
|
||||
@ -798,7 +800,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php72/tree/v1.22.0"
|
||||
"source": "https://github.com/symfony/polyfill-php72/tree/v1.22.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -818,8 +820,8 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php80",
|
||||
"version": "v1.22.0",
|
||||
"version_normalized": "1.22.0.0",
|
||||
"version": "v1.22.1",
|
||||
"version_normalized": "1.22.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php80.git",
|
||||
@ -890,7 +892,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php80/tree/v1.22.0"
|
||||
"source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -910,17 +912,17 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"version": "v4.4.19",
|
||||
"version_normalized": "4.4.19.0",
|
||||
"version": "v4.4.22",
|
||||
"version_normalized": "4.4.22.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-dumper.git",
|
||||
"reference": "a1eab2f69906dc83c5ddba4632180260d0ab4f7f"
|
||||
"reference": "c194bcedde6295f3ec3e9eba1f5d484ea97c41a7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/a1eab2f69906dc83c5ddba4632180260d0ab4f7f",
|
||||
"reference": "a1eab2f69906dc83c5ddba4632180260d0ab4f7f",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/c194bcedde6295f3ec3e9eba1f5d484ea97c41a7",
|
||||
"reference": "c194bcedde6295f3ec3e9eba1f5d484ea97c41a7",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -950,7 +952,7 @@
|
||||
"ext-intl": "To show region name in time zone dump",
|
||||
"symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script"
|
||||
},
|
||||
"time": "2021-01-27T09:09:26+00:00",
|
||||
"time": "2021-04-19T13:36:17+00:00",
|
||||
"bin": [
|
||||
"Resources/bin/var-dump-server"
|
||||
],
|
||||
@ -988,7 +990,7 @@
|
||||
"dump"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/var-dumper/tree/v4.4.19"
|
||||
"source": "https://github.com/symfony/var-dumper/tree/v4.4.22"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -1066,17 +1068,17 @@
|
||||
},
|
||||
{
|
||||
"name": "topthink/framework",
|
||||
"version": "v6.0.7",
|
||||
"version_normalized": "6.0.7.0",
|
||||
"version": "v6.0.8",
|
||||
"version_normalized": "6.0.8.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/top-think/framework.git",
|
||||
"reference": "db8fe22520a9660dd5e4c87e304034ac49e39270"
|
||||
"reference": "4789343672aef06d571d556da369c0e156609bce"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/framework/zipball/db8fe22520a9660dd5e4c87e304034ac49e39270",
|
||||
"reference": "db8fe22520a9660dd5e4c87e304034ac49e39270",
|
||||
"url": "https://api.github.com/repos/top-think/framework/zipball/4789343672aef06d571d556da369c0e156609bce",
|
||||
"reference": "4789343672aef06d571d556da369c0e156609bce",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -1102,7 +1104,7 @@
|
||||
"mockery/mockery": "^1.2",
|
||||
"phpunit/phpunit": "^7.0"
|
||||
},
|
||||
"time": "2021-01-25T14:48:29+00:00",
|
||||
"time": "2021-04-27T00:41:08+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -1134,7 +1136,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/top-think/framework/issues",
|
||||
"source": "https://github.com/top-think/framework/tree/v6.0.7"
|
||||
"source": "https://github.com/top-think/framework/tree/v6.0.8"
|
||||
},
|
||||
"install-path": "../topthink/framework"
|
||||
},
|
||||
@ -1299,17 +1301,17 @@
|
||||
},
|
||||
{
|
||||
"name": "topthink/think-orm",
|
||||
"version": "v2.0.36",
|
||||
"version_normalized": "2.0.36.0",
|
||||
"version": "v2.0.40",
|
||||
"version_normalized": "2.0.40.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/top-think/think-orm.git",
|
||||
"reference": "f48dc09050f25029d41a66bfc9c3c403e4f82024"
|
||||
"reference": "1119d979b850849f3725856460cf108eec1c3eb8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/think-orm/zipball/f48dc09050f25029d41a66bfc9c3c403e4f82024",
|
||||
"reference": "f48dc09050f25029d41a66bfc9c3c403e4f82024",
|
||||
"url": "https://api.github.com/repos/top-think/think-orm/zipball/1119d979b850849f3725856460cf108eec1c3eb8",
|
||||
"reference": "1119d979b850849f3725856460cf108eec1c3eb8",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -1320,19 +1322,25 @@
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"ext-pdo": "*",
|
||||
"php": ">=7.1.0",
|
||||
"psr/log": "~1.0",
|
||||
"psr/simple-cache": "^1.0",
|
||||
"topthink/think-helper": "^3.1"
|
||||
},
|
||||
"time": "2021-01-12T09:08:52+00:00",
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^7|^8|^9.5"
|
||||
},
|
||||
"time": "2021-04-19T13:29:37+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"think\\": "src"
|
||||
},
|
||||
"files": []
|
||||
"files": [
|
||||
"stubs/load_stubs.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
@ -1351,7 +1359,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/top-think/think-orm/issues",
|
||||
"source": "https://github.com/top-think/think-orm/tree/v2.0.36"
|
||||
"source": "https://github.com/top-think/think-orm/tree/v2.0.40"
|
||||
},
|
||||
"install-path": "../topthink/think-orm"
|
||||
},
|
||||
@ -1507,6 +1515,60 @@
|
||||
"description": "thinkphp template driver",
|
||||
"install-path": "../topthink/think-view"
|
||||
},
|
||||
{
|
||||
"name": "wamkj/thinkphp6.0-databackup",
|
||||
"version": "v1.0",
|
||||
"version_normalized": "1.0.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/wamkj/thinkphp6.0-databackup.git",
|
||||
"reference": "28a0e406d827132942723a3c9f69bb20c98e652f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/wamkj/thinkphp6.0-databackup/zipball/28a0e406d827132942723a3c9f69bb20c98e652f",
|
||||
"reference": "28a0e406d827132942723a3c9f69bb20c98e652f",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1.0",
|
||||
"topthink/framework": "^6.0"
|
||||
},
|
||||
"time": "2020-02-15T13:04:16+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"wamkj\\thinkphp\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"Apache-2.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "wamkj",
|
||||
"email": "1149183529@qq.com"
|
||||
}
|
||||
],
|
||||
"description": "thinkphp6.0的数据库自动备份扩展",
|
||||
"keywords": [
|
||||
"think-databackup",
|
||||
"thinkphp"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/wamkj/thinkphp6.0-databackup/issues",
|
||||
"source": "https://github.com/wamkj/thinkphp6.0-databackup/tree/v1.0"
|
||||
},
|
||||
"install-path": "../wamkj/thinkphp6.0-databackup"
|
||||
},
|
||||
{
|
||||
"name": "zzstudio/think-addons",
|
||||
"version": "2.0.5",
|
||||
|
65
vendor/composer/installed.php
vendored
65
vendor/composer/installed.php
vendored
@ -13,12 +13,12 @@
|
||||
array (
|
||||
'firebase/php-jwt' =>
|
||||
array (
|
||||
'pretty_version' => 'v5.2.0',
|
||||
'version' => '5.2.0.0',
|
||||
'pretty_version' => 'v5.2.1',
|
||||
'version' => '5.2.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'feb0e820b8436873675fd3aca04f3728eb2185cb',
|
||||
'reference' => 'f42c9110abe98dd6cfe9053c49bc86acc70b2d23',
|
||||
),
|
||||
'league/flysystem' =>
|
||||
array (
|
||||
@ -58,12 +58,12 @@
|
||||
),
|
||||
'phpmailer/phpmailer' =>
|
||||
array (
|
||||
'pretty_version' => 'v6.2.0',
|
||||
'version' => '6.2.0.0',
|
||||
'pretty_version' => 'v6.4.1',
|
||||
'version' => '6.4.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'e38888a75c070304ca5514197d4847a59a5c853f',
|
||||
'reference' => '9256f12d8fb0cd0500f93b19e18c356906cbed3d',
|
||||
),
|
||||
'psr/cache' =>
|
||||
array (
|
||||
@ -76,21 +76,21 @@
|
||||
),
|
||||
'psr/container' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.0',
|
||||
'version' => '1.0.0.0',
|
||||
'pretty_version' => '1.1.1',
|
||||
'version' => '1.1.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'b7ce3b176482dbbc1245ebf52b181af44c2cf55f',
|
||||
'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf',
|
||||
),
|
||||
'psr/log' =>
|
||||
array (
|
||||
'pretty_version' => '1.1.3',
|
||||
'version' => '1.1.3.0',
|
||||
'pretty_version' => '1.1.4',
|
||||
'version' => '1.1.4.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '0f73288fd15629204f9d42b7055f72dacbe811fc',
|
||||
'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
|
||||
),
|
||||
'psr/simple-cache' =>
|
||||
array (
|
||||
@ -103,17 +103,17 @@
|
||||
),
|
||||
'symfony/polyfill-mbstring' =>
|
||||
array (
|
||||
'pretty_version' => 'v1.22.0',
|
||||
'version' => '1.22.0.0',
|
||||
'pretty_version' => 'v1.22.1',
|
||||
'version' => '1.22.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'f377a3dd1fde44d37b9831d68dc8dea3ffd28e13',
|
||||
'reference' => '5232de97ee3b75b0360528dae24e73db49566ab1',
|
||||
),
|
||||
'symfony/polyfill-php72' =>
|
||||
array (
|
||||
'pretty_version' => 'v1.22.0',
|
||||
'version' => '1.22.0.0',
|
||||
'pretty_version' => 'v1.22.1',
|
||||
'version' => '1.22.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
@ -121,8 +121,8 @@
|
||||
),
|
||||
'symfony/polyfill-php80' =>
|
||||
array (
|
||||
'pretty_version' => 'v1.22.0',
|
||||
'version' => '1.22.0.0',
|
||||
'pretty_version' => 'v1.22.1',
|
||||
'version' => '1.22.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
@ -130,12 +130,12 @@
|
||||
),
|
||||
'symfony/var-dumper' =>
|
||||
array (
|
||||
'pretty_version' => 'v4.4.19',
|
||||
'version' => '4.4.19.0',
|
||||
'pretty_version' => 'v4.4.22',
|
||||
'version' => '4.4.22.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'a1eab2f69906dc83c5ddba4632180260d0ab4f7f',
|
||||
'reference' => 'c194bcedde6295f3ec3e9eba1f5d484ea97c41a7',
|
||||
),
|
||||
'taoser/taoler' =>
|
||||
array (
|
||||
@ -157,12 +157,12 @@
|
||||
),
|
||||
'topthink/framework' =>
|
||||
array (
|
||||
'pretty_version' => 'v6.0.7',
|
||||
'version' => '6.0.7.0',
|
||||
'pretty_version' => 'v6.0.8',
|
||||
'version' => '6.0.8.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'db8fe22520a9660dd5e4c87e304034ac49e39270',
|
||||
'reference' => '4789343672aef06d571d556da369c0e156609bce',
|
||||
),
|
||||
'topthink/think-captcha' =>
|
||||
array (
|
||||
@ -193,12 +193,12 @@
|
||||
),
|
||||
'topthink/think-orm' =>
|
||||
array (
|
||||
'pretty_version' => 'v2.0.36',
|
||||
'version' => '2.0.36.0',
|
||||
'pretty_version' => 'v2.0.40',
|
||||
'version' => '2.0.40.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'f48dc09050f25029d41a66bfc9c3c403e4f82024',
|
||||
'reference' => '1119d979b850849f3725856460cf108eec1c3eb8',
|
||||
),
|
||||
'topthink/think-template' =>
|
||||
array (
|
||||
@ -227,6 +227,15 @@
|
||||
),
|
||||
'reference' => 'edce0ae2c9551ab65f9e94a222604b0dead3576d',
|
||||
),
|
||||
'wamkj/thinkphp6.0-databackup' =>
|
||||
array (
|
||||
'pretty_version' => 'v1.0',
|
||||
'version' => '1.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '28a0e406d827132942723a3c9f69bb20c98e652f',
|
||||
),
|
||||
'zzstudio/think-addons' =>
|
||||
array (
|
||||
'pretty_version' => '2.0.5',
|
||||
|
1
vendor/composer/platform_check.php
vendored
1
vendor/composer/platform_check.php
vendored
@ -15,6 +15,7 @@ extension_loaded('filter') || $missingExtensions[] = 'filter';
|
||||
extension_loaded('hash') || $missingExtensions[] = 'hash';
|
||||
extension_loaded('json') || $missingExtensions[] = 'json';
|
||||
extension_loaded('mbstring') || $missingExtensions[] = 'mbstring';
|
||||
extension_loaded('pdo') || $missingExtensions[] = 'pdo';
|
||||
|
||||
if ($missingExtensions) {
|
||||
$issues[] = 'Your Composer dependencies require the following PHP extensions to be installed: ' . implode(', ', $missingExtensions);
|
||||
|
13
vendor/firebase/php-jwt/README.md
vendored
13
vendor/firebase/php-jwt/README.md
vendored
@ -115,6 +115,19 @@ echo "Decode:\n" . print_r($decoded_array, true) . "\n";
|
||||
?>
|
||||
```
|
||||
|
||||
Using JWKs
|
||||
----------
|
||||
|
||||
```php
|
||||
// Set of keys. The "keys" key is required. For example, the JSON response to
|
||||
// this endpoint: https://www.gstatic.com/iap/verify/public_key-jwk
|
||||
$jwks = ['keys' => []];
|
||||
|
||||
// JWK::parseKeySet($jwks) returns an associative array of **kid** to private
|
||||
// key. Pass this as the second parameter to JWT::decode.
|
||||
JWT::decode($payload, JWK::parseKeySet($jwks), $supportedAlgorithm);
|
||||
```
|
||||
|
||||
Changelog
|
||||
---------
|
||||
|
||||
|
1
vendor/firebase/php-jwt/src/JWK.php
vendored
1
vendor/firebase/php-jwt/src/JWK.php
vendored
@ -3,6 +3,7 @@
|
||||
namespace Firebase\JWT;
|
||||
|
||||
use DomainException;
|
||||
use InvalidArgumentException;
|
||||
use UnexpectedValueException;
|
||||
|
||||
/**
|
||||
|
127
vendor/phpmailer/phpmailer/README.md
vendored
127
vendor/phpmailer/phpmailer/README.md
vendored
@ -1,46 +1,45 @@
|
||||
![PHPMailer](https://raw.github.com/PHPMailer/PHPMailer/master/examples/images/phpmailer.png)
|
||||
|
||||
# PHPMailer - A full-featured email creation and transfer class for PHP
|
||||
# PHPMailer – A full-featured email creation and transfer class for PHP
|
||||
|
||||
Build status: [![Build Status](https://travis-ci.org/PHPMailer/PHPMailer.svg)](https://travis-ci.org/PHPMailer/PHPMailer)
|
||||
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/badges/quality-score.png?s=3758e21d279becdf847a557a56a3ed16dfec9d5d)](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/)
|
||||
[![Code Coverage](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/badges/coverage.png?s=3fe6ca5fe8cd2cdf96285756e42932f7ca256962)](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/)
|
||||
[![Test status](https://github.com/PHPMailer/PHPMailer/workflows/Tests/badge.svg)](https://github.com/PHPMailer/PHPMailer/actions) [![Latest Stable Version](https://poser.pugx.org/phpmailer/phpmailer/v/stable.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![Total Downloads](https://poser.pugx.org/phpmailer/phpmailer/downloads)](https://packagist.org/packages/phpmailer/phpmailer) [![License](https://poser.pugx.org/phpmailer/phpmailer/license.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![API Docs](https://github.com/phpmailer/phpmailer/workflows/Docs/badge.svg)](https://phpmailer.github.io/PHPMailer/)
|
||||
|
||||
[![Latest Stable Version](https://poser.pugx.org/phpmailer/phpmailer/v/stable.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![Total Downloads](https://poser.pugx.org/phpmailer/phpmailer/downloads)](https://packagist.org/packages/phpmailer/phpmailer) [![Latest Unstable Version](https://poser.pugx.org/phpmailer/phpmailer/v/unstable.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![License](https://poser.pugx.org/phpmailer/phpmailer/license.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![API Docs](https://github.com/phpmailer/phpmailer/workflows/Docs/badge.svg)](http://phpmailer.github.io/PHPMailer/)
|
||||
|
||||
## Class Features
|
||||
## Features
|
||||
- Probably the world's most popular code for sending email from PHP!
|
||||
- Used by many open-source projects: WordPress, Drupal, 1CRM, SugarCRM, Yii, Joomla! and many more
|
||||
- Integrated SMTP support - send without a local mail server
|
||||
- Integrated SMTP support – send without a local mail server
|
||||
- Send emails with multiple To, CC, BCC and Reply-to addresses
|
||||
- Multipart/alternative emails for mail clients that do not read HTML email
|
||||
- Add attachments, including inline
|
||||
- Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings
|
||||
- SMTP authentication with LOGIN, PLAIN, CRAM-MD5, and XOAUTH2 mechanisms over SSL and SMTP+STARTTLS transports
|
||||
- SMTP authentication with LOGIN, PLAIN, CRAM-MD5, and XOAUTH2 mechanisms over SMTPS and SMTP+STARTTLS transports
|
||||
- Validates email addresses automatically
|
||||
- Protect against header injection attacks
|
||||
- Protects against header injection attacks
|
||||
- Error messages in over 50 languages!
|
||||
- DKIM and S/MIME signing support
|
||||
- Compatible with PHP 5.5 and later
|
||||
- Compatible with PHP 5.5 and later, including PHP 8.0
|
||||
- Namespaced to prevent name clashes
|
||||
- Much more!
|
||||
|
||||
## Why you might need it
|
||||
Many PHP developers need to send email from their code. The only PHP function that supports this is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as encryption, authentication, HTML messages, and attachments.
|
||||
Many PHP developers need to send email from their code. The only PHP function that supports this directly is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as encryption, authentication, HTML messages, and attachments.
|
||||
|
||||
Formatting email correctly is surprisingly difficult. There are myriad overlapping RFCs, requiring tight adherence to horribly complicated formatting and encoding rules – the vast majority of code that you'll find online that uses the `mail()` function directly is just plain wrong!
|
||||
*Please* don't be tempted to do it yourself – if you don't use PHPMailer, there are many other excellent libraries that you should look at before rolling your own. Try [SwiftMailer](https://swiftmailer.symfony.com/), [Zend/Mail](https://zendframework.github.io/zend-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail) etc.
|
||||
Formatting email correctly is surprisingly difficult. There are myriad overlapping (and conflicting) standards, requiring tight adherence to horribly complicated formatting and encoding rules – the vast majority of code that you'll find online that uses the `mail()` function directly is just plain wrong, if not unsafe!
|
||||
|
||||
The PHP `mail()` function usually sends via a local mail server, typically fronted by a `sendmail` binary on Linux, BSD, and macOS platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP implementation allows email sending on Windows platforms without a local mail server.
|
||||
The PHP `mail()` function usually sends via a local mail server, typically fronted by a `sendmail` binary on Linux, BSD, and macOS platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP client allows email sending on all platforms without needing a local mail server. Be aware though, that the `mail()` function should be avoided when possible; it's both faster and [safer](https://exploitbox.io/paper/Pwning-PHP-Mail-Function-For-Fun-And-RCE.html) to use SMTP to localhost.
|
||||
|
||||
*Please* don't be tempted to do it yourself – if you don't use PHPMailer, there are many other excellent libraries that
|
||||
you should look at before rolling your own. Try [SwiftMailer](https://swiftmailer.symfony.com/)
|
||||
, [Laminas/Mail](https://docs.laminas.dev/laminas-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail) etc.
|
||||
|
||||
## License
|
||||
This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) license, along with the [GPL Cooperation Commitment](https://gplcc.github.io/gplcc/). Please read LICENSE for information on the software availability and distribution.
|
||||
This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) license, along with the [GPL Cooperation Commitment](https://gplcc.github.io/gplcc/). Please read [LICENSE](https://github.com/PHPMailer/PHPMailer/blob/master/LICENSE) for information on the software availability and distribution.
|
||||
|
||||
## Installation & loading
|
||||
PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file:
|
||||
|
||||
```json
|
||||
"phpmailer/phpmailer": "~6.1"
|
||||
"phpmailer/phpmailer": "^6.2"
|
||||
```
|
||||
|
||||
or run
|
||||
@ -53,7 +52,8 @@ Note that the `vendor` folder and the `vendor/autoload.php` script are generated
|
||||
|
||||
If you want to use the Gmail XOAUTH2 authentication class, you will also need to add a dependency on the `league/oauth2-client` package in your `composer.json`.
|
||||
|
||||
Alternatively, if you're not using Composer, copy the contents of the PHPMailer folder into one of the `include_path` directories specified in your PHP configuration and load each class file manually:
|
||||
Alternatively, if you're not using Composer, you
|
||||
can [download PHPMailer as a zip file](https://github.com/PHPMailer/PHPMailer/archive/master.zip), (note that docs and examples are not included in the zip file), then copy the contents of the PHPMailer folder into one of the `include_path` directories specified in your PHP configuration and load each class file manually:
|
||||
|
||||
```php
|
||||
<?php
|
||||
@ -65,60 +65,58 @@ require 'path/to/PHPMailer/src/PHPMailer.php';
|
||||
require 'path/to/PHPMailer/src/SMTP.php';
|
||||
```
|
||||
|
||||
If you're not using the `SMTP` class explicitly (you're probably not), you don't need a `use` line for the SMTP class.
|
||||
|
||||
If you don't speak git or just want a tarball, click the 'zip' button on the right of the project page in GitHub, though note that docs and examples are not included in the tarball.
|
||||
If you're not using the `SMTP` class explicitly (you're probably not), you don't need a `use` line for the SMTP class. Even if you're not using exceptions, you do still need to load the `Exception` class as it is used internally.
|
||||
|
||||
## Legacy versions
|
||||
PHPMailer 5.2 (which is compatible with PHP 5.0 - 7.0) is no longer being supported, even for security updates. You will find the latest version of 5.2 in the [5.2-stable branch](https://github.com/PHPMailer/PHPMailer/tree/5.2-stable). If you're using PHP 5.5 or later (which you should be), switch to the 6.x releases.
|
||||
PHPMailer 5.2 (which is compatible with PHP 5.0 — 7.0) is no longer supported, even for security updates. You will find the latest version of 5.2 in the [5.2-stable branch](https://github.com/PHPMailer/PHPMailer/tree/5.2-stable). If you're using PHP 5.5 or later (which you should be), switch to the 6.x releases.
|
||||
|
||||
### Upgrading from 5.2
|
||||
The biggest changes are that source files are now in the `src/` folder, and PHPMailer now declares the namespace `PHPMailer\PHPMailer`. This has several important effects – [read the upgrade guide](https://github.com/PHPMailer/PHPMailer/tree/master/UPGRADING.md) for more details.
|
||||
|
||||
### Minimal installation
|
||||
While installing the entire package manually or with Composer is simple, convenient, and reliable, you may want to include only vital files in your project. At the very least you will need [src/PHPMailer.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/PHPMailer.php). If you're using SMTP, you'll need [src/SMTP.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/SMTP.php), and if you're using POP-before SMTP, you'll need [src/POP3.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/POP3.php). You can skip the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder if you're not showing errors to users and can make do with English-only errors. If you're using XOAUTH2 you will need [src/OAuth.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/OAuth.php) as well as the Composer dependencies for the services you wish to authenticate with. Really, it's much easier to use Composer!
|
||||
While installing the entire package manually or with Composer is simple, convenient, and reliable, you may want to include only vital files in your project. At the very least you will need [src/PHPMailer.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/PHPMailer.php). If you're using SMTP, you'll need [src/SMTP.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/SMTP.php), and if you're using POP-before SMTP (*very* unlikely!), you'll need [src/POP3.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/POP3.php). You can skip the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder if you're not showing errors to users and can make do with English-only errors. If you're using XOAUTH2 you will need [src/OAuth.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/OAuth.php) as well as the Composer dependencies for the services you wish to authenticate with. Really, it's much easier to use Composer!
|
||||
|
||||
## A Simple Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
// Import PHPMailer classes into the global namespace
|
||||
// These must be at the top of your script, not inside a function
|
||||
//Import PHPMailer classes into the global namespace
|
||||
//These must be at the top of your script, not inside a function
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\SMTP;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
|
||||
// Load Composer's autoloader
|
||||
//Load Composer's autoloader
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
// Instantiation and passing `true` enables exceptions
|
||||
//Instantiation and passing `true` enables exceptions
|
||||
$mail = new PHPMailer(true);
|
||||
|
||||
try {
|
||||
//Server settings
|
||||
$mail->SMTPDebug = SMTP::DEBUG_SERVER; // Enable verbose debug output
|
||||
$mail->isSMTP(); // Send using SMTP
|
||||
$mail->Host = 'smtp1.example.com'; // Set the SMTP server to send through
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = 'user@example.com'; // SMTP username
|
||||
$mail->Password = 'secret'; // SMTP password
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged
|
||||
$mail->Port = 587; // TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above
|
||||
$mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output
|
||||
$mail->isSMTP(); //Send using SMTP
|
||||
$mail->Host = 'smtp.example.com'; //Set the SMTP server to send through
|
||||
$mail->SMTPAuth = true; //Enable SMTP authentication
|
||||
$mail->Username = 'user@example.com'; //SMTP username
|
||||
$mail->Password = 'secret'; //SMTP password
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; //Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged
|
||||
$mail->Port = 587; //TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above
|
||||
|
||||
//Recipients
|
||||
$mail->setFrom('from@example.com', 'Mailer');
|
||||
$mail->addAddress('joe@example.net', 'Joe User'); // Add a recipient
|
||||
$mail->addAddress('ellen@example.com'); // Name is optional
|
||||
$mail->addAddress('joe@example.net', 'Joe User'); //Add a recipient
|
||||
$mail->addAddress('ellen@example.com'); //Name is optional
|
||||
$mail->addReplyTo('info@example.com', 'Information');
|
||||
$mail->addCC('cc@example.com');
|
||||
$mail->addBCC('bcc@example.com');
|
||||
|
||||
// Attachments
|
||||
$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
|
||||
$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
|
||||
//Attachments
|
||||
$mail->addAttachment('/var/tmp/file.tar.gz'); //Add attachments
|
||||
$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); //Optional name
|
||||
|
||||
// Content
|
||||
$mail->isHTML(true); // Set email format to HTML
|
||||
//Content
|
||||
$mail->isHTML(true); //Set email format to HTML
|
||||
$mail->Subject = 'Here is the subject';
|
||||
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
@ -130,7 +128,7 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
You'll find plenty more to play with in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder.
|
||||
You'll find plenty to play with in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder, which covers many common scenarios including sending through gmail, building contact forms, sending to mailing lists, and more.
|
||||
|
||||
If you are re-using the instance (e.g. when sending to a mailing list), you may need to clear the recipient list to avoid sending duplicate messages. See [the mailing list example](https://github.com/PHPMailer/PHPMailer/blob/master/examples/mailing_list.phps) for further guidance.
|
||||
|
||||
@ -140,43 +138,43 @@ That's it. You should now be ready to use PHPMailer!
|
||||
PHPMailer defaults to English, but in the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder you'll find many translations for PHPMailer error messages that you may encounter. Their filenames contain [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the translations, for example `fr` for French. To specify a language, you need to tell PHPMailer which one to use, like this:
|
||||
|
||||
```php
|
||||
// To load the French version
|
||||
//To load the French version
|
||||
$mail->setLanguage('fr', '/optional/path/to/language/directory/');
|
||||
```
|
||||
|
||||
We welcome corrections and new languages - if you're looking for corrections to do, run the [PHPMailerLangTest.php](https://github.com/PHPMailer/PHPMailer/tree/master/test/PHPMailerLangTest.php) script in the tests folder and it will show any missing translations.
|
||||
We welcome corrections and new languages – if you're looking for corrections, run the [PHPMailerLangTest.php](https://github.com/PHPMailer/PHPMailer/tree/master/test/PHPMailerLangTest.php) script in the tests folder and it will show any missing translations.
|
||||
|
||||
## Documentation
|
||||
Start reading at the [GitHub wiki](https://github.com/PHPMailer/PHPMailer/wiki). If you're having trouble, this should be the first place you look as it's the most frequently updated.
|
||||
Start reading at the [GitHub wiki](https://github.com/PHPMailer/PHPMailer/wiki). If you're having trouble, head for [the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting) as it's frequently updated.
|
||||
|
||||
Examples of how to use PHPMailer for common scenarios can be found in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder. If you're looking for a good starting point, we recommend you start with [the Gmail example](https://github.com/PHPMailer/PHPMailer/tree/master/examples/gmail.phps).
|
||||
|
||||
Note that in order to reduce PHPMailer's deployed code footprint, the examples are no longer included if you load PHPMailer via Composer or via [GitHub's zip file download](https://github.com/PHPMailer/PHPMailer/archive/master.zip), so you'll need to either clone the git repository or use the above links to get to the examples directly.
|
||||
To reduce PHPMailer's deployed code footprint, examples are not included if you load PHPMailer via Composer or via [GitHub's zip file download](https://github.com/PHPMailer/PHPMailer/archive/master.zip), so you'll need to either clone the git repository or use the above links to get to the examples directly.
|
||||
|
||||
Complete generated API documentation is [available online](http://phpmailer.github.io/PHPMailer/).
|
||||
Complete generated API documentation is [available online](https://phpmailer.github.io/PHPMailer/).
|
||||
|
||||
You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](http://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailerTest.php) a good source of how to do various operations such as encryption.
|
||||
You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](http://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailerTest.php) a good reference for how to do various operations such as encryption.
|
||||
|
||||
If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](http://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting).
|
||||
|
||||
## Tests
|
||||
There is a PHPUnit test script in the [test](https://github.com/PHPMailer/PHPMailer/tree/master/test/) folder. PHPMailer uses PHPUnit 4.8 - we would use 5.x but we need to run on PHP 5.5.
|
||||
[PHPMailer tests](https://github.com/PHPMailer/PHPMailer/tree/master/test/) use PHPUnit 9, with [a polyfill](https://github.com/Yoast/PHPUnit-Polyfills) to let 9-style tests run on older PHPUnit and PHP versions.
|
||||
|
||||
Build status: [![Build Status](https://travis-ci.org/PHPMailer/PHPMailer.svg)](https://travis-ci.org/PHPMailer/PHPMailer)
|
||||
[![Test status](https://github.com/PHPMailer/PHPMailer/workflows/Tests/badge.svg)](https://github.com/PHPMailer/PHPMailer/actions)
|
||||
|
||||
If this isn't passing, is there something you can do to help?
|
||||
|
||||
## Security
|
||||
Please disclose any vulnerabilities found responsibly – report security issues to the maintainers privately.
|
||||
|
||||
See [SECURITY](https://github.com/PHPMailer/PHPMailer/tree/master/SECURITY.md) for details on security issues.
|
||||
See [SECURITY](https://github.com/PHPMailer/PHPMailer/tree/master/SECURITY.md) and [PHPMailer's security advisories on GitHub](https://github.com/PHPMailer/PHPMailer/security).
|
||||
|
||||
## Contributing
|
||||
Please submit bug reports, suggestions and pull requests to the [GitHub issue tracker](https://github.com/PHPMailer/PHPMailer/issues).
|
||||
|
||||
We're particularly interested in fixing edge-cases, expanding test coverage and updating translations.
|
||||
|
||||
If you found a mistake in the docs, or want to add something, go ahead and amend the wiki - anyone can edit it.
|
||||
If you found a mistake in the docs, or want to add something, go ahead and amend the wiki – anyone can edit it.
|
||||
|
||||
If you have git clones from prior to the move to the PHPMailer GitHub organisation, you'll need to update any remote URLs referencing the old GitHub location with a command like this from within your clone:
|
||||
|
||||
@ -187,27 +185,36 @@ git remote set-url upstream https://github.com/PHPMailer/PHPMailer.git
|
||||
Please *don't* use the SourceForge or Google Code projects any more; they are obsolete and no longer maintained.
|
||||
|
||||
## Sponsorship
|
||||
Development time and resources for PHPMailer are provided by [Smartmessages.net](https://info.smartmessages.net/), a powerful email marketing system.
|
||||
Development time and resources for PHPMailer are provided by [Smartmessages.net](https://info.smartmessages.net/), the world's only privacy-first email marketing system.
|
||||
|
||||
<a href="https://info.smartmessages.net/"><img src="https://www.smartmessages.net/img/smartmessages-logo.svg" width="250" height="28" alt="Smartmessages email marketing"></a>
|
||||
<a href="https://info.smartmessages.net/"><img src="https://www.smartmessages.net/img/smartmessages-logo.svg" width="550" alt="Smartmessages.net privacy-first email marketing logo"></a>
|
||||
|
||||
Other contributions are gladly received, whether in beer 🍺, T-shirts 👕, Amazon wishlist raids, or cold, hard cash 💰. If you'd like to donate to say "thank you" to maintainers or contributors, please contact them through individual profile pages via [the contributors page](https://github.com/PHPMailer/PHPMailer/graphs/contributors).
|
||||
Donations are very welcome, whether in beer 🍺, T-shirts 👕, or cold, hard cash 💰. Sponsorship through GitHub is a simple and convenient way to say "thank you" to PHPMailer's maintainers and contributors – just click the "Sponsor" button [on the project page](https://github.com/PHPMailer/PHPMailer). If your company uses PHPMailer, consider taking part in Tidelift's enterprise support programme.
|
||||
|
||||
## PHPMailer For Enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription.
|
||||
|
||||
The maintainers of PHPMailer and thousands of other packages are working with Tidelift to deliver commercial
|
||||
support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and
|
||||
improve code health, while paying the maintainers of the exact packages you
|
||||
use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-phpmailer-phpmailer?utm_source=packagist-phpmailer-phpmailer&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
|
||||
## Changelog
|
||||
See [changelog](changelog.md).
|
||||
|
||||
## History
|
||||
- PHPMailer was originally written in 2001 by Brent R. Matzelle as a [SourceForge project](http://sourceforge.net/projects/phpmailer/).
|
||||
- Marcus Bointon (coolbru on SF) and Andy Prevost (codeworxtech) took over the project in 2004.
|
||||
- [Marcus Bointon](https://github.com/Synchro) (`coolbru` on SF) and Andy Prevost (`codeworxtech`) took over the project in 2004.
|
||||
- Became an Apache incubator project on Google Code in 2010, managed by Jim Jagielski.
|
||||
- Marcus created his fork on [GitHub](https://github.com/Synchro/PHPMailer) in 2008.
|
||||
- Marcus created [his fork on GitHub](https://github.com/Synchro/PHPMailer) in 2008.
|
||||
- Jim and Marcus decide to join forces and use GitHub as the canonical and official repo for PHPMailer in 2013.
|
||||
- PHPMailer moves to the [PHPMailer organisation](https://github.com/PHPMailer) on GitHub in 2013.
|
||||
- PHPMailer moves to [the PHPMailer organisation](https://github.com/PHPMailer) on GitHub in 2013.
|
||||
|
||||
### What's changed since moving from SourceForge?
|
||||
- Official successor to the SourceForge and Google Code projects.
|
||||
- Test suite.
|
||||
- Continuous integration with Travis-CI.
|
||||
- Continuous integration with Github Actions.
|
||||
- Composer support.
|
||||
- Public development.
|
||||
- Additional languages and language strings.
|
||||
|
4
vendor/phpmailer/phpmailer/SECURITY.md
vendored
4
vendor/phpmailer/phpmailer/SECURITY.md
vendored
@ -1,6 +1,8 @@
|
||||
# Security notices relating to PHPMailer
|
||||
|
||||
Please disclose any vulnerabilities found responsibly - report any security problems found to the maintainers privately.
|
||||
Please disclose any security issues or vulnerabilities found through [Tidelift's coordinated disclosure system](https://tidelift.com/security) or to the maintainers privately.
|
||||
|
||||
PHPMailer versions between 6.1.8 and 6.4.0 contain a regression of the earlier CVE-2018-19296 object injection vulnerability as a result of [a fix for Windows UNC paths in 6.1.8](https://github.com/PHPMailer/PHPMailer/commit/e2e07a355ee8ff36aba21d0242c5950c56e4c6f9). Recorded as [CVE-2020-36326](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-36326). Reported by Fariskhi Vidyan via Tidelift. 6.4.1 fixes this issue, and also enforces stricter checks for URL schemes in local path contexts.
|
||||
|
||||
PHPMailer versions 6.1.5 and earlier contain an output escaping bug that occurs in `Content-Type` and `Content-Disposition` when filenames passed into `addAttachment` and other methods that accept attachment names contain double quote characters, in contravention of RFC822 3.4.1. No specific vulnerability has been found relating to this, but it could allow file attachments to bypass attachment filters that are based on matching filename extensions. Recorded as [CVE-2020-13625](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-13625). Reported by Elar Lang of Clarified Security.
|
||||
|
||||
|
2
vendor/phpmailer/phpmailer/VERSION
vendored
2
vendor/phpmailer/phpmailer/VERSION
vendored
@ -1 +1 @@
|
||||
6.2.0
|
||||
6.4.1
|
8
vendor/phpmailer/phpmailer/composer.json
vendored
8
vendor/phpmailer/phpmailer/composer.json
vendored
@ -40,7 +40,7 @@
|
||||
"yoast/phpunit-polyfills": "^0.2.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mbstring": "Needed to send email in multibyte encoding charset",
|
||||
"ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
|
||||
"hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
|
||||
"league/oauth2-google": "Needed for Google XOAUTH2 authentication",
|
||||
"psr/log": "For optional PSR-3 debug logging",
|
||||
@ -57,5 +57,9 @@
|
||||
"PHPMailer\\Test\\": "test/"
|
||||
}
|
||||
},
|
||||
"license": "LGPL-2.1-only"
|
||||
"license": "LGPL-2.1-only",
|
||||
"scripts": {
|
||||
"check": "./vendor/bin/phpcs",
|
||||
"test": "./vendor/bin/phpunit"
|
||||
}
|
||||
}
|
||||
|
24
vendor/phpmailer/phpmailer/get_oauth_token.php
vendored
24
vendor/phpmailer/phpmailer/get_oauth_token.php
vendored
@ -38,20 +38,20 @@ namespace PHPMailer\PHPMailer;
|
||||
* Plenty to choose from here:
|
||||
* @see http://oauth2-client.thephpleague.com/providers/thirdparty/
|
||||
*/
|
||||
// @see https://github.com/thephpleague/oauth2-google
|
||||
//@see https://github.com/thephpleague/oauth2-google
|
||||
use League\OAuth2\Client\Provider\Google;
|
||||
// @see https://packagist.org/packages/hayageek/oauth2-yahoo
|
||||
//@see https://packagist.org/packages/hayageek/oauth2-yahoo
|
||||
use Hayageek\OAuth2\Client\Provider\Yahoo;
|
||||
// @see https://github.com/stevenmaguire/oauth2-microsoft
|
||||
//@see https://github.com/stevenmaguire/oauth2-microsoft
|
||||
use Stevenmaguire\OAuth2\Client\Provider\Microsoft;
|
||||
|
||||
if (!isset($_GET['code']) && !isset($_GET['provider'])) {
|
||||
?>
|
||||
<html>
|
||||
<body>Select Provider:<br/>
|
||||
<a href='?provider=Google'>Google</a><br/>
|
||||
<a href='?provider=Yahoo'>Yahoo</a><br/>
|
||||
<a href='?provider=Microsoft'>Microsoft/Outlook/Hotmail/Live/Office365</a><br/>
|
||||
<body>Select Provider:<br>
|
||||
<a href='?provider=Google'>Google</a><br>
|
||||
<a href='?provider=Yahoo'>Yahoo</a><br>
|
||||
<a href='?provider=Microsoft'>Microsoft/Outlook/Hotmail/Live/Office365</a><br>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
@ -121,26 +121,26 @@ if (null === $provider) {
|
||||
}
|
||||
|
||||
if (!isset($_GET['code'])) {
|
||||
// If we don't have an authorization code then get one
|
||||
//If we don't have an authorization code then get one
|
||||
$authUrl = $provider->getAuthorizationUrl($options);
|
||||
$_SESSION['oauth2state'] = $provider->getState();
|
||||
header('Location: ' . $authUrl);
|
||||
exit;
|
||||
// Check given state against previously stored one to mitigate CSRF attack
|
||||
//Check given state against previously stored one to mitigate CSRF attack
|
||||
} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) {
|
||||
unset($_SESSION['oauth2state']);
|
||||
unset($_SESSION['provider']);
|
||||
exit('Invalid state');
|
||||
} else {
|
||||
unset($_SESSION['provider']);
|
||||
// Try to get an access token (using the authorization code grant)
|
||||
//Try to get an access token (using the authorization code grant)
|
||||
$token = $provider->getAccessToken(
|
||||
'authorization_code',
|
||||
[
|
||||
'code' => $_GET['code']
|
||||
]
|
||||
);
|
||||
// Use this to interact with an API on the users behalf
|
||||
// Use this to get a new access token if the old one expires
|
||||
//Use this to interact with an API on the users behalf
|
||||
//Use this to get a new access token if the old one expires
|
||||
echo 'Refresh Token: ', $token->getRefreshToken();
|
||||
}
|
||||
|
@ -16,6 +16,8 @@ $PHPMAILER_LANG['file_open'] = 'Chyba souboru: Nelze otevřít soubor
|
||||
$PHPMAILER_LANG['from_failed'] = 'Následující adresa odesílatele je nesprávná: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Nelze vytvořit instanci emailové funkce.';
|
||||
$PHPMAILER_LANG['invalid_address'] = 'Neplatná adresa: ';
|
||||
$PHPMAILER_LANG['invalid_hostentry'] = 'Záznam hostitele je nesprávný: ';
|
||||
$PHPMAILER_LANG['invalid_host'] = 'Hostitel je nesprávný: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer není podporován.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Musíte zadat alespoň jednu emailovou adresu příjemce.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'Chyba SMTP: Následující adresy příjemců nejsou správně: ';
|
||||
|
@ -18,6 +18,8 @@ $PHPMAILER_LANG['file_open'] = 'File Error: Súbor sa otvoriť pre č
|
||||
$PHPMAILER_LANG['from_failed'] = 'Následujúca adresa From je nesprávna: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Nedá sa vytvoriť inštancia emailovej funkcie.';
|
||||
$PHPMAILER_LANG['invalid_address'] = 'Neodoslané, emailová adresa je nesprávna: ';
|
||||
$PHPMAILER_LANG['invalid_hostentry'] = 'Záznam hostiteľa je nesprávny: ';
|
||||
$PHPMAILER_LANG['invalid_host'] = 'Hostiteľ je nesprávny: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' emailový klient nieje podporovaný.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Musíte zadať aspoň jednu emailovú adresu príjemcu.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy príjemcov niesu správne ';
|
||||
|
28
vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php
vendored
Normal file
28
vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Serbian PHPMailer language file: refer to English translation for definitive list
|
||||
* @package PHPMailer
|
||||
* @author Александар Јевремовић <ajevremovic@gmail.com>
|
||||
* @author Miloš Milanović <mmilanovic016@gmail.com>
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP greška: autentifikacija nije uspela.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP greška: povezivanje sa SMTP serverom nije uspelo.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP greška: podaci nisu prihvaćeni.';
|
||||
$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.';
|
||||
$PHPMAILER_LANG['encoding'] = 'Nepoznato kodiranje: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'SMTP greška: slanje sa sledećih adresa nije uspelo: ';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP greška: slanje na sledeće adrese nije uspelo: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Nije moguće pokrenuti mail funkciju.';
|
||||
$PHPMAILER_LANG['invalid_address'] = 'Poruka nije poslata. Neispravna adresa: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' majler nije podržan.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Definišite bar jednu adresu primaoca.';
|
||||
$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: ';
|
||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'Povezivanje sa SMTP serverom nije uspelo.';
|
||||
$PHPMAILER_LANG['smtp_error'] = 'Greška SMTP servera: ';
|
||||
$PHPMAILER_LANG['variable_set'] = 'Nije moguće zadati niti resetovati promenljivu: ';
|
||||
$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proširenje: ';
|
@ -16,11 +16,11 @@ $PHPMAILER_LANG['file_access'] = 'Немає доступу до фай
|
||||
$PHPMAILER_LANG['file_open'] = 'Помилка файлової системи: не вдається відкрити файл: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Невірна адреса відправника: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Неможливо запустити функцію mail().';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Будь-ласка, введіть хоча б одну email-адресу отримувача.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Будь ласка, введіть хоча б одну email-адресу отримувача.';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' - поштовий сервер не підтримується.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'Помилка SMTP: не вдалося відправлення для таких отримувачів: ';
|
||||
$PHPMAILER_LANG['empty_message'] = 'Пусте повідомлення';
|
||||
$PHPMAILER_LANG['invalid_address'] = 'Не відправлено через невірний формат email-адреси: ';
|
||||
$PHPMAILER_LANG['invalid_address'] = 'Не відправлено через неправильний формат email-адреси: ';
|
||||
$PHPMAILER_LANG['signing'] = 'Помилка підпису: ';
|
||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'Помилка з\'єднання з SMTP-сервером';
|
||||
$PHPMAILER_LANG['smtp_error'] = 'Помилка SMTP-сервера: ';
|
||||
|
35
vendor/phpmailer/phpmailer/phpunit.xml.dist
vendored
Normal file
35
vendor/phpmailer/phpmailer/phpunit.xml.dist
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
|
||||
backupGlobals="true"
|
||||
bootstrap="vendor/autoload.php"
|
||||
verbose="true"
|
||||
colors="true"
|
||||
forceCoversAnnotation="false"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="PHPMailerTests">
|
||||
<directory>./test/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<listeners>
|
||||
<listener class="PHPMailer\Test\DebugLogTestListener" />
|
||||
</listeners>
|
||||
<groups>
|
||||
<exclude>
|
||||
<group>languages</group>
|
||||
<group>pop3</group>
|
||||
</exclude>
|
||||
</groups>
|
||||
<filter>
|
||||
<whitelist addUncoveredFilesFromWhitelist="true">
|
||||
<directory suffix=".php">./src</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
<logging>
|
||||
<log type="coverage-text" target="php://stdout" showUncoveredFiles="true"/>
|
||||
<log type="coverage-clover" target="build/logs/clover.xml"/>
|
||||
<log type="junit" target="build/logs/junit.xml"/>
|
||||
</logging>
|
||||
</phpunit>
|
2
vendor/phpmailer/phpmailer/src/OAuth.php
vendored
2
vendor/phpmailer/phpmailer/src/OAuth.php
vendored
@ -123,7 +123,7 @@ class OAuth
|
||||
*/
|
||||
public function getOauth64()
|
||||
{
|
||||
// Get a new token if it's not available or has expired
|
||||
//Get a new token if it's not available or has expired
|
||||
if (null === $this->oauthToken || $this->oauthToken->hasExpired()) {
|
||||
$this->oauthToken = $this->getToken();
|
||||
}
|
||||
|
409
vendor/phpmailer/phpmailer/src/PHPMailer.php
vendored
409
vendor/phpmailer/phpmailer/src/PHPMailer.php
vendored
File diff suppressed because it is too large
Load Diff
44
vendor/phpmailer/phpmailer/src/POP3.php
vendored
44
vendor/phpmailer/phpmailer/src/POP3.php
vendored
@ -46,7 +46,7 @@ class POP3
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '6.2.0';
|
||||
const VERSION = '6.4.1';
|
||||
|
||||
/**
|
||||
* Default POP3 port number.
|
||||
@ -199,13 +199,13 @@ class POP3
|
||||
public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0)
|
||||
{
|
||||
$this->host = $host;
|
||||
// If no port value provided, use default
|
||||
//If no port value provided, use default
|
||||
if (false === $port) {
|
||||
$this->port = static::DEFAULT_PORT;
|
||||
} else {
|
||||
$this->port = (int) $port;
|
||||
}
|
||||
// If no timeout value provided, use default
|
||||
//If no timeout value provided, use default
|
||||
if (false === $timeout) {
|
||||
$this->tval = static::DEFAULT_TIMEOUT;
|
||||
} else {
|
||||
@ -214,9 +214,9 @@ class POP3
|
||||
$this->do_debug = $debug_level;
|
||||
$this->username = $username;
|
||||
$this->password = $password;
|
||||
// Reset the error log
|
||||
//Reset the error log
|
||||
$this->errors = [];
|
||||
// connect
|
||||
//Connect
|
||||
$result = $this->connect($this->host, $this->port, $this->tval);
|
||||
if ($result) {
|
||||
$login_result = $this->login($this->username, $this->password);
|
||||
@ -226,7 +226,7 @@ class POP3
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// We need to disconnect regardless of whether the login succeeded
|
||||
//We need to disconnect regardless of whether the login succeeded
|
||||
$this->disconnect();
|
||||
|
||||
return false;
|
||||
@ -243,7 +243,7 @@ class POP3
|
||||
*/
|
||||
public function connect($host, $port = false, $tval = 30)
|
||||
{
|
||||
// Are we already connected?
|
||||
//Are we already connected?
|
||||
if ($this->connected) {
|
||||
return true;
|
||||
}
|
||||
@ -256,22 +256,22 @@ class POP3
|
||||
$port = static::DEFAULT_PORT;
|
||||
}
|
||||
|
||||
// connect to the POP3 server
|
||||
//Connect to the POP3 server
|
||||
$errno = 0;
|
||||
$errstr = '';
|
||||
$this->pop_conn = fsockopen(
|
||||
$host, // POP3 Host
|
||||
$port, // Port #
|
||||
$errno, // Error Number
|
||||
$errstr, // Error Message
|
||||
$host, //POP3 Host
|
||||
$port, //Port #
|
||||
$errno, //Error Number
|
||||
$errstr, //Error Message
|
||||
$tval
|
||||
); // Timeout (seconds)
|
||||
// Restore the error handler
|
||||
); //Timeout (seconds)
|
||||
//Restore the error handler
|
||||
restore_error_handler();
|
||||
|
||||
// Did we connect?
|
||||
//Did we connect?
|
||||
if (false === $this->pop_conn) {
|
||||
// It would appear not...
|
||||
//It would appear not...
|
||||
$this->setError(
|
||||
"Failed to connect to server $host on port $port. errno: $errno; errstr: $errstr"
|
||||
);
|
||||
@ -279,14 +279,14 @@ class POP3
|
||||
return false;
|
||||
}
|
||||
|
||||
// Increase the stream time-out
|
||||
//Increase the stream time-out
|
||||
stream_set_timeout($this->pop_conn, $tval, 0);
|
||||
|
||||
// Get the POP3 server response
|
||||
//Get the POP3 server response
|
||||
$pop3_response = $this->getResponse();
|
||||
// Check for the +OK
|
||||
//Check for the +OK
|
||||
if ($this->checkResponse($pop3_response)) {
|
||||
// The connection is established and the POP3 server is talking
|
||||
//The connection is established and the POP3 server is talking
|
||||
$this->connected = true;
|
||||
|
||||
return true;
|
||||
@ -316,11 +316,11 @@ class POP3
|
||||
$password = $this->password;
|
||||
}
|
||||
|
||||
// Send the Username
|
||||
//Send the Username
|
||||
$this->sendString("USER $username" . static::LE);
|
||||
$pop3_response = $this->getResponse();
|
||||
if ($this->checkResponse($pop3_response)) {
|
||||
// Send the Password
|
||||
//Send the Password
|
||||
$this->sendString("PASS $password" . static::LE);
|
||||
$pop3_response = $this->getResponse();
|
||||
if ($this->checkResponse($pop3_response)) {
|
||||
|
116
vendor/phpmailer/phpmailer/src/SMTP.php
vendored
116
vendor/phpmailer/phpmailer/src/SMTP.php
vendored
@ -35,7 +35,7 @@ class SMTP
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '6.2.0';
|
||||
const VERSION = '6.4.1';
|
||||
|
||||
/**
|
||||
* SMTP line break constant.
|
||||
@ -312,11 +312,11 @@ class SMTP
|
||||
*/
|
||||
public function connect($host, $port = null, $timeout = 30, $options = [])
|
||||
{
|
||||
// Clear errors to avoid confusion
|
||||
//Clear errors to avoid confusion
|
||||
$this->setError('');
|
||||
// Make sure we are __not__ connected
|
||||
//Make sure we are __not__ connected
|
||||
if ($this->connected()) {
|
||||
// Already connected, generate error
|
||||
//Already connected, generate error
|
||||
$this->setError('Already connected to a server');
|
||||
|
||||
return false;
|
||||
@ -324,7 +324,7 @@ class SMTP
|
||||
if (empty($port)) {
|
||||
$port = self::DEFAULT_PORT;
|
||||
}
|
||||
// Connect to the SMTP server
|
||||
//Connect to the SMTP server
|
||||
$this->edebug(
|
||||
"Connection: opening to $host:$port, timeout=$timeout, options=" .
|
||||
(count($options) > 0 ? var_export($options, true) : 'array()'),
|
||||
@ -340,11 +340,23 @@ class SMTP
|
||||
|
||||
$this->edebug('Connection: opened', self::DEBUG_CONNECTION);
|
||||
|
||||
// Get any announcement
|
||||
//Get any announcement
|
||||
$this->last_reply = $this->get_lines();
|
||||
$this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER);
|
||||
|
||||
return true;
|
||||
$responseCode = (int)substr($this->last_reply, 0, 3);
|
||||
if ($responseCode === 220) {
|
||||
return true;
|
||||
}
|
||||
//Anything other than a 220 response means something went wrong
|
||||
//RFC 5321 says the server will wait for us to send a QUIT in response to a 554 error
|
||||
//https://tools.ietf.org/html/rfc5321#section-3.1
|
||||
if ($responseCode === 554) {
|
||||
$this->quit();
|
||||
}
|
||||
//This will handle 421 responses which may not wait for a QUIT (e.g. if the server is being shut down)
|
||||
$this->edebug('Connection: closing due to error', self::DEBUG_CONNECTION);
|
||||
$this->close();
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -397,7 +409,7 @@ class SMTP
|
||||
restore_error_handler();
|
||||
}
|
||||
|
||||
// Verify we connected properly
|
||||
//Verify we connected properly
|
||||
if (!is_resource($connection)) {
|
||||
$this->setError(
|
||||
'Failed to connect to server',
|
||||
@ -414,11 +426,11 @@ class SMTP
|
||||
return false;
|
||||
}
|
||||
|
||||
// SMTP server can take longer to respond, give longer timeout for first read
|
||||
// Windows does not have support for this timeout function
|
||||
//SMTP server can take longer to respond, give longer timeout for first read
|
||||
//Windows does not have support for this timeout function
|
||||
if (strpos(PHP_OS, 'WIN') !== 0) {
|
||||
$max = (int)ini_get('max_execution_time');
|
||||
// Don't bother if unlimited, or if set_time_limit is disabled
|
||||
//Don't bother if unlimited, or if set_time_limit is disabled
|
||||
if (0 !== $max && $timeout > $max && strpos(ini_get('disable_functions'), 'set_time_limit') === false) {
|
||||
@set_time_limit($timeout);
|
||||
}
|
||||
@ -449,7 +461,7 @@ class SMTP
|
||||
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
|
||||
}
|
||||
|
||||
// Begin encrypted connection
|
||||
//Begin encrypted connection
|
||||
set_error_handler([$this, 'errorHandler']);
|
||||
$crypto_ok = stream_socket_enable_crypto(
|
||||
$this->smtp_conn,
|
||||
@ -487,11 +499,11 @@ class SMTP
|
||||
}
|
||||
|
||||
if (array_key_exists('EHLO', $this->server_caps)) {
|
||||
// SMTP extensions are available; try to find a proper authentication method
|
||||
//SMTP extensions are available; try to find a proper authentication method
|
||||
if (!array_key_exists('AUTH', $this->server_caps)) {
|
||||
$this->setError('Authentication is not allowed at this stage');
|
||||
// 'at this stage' means that auth may be allowed after the stage changes
|
||||
// e.g. after STARTTLS
|
||||
//'at this stage' means that auth may be allowed after the stage changes
|
||||
//e.g. after STARTTLS
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -535,12 +547,14 @@ class SMTP
|
||||
}
|
||||
switch ($authtype) {
|
||||
case 'PLAIN':
|
||||
// Start authentication
|
||||
//Start authentication
|
||||
if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) {
|
||||
return false;
|
||||
}
|
||||
// Send encoded username and password
|
||||
//Send encoded username and password
|
||||
if (
|
||||
//Format from https://tools.ietf.org/html/rfc4616#section-2
|
||||
//We skip the first field (it's forgery), so the string starts with a null byte
|
||||
!$this->sendCommand(
|
||||
'User & Password',
|
||||
base64_encode("\0" . $username . "\0" . $password),
|
||||
@ -551,7 +565,7 @@ class SMTP
|
||||
}
|
||||
break;
|
||||
case 'LOGIN':
|
||||
// Start authentication
|
||||
//Start authentication
|
||||
if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) {
|
||||
return false;
|
||||
}
|
||||
@ -563,17 +577,17 @@ class SMTP
|
||||
}
|
||||
break;
|
||||
case 'CRAM-MD5':
|
||||
// Start authentication
|
||||
//Start authentication
|
||||
if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) {
|
||||
return false;
|
||||
}
|
||||
// Get the challenge
|
||||
//Get the challenge
|
||||
$challenge = base64_decode(substr($this->last_reply, 4));
|
||||
|
||||
// Build the response
|
||||
//Build the response
|
||||
$response = $username . ' ' . $this->hmac($challenge, $password);
|
||||
|
||||
// send encoded credentials
|
||||
//send encoded credentials
|
||||
return $this->sendCommand('Username', base64_encode($response), 235);
|
||||
case 'XOAUTH2':
|
||||
//The OAuth instance must be set up prior to requesting auth.
|
||||
@ -582,7 +596,7 @@ class SMTP
|
||||
}
|
||||
$oauth = $OAuth->getOauth64();
|
||||
|
||||
// Start authentication
|
||||
//Start authentication
|
||||
if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) {
|
||||
return false;
|
||||
}
|
||||
@ -612,15 +626,15 @@ class SMTP
|
||||
return hash_hmac('md5', $data, $key);
|
||||
}
|
||||
|
||||
// The following borrowed from
|
||||
// http://php.net/manual/en/function.mhash.php#27225
|
||||
//The following borrowed from
|
||||
//http://php.net/manual/en/function.mhash.php#27225
|
||||
|
||||
// RFC 2104 HMAC implementation for php.
|
||||
// Creates an md5 HMAC.
|
||||
// Eliminates the need to install mhash to compute a HMAC
|
||||
// by Lance Rushing
|
||||
//RFC 2104 HMAC implementation for php.
|
||||
//Creates an md5 HMAC.
|
||||
//Eliminates the need to install mhash to compute a HMAC
|
||||
//by Lance Rushing
|
||||
|
||||
$bytelen = 64; // byte length for md5
|
||||
$bytelen = 64; //byte length for md5
|
||||
if (strlen($key) > $bytelen) {
|
||||
$key = pack('H*', md5($key));
|
||||
}
|
||||
@ -643,7 +657,7 @@ class SMTP
|
||||
if (is_resource($this->smtp_conn)) {
|
||||
$sock_status = stream_get_meta_data($this->smtp_conn);
|
||||
if ($sock_status['eof']) {
|
||||
// The socket is valid but we are not connected
|
||||
//The socket is valid but we are not connected
|
||||
$this->edebug(
|
||||
'SMTP NOTICE: EOF caught while checking if connected',
|
||||
self::DEBUG_CLIENT
|
||||
@ -653,7 +667,7 @@ class SMTP
|
||||
return false;
|
||||
}
|
||||
|
||||
return true; // everything looks good
|
||||
return true; //everything looks good
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -671,7 +685,7 @@ class SMTP
|
||||
$this->server_caps = null;
|
||||
$this->helo_rply = null;
|
||||
if (is_resource($this->smtp_conn)) {
|
||||
// close the connection and cleanup
|
||||
//Close the connection and cleanup
|
||||
fclose($this->smtp_conn);
|
||||
$this->smtp_conn = null; //Makes for cleaner serialization
|
||||
$this->edebug('Connection: closed', self::DEBUG_CONNECTION);
|
||||
@ -706,7 +720,7 @@ class SMTP
|
||||
* NOTE: this does not count towards line-length limit.
|
||||
*/
|
||||
|
||||
// Normalize line breaks before exploding
|
||||
//Normalize line breaks before exploding
|
||||
$lines = explode("\n", str_replace(["\r\n", "\r"], "\n", $msg_data));
|
||||
|
||||
/* To distinguish between a complete RFC822 message and a plain message body, we check if the first field
|
||||
@ -752,7 +766,8 @@ class SMTP
|
||||
|
||||
//Send the lines to the server
|
||||
foreach ($lines_out as $line_out) {
|
||||
//RFC2821 section 4.5.2
|
||||
//Dot-stuffing as per RFC5321 section 4.5.2
|
||||
//https://tools.ietf.org/html/rfc5321#section-4.5.2
|
||||
if (!empty($line_out) && $line_out[0] === '.') {
|
||||
$line_out = '.' . $line_out;
|
||||
}
|
||||
@ -786,7 +801,16 @@ class SMTP
|
||||
public function hello($host = '')
|
||||
{
|
||||
//Try extended hello first (RFC 2821)
|
||||
return $this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host);
|
||||
if ($this->sendHello('EHLO', $host)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
//Some servers shut down the SMTP service here (RFC 5321)
|
||||
if (substr($this->helo_rply, 0, 3) == '421') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->sendHello('HELO', $host);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -976,12 +1000,12 @@ class SMTP
|
||||
$this->client_send($commandstring . static::LE, $command);
|
||||
|
||||
$this->last_reply = $this->get_lines();
|
||||
// Fetch SMTP code and possible error code explanation
|
||||
//Fetch SMTP code and possible error code explanation
|
||||
$matches = [];
|
||||
if (preg_match('/^([\d]{3})[ -](?:([\d]\\.[\d]\\.[\d]{1,2}) )?/', $this->last_reply, $matches)) {
|
||||
$code = (int) $matches[1];
|
||||
$code_ex = (count($matches) > 2 ? $matches[2] : null);
|
||||
// Cut off error code from each response line
|
||||
//Cut off error code from each response line
|
||||
$detail = preg_replace(
|
||||
"/{$code}[ -]" .
|
||||
($code_ex ? str_replace('.', '\\.', $code_ex) . ' ' : '') . '/m',
|
||||
@ -989,7 +1013,7 @@ class SMTP
|
||||
$this->last_reply
|
||||
);
|
||||
} else {
|
||||
// Fall back to simple parsing if regex fails
|
||||
//Fall back to simple parsing if regex fails
|
||||
$code = (int) substr($this->last_reply, 0, 3);
|
||||
$code_ex = null;
|
||||
$detail = substr($this->last_reply, 4);
|
||||
@ -1184,7 +1208,7 @@ class SMTP
|
||||
*/
|
||||
protected function get_lines()
|
||||
{
|
||||
// If the connection is bad, give up straight away
|
||||
//If the connection is bad, give up straight away
|
||||
if (!is_resource($this->smtp_conn)) {
|
||||
return '';
|
||||
}
|
||||
@ -1237,13 +1261,13 @@ class SMTP
|
||||
$str = @fgets($this->smtp_conn, self::MAX_REPLY_LENGTH);
|
||||
$this->edebug('SMTP INBOUND: "' . trim($str) . '"', self::DEBUG_LOWLEVEL);
|
||||
$data .= $str;
|
||||
// If response is only 3 chars (not valid, but RFC5321 S4.2 says it must be handled),
|
||||
// or 4th character is a space or a line break char, we are done reading, break the loop.
|
||||
// String array access is a significant micro-optimisation over strlen
|
||||
//If response is only 3 chars (not valid, but RFC5321 S4.2 says it must be handled),
|
||||
//or 4th character is a space or a line break char, we are done reading, break the loop.
|
||||
//String array access is a significant micro-optimisation over strlen
|
||||
if (!isset($str[3]) || $str[3] === ' ' || $str[3] === "\r" || $str[3] === "\n") {
|
||||
break;
|
||||
}
|
||||
// Timed-out? Log and break
|
||||
//Timed-out? Log and break
|
||||
$info = stream_get_meta_data($this->smtp_conn);
|
||||
if ($info['timed_out']) {
|
||||
$this->edebug(
|
||||
@ -1252,7 +1276,7 @@ class SMTP
|
||||
);
|
||||
break;
|
||||
}
|
||||
// Now check if reads took too long
|
||||
//Now check if reads took too long
|
||||
if ($endtime && time() > $endtime) {
|
||||
$this->edebug(
|
||||
'SMTP -> get_lines(): timelimit reached (' .
|
||||
|
14
vendor/psr/container/README.md
vendored
14
vendor/psr/container/README.md
vendored
@ -1,5 +1,13 @@
|
||||
# PSR Container
|
||||
Container interface
|
||||
==============
|
||||
|
||||
This repository holds all interfaces/classes/traits related to [PSR-11](https://github.com/container-interop/fig-standards/blob/master/proposed/container.md).
|
||||
This repository holds all interfaces related to [PSR-11 (Container Interface)][psr-url].
|
||||
|
||||
Note that this is not a Container implementation of its own. It is merely abstractions that describe the components of a Dependency Injection Container.
|
||||
|
||||
The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist.
|
||||
|
||||
[psr-url]: https://www.php-fig.org/psr/psr-11/
|
||||
[package-url]: https://packagist.org/packages/psr/container
|
||||
[implementation-url]: https://packagist.org/providers/psr/container-implementation
|
||||
|
||||
Note that this is not a container implementation of its own. See the specification for more details.
|
||||
|
9
vendor/psr/container/composer.json
vendored
9
vendor/psr/container/composer.json
vendored
@ -8,20 +8,15 @@
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
"homepage": "https://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
"php": ">=7.2.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Container\\": "src/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
||||
*/
|
||||
|
||||
namespace Psr\Container;
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Psr\Container;
|
||||
|
||||
@ -20,7 +19,7 @@ interface ContainerInterface
|
||||
*
|
||||
* @return mixed Entry.
|
||||
*/
|
||||
public function get($id);
|
||||
public function get(string $id);
|
||||
|
||||
/**
|
||||
* Returns true if the container can return an entry for the given identifier.
|
||||
@ -33,5 +32,5 @@ interface ContainerInterface
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function has($id);
|
||||
public function has(string $id);
|
||||
}
|
||||
|
@ -1,7 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
|
||||
*/
|
||||
|
||||
namespace Psr\Container;
|
||||
|
||||
|
32
vendor/psr/log/Psr/Log/AbstractLogger.php
vendored
32
vendor/psr/log/Psr/Log/AbstractLogger.php
vendored
@ -14,8 +14,8 @@ abstract class AbstractLogger implements LoggerInterface
|
||||
/**
|
||||
* System is unusable.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @param string $message
|
||||
* @param mixed[] $context
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@ -30,8 +30,8 @@ abstract class AbstractLogger implements LoggerInterface
|
||||
* Example: Entire website down, database unavailable, etc. This should
|
||||
* trigger the SMS alerts and wake you up.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @param string $message
|
||||
* @param mixed[] $context
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@ -45,8 +45,8 @@ abstract class AbstractLogger implements LoggerInterface
|
||||
*
|
||||
* Example: Application component unavailable, unexpected exception.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @param string $message
|
||||
* @param mixed[] $context
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@ -59,8 +59,8 @@ abstract class AbstractLogger implements LoggerInterface
|
||||
* Runtime errors that do not require immediate action but should typically
|
||||
* be logged and monitored.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @param string $message
|
||||
* @param mixed[] $context
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@ -75,8 +75,8 @@ abstract class AbstractLogger implements LoggerInterface
|
||||
* Example: Use of deprecated APIs, poor use of an API, undesirable things
|
||||
* that are not necessarily wrong.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @param string $message
|
||||
* @param mixed[] $context
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@ -88,8 +88,8 @@ abstract class AbstractLogger implements LoggerInterface
|
||||
/**
|
||||
* Normal but significant events.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @param string $message
|
||||
* @param mixed[] $context
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@ -103,8 +103,8 @@ abstract class AbstractLogger implements LoggerInterface
|
||||
*
|
||||
* Example: User logs in, SQL logs.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @param string $message
|
||||
* @param mixed[] $context
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@ -116,8 +116,8 @@ abstract class AbstractLogger implements LoggerInterface
|
||||
/**
|
||||
* Detailed debug information.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @param string $message
|
||||
* @param mixed[] $context
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
2
vendor/psr/log/Psr/Log/LoggerAwareTrait.php
vendored
2
vendor/psr/log/Psr/Log/LoggerAwareTrait.php
vendored
@ -10,7 +10,7 @@ trait LoggerAwareTrait
|
||||
/**
|
||||
* The logger instance.
|
||||
*
|
||||
* @var LoggerInterface
|
||||
* @var LoggerInterface|null
|
||||
*/
|
||||
protected $logger;
|
||||
|
||||
|
2
vendor/psr/log/composer.json
vendored
2
vendor/psr/log/composer.json
vendored
@ -7,7 +7,7 @@
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
"homepage": "https://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
|
2
vendor/services.php
vendored
2
vendor/services.php
vendored
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// This file is automatically generated at:2021-02-01 16:10:22
|
||||
// This file is automatically generated at:2021-05-10 13:56:23
|
||||
declare (strict_types = 1);
|
||||
return array (
|
||||
0 => 'think\\captcha\\CaptchaService',
|
||||
|
72
vendor/symfony/polyfill-mbstring/bootstrap80.php
vendored
72
vendor/symfony/polyfill-mbstring/bootstrap80.php
vendored
@ -12,120 +12,120 @@
|
||||
use Symfony\Polyfill\Mbstring as p;
|
||||
|
||||
if (!function_exists('mb_convert_encoding')) {
|
||||
function mb_convert_encoding(array|string $string, string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); }
|
||||
function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); }
|
||||
}
|
||||
if (!function_exists('mb_decode_mimeheader')) {
|
||||
function mb_decode_mimeheader(string $string): string { return p\Mbstring::mb_decode_mimeheader($string); }
|
||||
function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); }
|
||||
}
|
||||
if (!function_exists('mb_encode_mimeheader')) {
|
||||
function mb_encode_mimeheader(string $string, string $charset = null, string $transfer_encoding = null, string $newline = "\r\n", int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); }
|
||||
function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); }
|
||||
}
|
||||
if (!function_exists('mb_decode_numericentity')) {
|
||||
function mb_decode_numericentity(string $string, array $map, string $encoding = null): string { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); }
|
||||
function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_encode_numericentity')) {
|
||||
function mb_encode_numericentity(string $string, array $map, string $encoding = null, bool $hex = false): string { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); }
|
||||
function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); }
|
||||
}
|
||||
if (!function_exists('mb_convert_case')) {
|
||||
function mb_convert_case(string $string, int $mode, string $encoding = null): string { return p\Mbstring::mb_convert_case($string, $mode, $encoding); }
|
||||
function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_internal_encoding')) {
|
||||
function mb_internal_encoding(string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); }
|
||||
function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); }
|
||||
}
|
||||
if (!function_exists('mb_language')) {
|
||||
function mb_language(string $language = null): string|bool { return p\Mbstring::mb_language($language); }
|
||||
function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); }
|
||||
}
|
||||
if (!function_exists('mb_list_encodings')) {
|
||||
function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); }
|
||||
}
|
||||
if (!function_exists('mb_encoding_aliases')) {
|
||||
function mb_encoding_aliases(string $encoding): array { return p\Mbstring::mb_encoding_aliases($encoding); }
|
||||
function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_check_encoding')) {
|
||||
function mb_check_encoding(array|string|null $value = null, string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); }
|
||||
function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_detect_encoding')) {
|
||||
function mb_detect_encoding(string $string, array|string|null $encodings = null, bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); }
|
||||
function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); }
|
||||
}
|
||||
if (!function_exists('mb_detect_order')) {
|
||||
function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); }
|
||||
function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order((string) $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_parse_str')) {
|
||||
function mb_parse_str(string $string, &$result = array()): bool { parse_str($string, $result); }
|
||||
function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); }
|
||||
}
|
||||
if (!function_exists('mb_strlen')) {
|
||||
function mb_strlen(string $string, string $encoding = null): int { return p\Mbstring::mb_strlen($string, $encoding); }
|
||||
function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strpos')) {
|
||||
function mb_strpos(string $haystack, string $needle, int $offset = 0, string $encoding = null): int|false { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); }
|
||||
function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strtolower')) {
|
||||
function mb_strtolower(string $string, string $encoding = null): string { return p\Mbstring::mb_strtolower($string, $encoding); }
|
||||
function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strtoupper')) {
|
||||
function mb_strtoupper(string $string, string $encoding = null): string { return p\Mbstring::mb_strtoupper($string, $encoding); }
|
||||
function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_substitute_character')) {
|
||||
function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); }
|
||||
}
|
||||
if (!function_exists('mb_substr')) {
|
||||
function mb_substr(string $string, int $start, int $length = null, string $encoding = null): string { return p\Mbstring::mb_substr($string, $start, $length, $encoding); }
|
||||
function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_stripos')) {
|
||||
function mb_stripos(string $haystack, string $needle, int $offset = 0, string $encoding = null): int|false { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); }
|
||||
function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_stristr')) {
|
||||
function mb_stristr(string $haystack, string $needle, bool $before_needle = false, string $encoding = null): string|false { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); }
|
||||
function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strrchr')) {
|
||||
function mb_strrchr(string $haystack, string $needle, bool $before_needle = false, string $encoding = null): string|false { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); }
|
||||
function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, $before_needle, (bool) $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strrichr')) {
|
||||
function mb_strrichr(string $haystack, string $needle, bool $before_needle = false, string $encoding = null): string|false { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); }
|
||||
function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strripos')) {
|
||||
function mb_strripos(string $haystack, string $needle, int $offset = 0, string $encoding = null): int|false { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); }
|
||||
function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strrpos')) {
|
||||
function mb_strrpos(string $haystack, string $needle, int $offset = 0, string $encoding = null): int|false { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); }
|
||||
function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strstr')) {
|
||||
function mb_strstr(string $haystack, string $needle, bool $before_needle = false, string $encoding = null): string|false { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); }
|
||||
function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_get_info')) {
|
||||
function mb_get_info(string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info($type); }
|
||||
function mb_get_info(?string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info((string) $type); }
|
||||
}
|
||||
if (!function_exists('mb_http_output')) {
|
||||
function mb_http_output(string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); }
|
||||
function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strwidth')) {
|
||||
function mb_strwidth(string $string, string $encoding = null): int { return p\Mbstring::mb_strwidth($string, $encoding); }
|
||||
function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_substr_count')) {
|
||||
function mb_substr_count(string $haystack, string $needle, string $encoding = null): int { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); }
|
||||
function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_output_handler')) {
|
||||
function mb_output_handler(string $string, int $status): string { return p\Mbstring::mb_output_handler($string, $status); }
|
||||
function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); }
|
||||
}
|
||||
if (!function_exists('mb_http_input')) {
|
||||
function mb_http_input(string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); }
|
||||
function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_convert_variables')) {
|
||||
function mb_convert_variables(string $to_encoding, array|string $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, $var, ...$vars); }
|
||||
function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_ord')) {
|
||||
function mb_ord(string $string, string $encoding = null): int|false { return p\Mbstring::mb_ord($string, $encoding); }
|
||||
function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_chr')) {
|
||||
function mb_chr(int $codepoint, string $encoding = null): string|false { return p\Mbstring::mb_chr($codepoint, $encoding); }
|
||||
function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_scrub')) {
|
||||
function mb_scrub(string $string, string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding($string, $encoding, $encoding); }
|
||||
function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_str_split')) {
|
||||
function mb_str_split(string $string, int $length = 1, string $encoding = null): array { return p\Mbstring::mb_str_split($string, $length, $encoding); }
|
||||
function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); }
|
||||
}
|
||||
|
||||
if (extension_loaded('mbstring')) {
|
||||
|
@ -92,7 +92,7 @@ class DateCaster
|
||||
if (\PHP_VERSION_ID >= 70107) { // see https://bugs.php.net/74639
|
||||
foreach (clone $p as $i => $d) {
|
||||
if (self::PERIOD_LIMIT === $i) {
|
||||
$now = new \DateTimeImmutable();
|
||||
$now = new \DateTimeImmutable('now', new \DateTimeZone('UTC'));
|
||||
$dates[] = sprintf('%s more', ($end = $p->getEndDate())
|
||||
? ceil(($end->format('U.u') - $d->format('U.u')) / ((int) $now->add($p->getDateInterval())->format('U.u') - (int) $now->format('U.u')))
|
||||
: $p->recurrences - $i
|
||||
|
@ -96,11 +96,20 @@ class ReflectionCaster
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
$a += [
|
||||
$prefix.'name' => $c instanceof \ReflectionNamedType ? $c->getName() : (string) $c,
|
||||
$prefix.'allowsNull' => $c->allowsNull(),
|
||||
$prefix.'isBuiltin' => $c->isBuiltin(),
|
||||
];
|
||||
if ($c instanceof \ReflectionNamedType || \PHP_VERSION_ID < 80000) {
|
||||
$a += [
|
||||
$prefix.'name' => $c instanceof \ReflectionNamedType ? $c->getName() : (string) $c,
|
||||
$prefix.'allowsNull' => $c->allowsNull(),
|
||||
$prefix.'isBuiltin' => $c->isBuiltin(),
|
||||
];
|
||||
} elseif ($c instanceof \ReflectionUnionType) {
|
||||
$a[$prefix.'allowsNull'] = $c->allowsNull();
|
||||
self::addMap($a, $c, [
|
||||
'types' => 'getTypes',
|
||||
]);
|
||||
} else {
|
||||
$a[$prefix.'allowsNull'] = $c->allowsNull();
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
@ -377,7 +386,7 @@ class ReflectionCaster
|
||||
}
|
||||
}
|
||||
|
||||
private static function addMap(array &$a, \Reflector $c, array $map, string $prefix = Caster::PREFIX_VIRTUAL)
|
||||
private static function addMap(array &$a, $c, array $map, string $prefix = Caster::PREFIX_VIRTUAL)
|
||||
{
|
||||
foreach ($map as $k => $m) {
|
||||
if (\PHP_VERSION_ID >= 80000 && 'isDisabled' === $k) {
|
||||
|
@ -58,7 +58,7 @@ class ServerDumpCommand extends Command
|
||||
|
||||
$this
|
||||
->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format (%s)', $availableFormats), 'cli')
|
||||
->setDescription('Starts a dump server that collects and displays dumps in a single place')
|
||||
->setDescription('Start a dump server that collects and displays dumps in a single place')
|
||||
->setHelp(<<<'EOF'
|
||||
<info>%command.name%</info> starts a dump server that collects and displays
|
||||
dumps in a single place for debugging you application:
|
||||
@ -95,5 +95,7 @@ EOF
|
||||
$this->server->listen(function (Data $data, array $context, int $clientId) use ($descriptor, $io) {
|
||||
$descriptor->describe($io, $data, $context, $clientId);
|
||||
});
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
43
vendor/topthink/framework/src/think/App.php
vendored
43
vendor/topthink/framework/src/think/App.php
vendored
@ -39,7 +39,7 @@ use think\initializer\RegisterService;
|
||||
*/
|
||||
class App extends Container
|
||||
{
|
||||
const VERSION = '6.0.7';
|
||||
const VERSION = '6.0.8';
|
||||
|
||||
/**
|
||||
* 应用调试模式
|
||||
@ -47,6 +47,12 @@ class App extends Container
|
||||
*/
|
||||
protected $appDebug = false;
|
||||
|
||||
/**
|
||||
* 环境变量标识
|
||||
* @var string
|
||||
*/
|
||||
protected $envName = '';
|
||||
|
||||
/**
|
||||
* 应用开始时间
|
||||
* @var float
|
||||
@ -277,6 +283,18 @@ class App extends Container
|
||||
return $this->namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置环境变量标识
|
||||
* @access public
|
||||
* @param string $name 环境标识
|
||||
* @return $this
|
||||
*/
|
||||
public function setEnvName(string $name)
|
||||
{
|
||||
$this->envName = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取框架版本
|
||||
* @access public
|
||||
@ -395,6 +413,22 @@ class App extends Container
|
||||
return $this->beginMem;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载环境变量定义
|
||||
* @access public
|
||||
* @param string $envName 环境标识
|
||||
* @return void
|
||||
*/
|
||||
public function loadEnv(string $envName = ''): void
|
||||
{
|
||||
// 加载环境变量
|
||||
$envFile = $envName ? $this->rootPath . '.env.' . $envName : $this->rootPath . '.env';
|
||||
|
||||
if (is_file($envFile)) {
|
||||
$this->env->load($envFile);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化应用
|
||||
* @access public
|
||||
@ -407,10 +441,7 @@ class App extends Container
|
||||
$this->beginTime = microtime(true);
|
||||
$this->beginMem = memory_get_usage();
|
||||
|
||||
// 加载环境变量
|
||||
if (is_file($this->rootPath . '.env')) {
|
||||
$this->env->load($this->rootPath . '.env');
|
||||
}
|
||||
$this->loadEnv($this->envName);
|
||||
|
||||
$this->configExt = $this->env->get('config_ext', '.php');
|
||||
|
||||
@ -590,7 +621,7 @@ class App extends Container
|
||||
* 是否运行在命令行下
|
||||
* @return bool
|
||||
*/
|
||||
public function runningInConsole()
|
||||
public function runningInConsole(): bool
|
||||
{
|
||||
return php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg';
|
||||
}
|
||||
|
18
vendor/topthink/framework/src/think/Request.php
vendored
18
vendor/topthink/framework/src/think/Request.php
vendored
@ -869,6 +869,24 @@ class Request implements ArrayAccess
|
||||
return $this->input($this->param, $name, $default, $filter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取包含文件在内的请求参数
|
||||
* @access public
|
||||
* @param string|array $name 变量名
|
||||
* @param string|array $filter 过滤方法
|
||||
* @return mixed
|
||||
*/
|
||||
public function all($name = '', $filter = '')
|
||||
{
|
||||
$data = array_merge($this->param(), $this->file());
|
||||
|
||||
if (is_array($name)) {
|
||||
$data = $this->only($name, $data, $filter);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置路由变量
|
||||
* @access public
|
||||
|
@ -214,7 +214,7 @@ abstract class Response
|
||||
/**
|
||||
* 是否允许请求缓存
|
||||
* @access public
|
||||
* @return $this
|
||||
* @return bool
|
||||
*/
|
||||
public function isAllowCache()
|
||||
{
|
||||
|
@ -1591,7 +1591,7 @@ class Validate
|
||||
* @param string $msg 错误信息
|
||||
* @param mixed $rule 验证规则数据
|
||||
* @param string $title 字段描述名
|
||||
* @return string
|
||||
* @return string|array
|
||||
*/
|
||||
protected function parseErrorMsg(string $msg, $rule, string $title)
|
||||
{
|
||||
|
@ -13,14 +13,37 @@ namespace think\console\input;
|
||||
|
||||
class Argument
|
||||
{
|
||||
|
||||
// 必传参数
|
||||
const REQUIRED = 1;
|
||||
|
||||
// 可选参数
|
||||
const OPTIONAL = 2;
|
||||
|
||||
// 数组参数
|
||||
const IS_ARRAY = 4;
|
||||
|
||||
/**
|
||||
* 参数名
|
||||
* @var string
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* 参数类型
|
||||
* @var int
|
||||
*/
|
||||
private $mode;
|
||||
|
||||
/**
|
||||
* 参数默认值
|
||||
* @var mixed
|
||||
*/
|
||||
private $default;
|
||||
|
||||
/**
|
||||
* 参数描述
|
||||
* @var string
|
||||
*/
|
||||
private $description;
|
||||
|
||||
/**
|
||||
|
29
vendor/topthink/framework/src/think/event/LogRecord.php
vendored
Normal file
29
vendor/topthink/framework/src/think/event/LogRecord.php
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: yunwuxin <448901948@qq.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace think\event;
|
||||
|
||||
/**
|
||||
* LogRecord事件类
|
||||
*/
|
||||
class LogRecord
|
||||
{
|
||||
/** @var string */
|
||||
public $type;
|
||||
|
||||
/** @var string */
|
||||
public $message;
|
||||
|
||||
public function __construct($type, $message)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->message = $message;
|
||||
}
|
||||
}
|
@ -15,6 +15,7 @@ namespace think\log;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use think\contract\LogHandlerInterface;
|
||||
use think\Event;
|
||||
use think\event\LogRecord;
|
||||
use think\event\LogWrite;
|
||||
|
||||
class Channel implements LoggerInterface
|
||||
@ -94,6 +95,9 @@ class Channel implements LoggerInterface
|
||||
|
||||
if (!empty($msg) || 0 === $msg) {
|
||||
$this->log[$type][] = $msg;
|
||||
if ($this->event) {
|
||||
$this->event->trigger(new LogRecord($type, $msg));
|
||||
}
|
||||
}
|
||||
|
||||
if (!$this->lazy || !$lazy) {
|
||||
|
@ -171,7 +171,9 @@ class RuleGroup extends Rule
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->miss && in_array($this->miss->getMethod(), ['*', $method])) {
|
||||
if (!empty($option['dispatcher'])) {
|
||||
$result = $this->parseRule($request, '', $option['dispatcher'], $url, $option);
|
||||
} elseif ($this->miss && in_array($this->miss->getMethod(), ['*', $method])) {
|
||||
// 未匹配所有路由的路由规则处理
|
||||
$result = $this->parseRule($request, '', $this->miss->getRoute(), $url, $this->miss->getOption());
|
||||
} else {
|
||||
@ -244,6 +246,11 @@ class RuleGroup extends Rule
|
||||
*/
|
||||
public function parseGroupRule($rule): void
|
||||
{
|
||||
if (is_string($rule) && is_subclass_of($rule, Dispatch::class)) {
|
||||
$this->dispatcher($rule);
|
||||
return;
|
||||
}
|
||||
|
||||
$origin = $this->router->getGroup();
|
||||
$this->router->setGroup($this);
|
||||
|
||||
@ -466,6 +473,17 @@ class RuleGroup extends Rule
|
||||
return $this->setOption('merge_rule_regex', $merge);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置分组的Dispatch调度
|
||||
* @access public
|
||||
* @param string $dispatch 调度类
|
||||
* @return $this
|
||||
*/
|
||||
public function dispatcher(string $dispatch)
|
||||
{
|
||||
return $this->setOption('dispatcher', $dispatch);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取完整分组Name
|
||||
* @access public
|
||||
|
@ -98,7 +98,7 @@ class File implements SessionHandlerInterface
|
||||
/** @var SplFileInfo $item */
|
||||
foreach ($items as $item) {
|
||||
if ($item->isDir() && !$item->isLink()) {
|
||||
yield from$this->findFiles($item->getPathname(), $filter);
|
||||
yield from $this->findFiles($item->getPathname(), $filter);
|
||||
} else {
|
||||
if ($filter($item)) {
|
||||
yield $item;
|
||||
|
3
vendor/topthink/think-orm/.gitattributes
vendored
Normal file
3
vendor/topthink/think-orm/.gitattributes
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/.github export-ignore
|
||||
/tests export-ignore
|
||||
/phpunit.xml export-ignore
|
16
vendor/topthink/think-orm/composer.json
vendored
16
vendor/topthink/think-orm/composer.json
vendored
@ -15,14 +15,28 @@
|
||||
"require": {
|
||||
"php": ">=7.1.0",
|
||||
"ext-json": "*",
|
||||
"ext-pdo": "*",
|
||||
"psr/simple-cache": "^1.0",
|
||||
"psr/log": "~1.0",
|
||||
"topthink/think-helper":"^3.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^7|^8|^9.5"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"think\\": "src"
|
||||
},
|
||||
"files": []
|
||||
"files": [
|
||||
"stubs/load_stubs.php"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"tests\\": "tests"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
}
|
||||
}
|
||||
|
24
vendor/topthink/think-orm/src/DbManager.php
vendored
24
vendor/topthink/think-orm/src/DbManager.php
vendored
@ -92,8 +92,6 @@ class DbManager
|
||||
*/
|
||||
protected function modelMaker()
|
||||
{
|
||||
$this->triggerSql();
|
||||
|
||||
Model::setDb($this);
|
||||
|
||||
if (is_object($this->event)) {
|
||||
@ -122,26 +120,8 @@ class DbManager
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function triggerSql(): void
|
||||
{
|
||||
// 监听SQL
|
||||
$this->listen(function ($sql, $time, $master) {
|
||||
if (0 === strpos($sql, 'CONNECT:')) {
|
||||
$this->log($sql);
|
||||
return;
|
||||
}
|
||||
|
||||
// 记录SQL
|
||||
if (is_bool($master)) {
|
||||
// 分布式记录当前操作的主从
|
||||
$master = $master ? 'master|' : 'slave|';
|
||||
} else {
|
||||
$master = '';
|
||||
}
|
||||
|
||||
$this->log($sql . ' [ ' . $master . 'RunTime:' . $time . 's ]');
|
||||
});
|
||||
}
|
||||
public function triggerSql(): void
|
||||
{}
|
||||
|
||||
/**
|
||||
* 初始化配置参数
|
||||
|
41
vendor/topthink/think-orm/src/Model.php
vendored
41
vendor/topthink/think-orm/src/Model.php
vendored
@ -266,8 +266,6 @@ abstract class Model implements JsonSerializable, ArrayAccess, Arrayable, Jsonab
|
||||
*/
|
||||
public function newInstance(array $data = [], $where = null): Model
|
||||
{
|
||||
$this->readDataType($data);
|
||||
|
||||
$model = new static($data);
|
||||
|
||||
if ($this->connection) {
|
||||
@ -457,6 +455,7 @@ abstract class Model implements JsonSerializable, ArrayAccess, Arrayable, Jsonab
|
||||
if ($this->exists) {
|
||||
$this->data = $this->db()->find($this->getKey())->getData();
|
||||
$this->origin = $this->data;
|
||||
$this->get = [];
|
||||
|
||||
if ($relation) {
|
||||
$this->relation = [];
|
||||
@ -544,7 +543,7 @@ abstract class Model implements JsonSerializable, ArrayAccess, Arrayable, Jsonab
|
||||
|
||||
// 重新记录原始数据
|
||||
$this->origin = $this->data;
|
||||
$this->set = [];
|
||||
$this->get = [];
|
||||
$this->lazySave = false;
|
||||
|
||||
return true;
|
||||
@ -611,12 +610,10 @@ abstract class Model implements JsonSerializable, ArrayAccess, Arrayable, Jsonab
|
||||
return true;
|
||||
}
|
||||
|
||||
$data = $this->writeDataType($data);
|
||||
|
||||
if ($this->autoWriteTimestamp && $this->updateTime) {
|
||||
// 自动写入更新时间
|
||||
$data[$this->updateTime] = $this->autoWriteTimestamp();
|
||||
$this->data[$this->updateTime] = $data[$this->updateTime];
|
||||
$this->data[$this->updateTime] = $this->getTimestampValue($data[$this->updateTime]);
|
||||
}
|
||||
|
||||
// 检查允许字段
|
||||
@ -670,23 +667,25 @@ abstract class Model implements JsonSerializable, ArrayAccess, Arrayable, Jsonab
|
||||
*/
|
||||
protected function insertData(string $sequence = null): bool
|
||||
{
|
||||
// 时间戳自动写入
|
||||
if ($this->autoWriteTimestamp) {
|
||||
if ($this->createTime && !isset($this->data[$this->createTime])) {
|
||||
$this->data[$this->createTime] = $this->autoWriteTimestamp();
|
||||
}
|
||||
|
||||
if ($this->updateTime && !isset($this->data[$this->updateTime])) {
|
||||
$this->data[$this->updateTime] = $this->autoWriteTimestamp();
|
||||
}
|
||||
}
|
||||
|
||||
if (false === $this->trigger('BeforeInsert')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->checkData();
|
||||
$data = $this->writeDataType($this->data);
|
||||
$data = $this->data;
|
||||
|
||||
// 时间戳自动写入
|
||||
if ($this->autoWriteTimestamp) {
|
||||
if ($this->createTime && !isset($data[$this->createTime])) {
|
||||
$data[$this->createTime] = $this->autoWriteTimestamp();
|
||||
$this->data[$this->createTime] = $this->getTimestampValue($data[$this->createTime]);
|
||||
}
|
||||
|
||||
if ($this->updateTime && !isset($data[$this->updateTime])) {
|
||||
$data[$this->updateTime] = $this->autoWriteTimestamp();
|
||||
$this->data[$this->updateTime] = $this->getTimestampValue($data[$this->updateTime]);
|
||||
}
|
||||
}
|
||||
|
||||
// 检查允许字段
|
||||
$allowFields = $this->checkAllowFields();
|
||||
@ -705,6 +704,7 @@ abstract class Model implements JsonSerializable, ArrayAccess, Arrayable, Jsonab
|
||||
$pk = $this->getPk();
|
||||
|
||||
if (is_string($pk) && (!isset($this->data[$pk]) || '' == $this->data[$pk])) {
|
||||
unset($this->get[$pk]);
|
||||
$this->data[$pk] = $result;
|
||||
}
|
||||
}
|
||||
@ -717,6 +717,7 @@ abstract class Model implements JsonSerializable, ArrayAccess, Arrayable, Jsonab
|
||||
|
||||
// 标记数据已经存在
|
||||
$this->exists = true;
|
||||
$this->origin = $this->data;
|
||||
|
||||
// 新增回调
|
||||
$this->trigger('AfterInsert');
|
||||
@ -963,7 +964,9 @@ abstract class Model implements JsonSerializable, ArrayAccess, Arrayable, Jsonab
|
||||
*/
|
||||
public function __unset(string $name): void
|
||||
{
|
||||
unset($this->data[$name], $this->relation[$name]);
|
||||
unset($this->data[$name],
|
||||
$this->get[$name],
|
||||
$this->relation[$name]);
|
||||
}
|
||||
|
||||
// ArrayAccess
|
||||
|
@ -266,11 +266,11 @@ abstract class BaseQuery
|
||||
/**
|
||||
* 得到某个列的数组
|
||||
* @access public
|
||||
* @param string $field 字段名 多个字段用逗号分隔
|
||||
* @param string|array $field 字段名 多个字段用逗号分隔
|
||||
* @param string $key 索引
|
||||
* @return array
|
||||
*/
|
||||
public function column(string $field, string $key = ''): array
|
||||
public function column($field, string $key = ''): array
|
||||
{
|
||||
return $this->connection->column($this, $field, $key);
|
||||
}
|
||||
@ -1163,10 +1163,6 @@ abstract class BaseQuery
|
||||
$this->parseView($options);
|
||||
}
|
||||
|
||||
if (!isset($options['field'])) {
|
||||
$options['field'] = '*';
|
||||
}
|
||||
|
||||
foreach (['data', 'order', 'join', 'union'] as $name) {
|
||||
if (!isset($options[$name])) {
|
||||
$options[$name] = [];
|
||||
|
16
vendor/topthink/think-orm/src/db/Builder.php
vendored
16
vendor/topthink/think-orm/src/db/Builder.php
vendored
@ -136,7 +136,7 @@ abstract class Builder
|
||||
}
|
||||
|
||||
if (empty($fields)) {
|
||||
if ('*' == $options['field']) {
|
||||
if (empty($options['field']) || '*' == $options['field']) {
|
||||
$fields = array_keys($bind);
|
||||
} else {
|
||||
$fields = $options['field'];
|
||||
@ -490,7 +490,7 @@ abstract class Builder
|
||||
// 字段分析
|
||||
$key = $field ? $this->parseKey($query, $field, true) : '';
|
||||
|
||||
list($exp, $value) = $val;
|
||||
[$exp, $value] = $val;
|
||||
|
||||
// 检测操作符
|
||||
if (!is_string($exp)) {
|
||||
@ -756,6 +756,9 @@ abstract class Builder
|
||||
$value = $this->parseRaw($query, $value);
|
||||
} else {
|
||||
$value = array_unique(is_array($value) ? $value : explode(',', $value));
|
||||
if (count($value) === 0) {
|
||||
return 'IN' == $exp ? '0 = 1' : '1 = 1';
|
||||
}
|
||||
$array = [];
|
||||
|
||||
foreach ($value as $v) {
|
||||
@ -766,8 +769,7 @@ abstract class Builder
|
||||
if (count($array) == 1) {
|
||||
return $key . ('IN' == $exp ? ' = ' : ' <> ') . $array[0];
|
||||
} else {
|
||||
$zone = implode(',', $array);
|
||||
$value = empty($zone) ? "''" : $zone;
|
||||
$value = implode(',', $array);
|
||||
}
|
||||
}
|
||||
|
||||
@ -898,7 +900,7 @@ abstract class Builder
|
||||
$array[] = $this->parseRand($query);
|
||||
} elseif (is_string($val)) {
|
||||
if (is_numeric($key)) {
|
||||
list($key, $sort) = explode(' ', strpos($val, ' ') ? $val : $val . ' ');
|
||||
[$key, $sort] = explode(' ', strpos($val, ' ') ? $val : $val . ' ');
|
||||
} else {
|
||||
$sort = $val;
|
||||
}
|
||||
@ -1123,7 +1125,7 @@ abstract class Builder
|
||||
$this->parseTable($query, $options['table']),
|
||||
$this->parseDistinct($query, $options['distinct']),
|
||||
$this->parseExtra($query, $options['extra']),
|
||||
$this->parseField($query, $options['field']),
|
||||
$this->parseField($query, $options['field'] ?? '*'),
|
||||
$this->parseJoin($query, $options['join']),
|
||||
$this->parseWhere($query, $options['where']),
|
||||
$this->parseGroup($query, $options['group']),
|
||||
@ -1185,7 +1187,7 @@ abstract class Builder
|
||||
$bind = $query->getFieldsBindType();
|
||||
|
||||
// 获取合法的字段
|
||||
if ('*' == $options['field']) {
|
||||
if (empty($options['field']) || '*' == $options['field']) {
|
||||
$allowFields = array_keys($bind);
|
||||
} else {
|
||||
$allowFields = $options['field'];
|
||||
|
43
vendor/topthink/think-orm/src/db/Connection.php
vendored
43
vendor/topthink/think-orm/src/db/Connection.php
vendored
@ -138,7 +138,6 @@ abstract class Connection implements ConnectionInterface
|
||||
return $this->builder;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建查询对象
|
||||
*/
|
||||
@ -234,19 +233,35 @@ abstract class Connection implements ConnectionInterface
|
||||
protected function trigger(string $sql = '', bool $master = false): void
|
||||
{
|
||||
$listen = $this->db->getListen();
|
||||
|
||||
if (!empty($listen)) {
|
||||
$runtime = number_format((microtime(true) - $this->queryStartTime), 6);
|
||||
$sql = $sql ?: $this->getLastsql();
|
||||
|
||||
if (empty($this->config['deploy'])) {
|
||||
$master = null;
|
||||
}
|
||||
|
||||
foreach ($listen as $callback) {
|
||||
if (is_callable($callback)) {
|
||||
$callback($sql, $runtime, $master);
|
||||
if (empty($listen)) {
|
||||
$listen[] = function ($sql, $time, $master) {
|
||||
if (0 === strpos($sql, 'CONNECT:')) {
|
||||
$this->db->log($sql);
|
||||
return;
|
||||
}
|
||||
|
||||
// 记录SQL
|
||||
if (is_bool($master)) {
|
||||
// 分布式记录当前操作的主从
|
||||
$master = $master ? 'master|' : 'slave|';
|
||||
} else {
|
||||
$master = '';
|
||||
}
|
||||
|
||||
$this->db->log($sql . ' [ ' . $master . 'RunTime:' . $time . 's ]');
|
||||
};
|
||||
}
|
||||
|
||||
$runtime = number_format((microtime(true) - $this->queryStartTime), 6);
|
||||
$sql = $sql ?: $this->getLastsql();
|
||||
|
||||
if (empty($this->config['deploy'])) {
|
||||
$master = null;
|
||||
}
|
||||
|
||||
foreach ($listen as $callback) {
|
||||
if (is_callable($callback)) {
|
||||
$callback($sql, $runtime, $master);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -275,7 +290,7 @@ abstract class Connection implements ConnectionInterface
|
||||
protected function getCacheKey(BaseQuery $query, string $method = ''): string
|
||||
{
|
||||
if (!empty($query->getOptions('key')) && empty($method)) {
|
||||
$key = 'think:' . $this->getConfig('database') . '.' . $query->getTable() . '|' . $query->getOptions('key');
|
||||
$key = 'think_' . $this->getConfig('database') . '.' . $query->getTable() . '|' . $query->getOptions('key');
|
||||
} else {
|
||||
$key = $query->getQueryGuid();
|
||||
}
|
||||
|
@ -145,11 +145,11 @@ interface ConnectionInterface
|
||||
* 得到某个列的数组
|
||||
* @access public
|
||||
* @param BaseQuery $query 查询对象
|
||||
* @param string $column 字段名 多个字段用逗号分隔
|
||||
* @param string|array $column 字段名 多个字段用逗号分隔
|
||||
* @param string $key 索引
|
||||
* @return array
|
||||
*/
|
||||
public function column(BaseQuery $query, string $column, string $key = ''): array;
|
||||
public function column(BaseQuery $query, $column, string $key = ''): array;
|
||||
|
||||
/**
|
||||
* 执行数据库事务
|
||||
|
186
vendor/topthink/think-orm/src/db/PDOConnection.php
vendored
186
vendor/topthink/think-orm/src/db/PDOConnection.php
vendored
@ -18,9 +18,14 @@ use PDOStatement;
|
||||
use think\db\exception\BindParamException;
|
||||
use think\db\exception\DbException;
|
||||
use think\db\exception\PDOException;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 数据库连接基础类
|
||||
* @property PDO[] $links
|
||||
* @property PDO $linkID
|
||||
* @property PDO $linkRead
|
||||
* @property PDO $linkWrite
|
||||
*/
|
||||
abstract class PDOConnection extends Connection
|
||||
{
|
||||
@ -169,6 +174,26 @@ abstract class PDOConnection extends Connection
|
||||
'Error writing data to the connection',
|
||||
'Resource deadlock avoided',
|
||||
'failed with errno',
|
||||
'child connection forced to terminate due to client_idle_limit',
|
||||
'query_wait_timeout',
|
||||
'reset by peer',
|
||||
'Physical connection is not usable',
|
||||
'TCP Provider: Error code 0x68',
|
||||
'ORA-03114',
|
||||
'Packets out of order. Expected',
|
||||
'Adaptive Server connection failed',
|
||||
'Communication link failure',
|
||||
'connection is no longer usable',
|
||||
'Login timeout expired',
|
||||
'SQLSTATE[HY000] [2002] Connection refused',
|
||||
'running with the --read-only option so it cannot execute this statement',
|
||||
'The connection is broken and recovery is not possible. The connection is marked by the client driver as unrecoverable. No attempt was made to restore the connection.',
|
||||
'SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again',
|
||||
'SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known',
|
||||
'SQLSTATE[HY000]: General error: 7 SSL SYSCALL error: EOF detected',
|
||||
'SQLSTATE[HY000] [2002] Connection timed out',
|
||||
'SSL: Connection timed out',
|
||||
'SQLSTATE[HY000]: General error: 1105 The last transaction was aborted due to Seamless Scaling. Please retry.',
|
||||
];
|
||||
|
||||
/**
|
||||
@ -580,7 +605,7 @@ abstract class PDOConnection extends Connection
|
||||
/**
|
||||
* 获取PDO对象
|
||||
* @access public
|
||||
* @return \PDO|false
|
||||
* @return PDO|false
|
||||
*/
|
||||
public function getPdo()
|
||||
{
|
||||
@ -594,12 +619,13 @@ abstract class PDOConnection extends Connection
|
||||
/**
|
||||
* 执行查询 使用生成器返回数据
|
||||
* @access public
|
||||
* @param BaseQuery $query 查询对象
|
||||
* @param string $sql sql指令
|
||||
* @param array $bind 参数绑定
|
||||
* @param \think\Model $model 模型对象实例
|
||||
* @param array $condition 查询条件
|
||||
* @param BaseQuery $query 查询对象
|
||||
* @param string $sql sql指令
|
||||
* @param array $bind 参数绑定
|
||||
* @param Model|null $model 模型对象实例
|
||||
* @param null $condition 查询条件
|
||||
* @return \Generator
|
||||
* @throws DbException
|
||||
*/
|
||||
public function getCursor(BaseQuery $query, string $sql, array $bind = [], $model = null, $condition = null)
|
||||
{
|
||||
@ -618,12 +644,11 @@ abstract class PDOConnection extends Connection
|
||||
/**
|
||||
* 执行查询 返回数据集
|
||||
* @access public
|
||||
* @param string $sql sql指令
|
||||
* @param array $bind 参数绑定
|
||||
* @param string $sql sql指令
|
||||
* @param array $bind 参数绑定
|
||||
* @param bool $master 主库读取
|
||||
* @return array
|
||||
* @throws BindParamException
|
||||
* @throws \PDOException
|
||||
* @throws DbException
|
||||
*/
|
||||
public function query(string $sql, array $bind = [], bool $master = false): array
|
||||
{
|
||||
@ -636,8 +661,7 @@ abstract class PDOConnection extends Connection
|
||||
* @param string $sql sql指令
|
||||
* @param array $bind 参数绑定
|
||||
* @return int
|
||||
* @throws BindParamException
|
||||
* @throws \PDOException
|
||||
* @throws DbException
|
||||
*/
|
||||
public function execute(string $sql, array $bind = []): int
|
||||
{
|
||||
@ -647,15 +671,12 @@ abstract class PDOConnection extends Connection
|
||||
/**
|
||||
* 执行查询 返回数据集
|
||||
* @access protected
|
||||
* @param BaseQuery $query 查询对象
|
||||
* @param mixed $sql sql指令
|
||||
* @param array $bind 参数绑定
|
||||
* @param BaseQuery $query 查询对象
|
||||
* @param mixed $sql sql指令
|
||||
* @param array $bind 参数绑定
|
||||
* @param bool $master 主库读取
|
||||
* @return array
|
||||
* @throws BindParamException
|
||||
* @throws \PDOException
|
||||
* @throws \Exception
|
||||
* @throws \Throwable
|
||||
* @throws DbException
|
||||
*/
|
||||
protected function pdoQuery(BaseQuery $query, $sql, array $bind = [], bool $master = null): array
|
||||
{
|
||||
@ -703,6 +724,7 @@ abstract class PDOConnection extends Connection
|
||||
* @access public
|
||||
* @param BaseQuery $query 查询对象
|
||||
* @return \PDOStatement
|
||||
* @throws DbException
|
||||
*/
|
||||
public function pdo(BaseQuery $query): PDOStatement
|
||||
{
|
||||
@ -721,10 +743,7 @@ abstract class PDOConnection extends Connection
|
||||
* @param bool $master 是否在主服务器读操作
|
||||
* @param bool $procedure 是否为存储过程调用
|
||||
* @return PDOStatement
|
||||
* @throws BindParamException
|
||||
* @throws \PDOException
|
||||
* @throws \Exception
|
||||
* @throws \Throwable
|
||||
* @throws DbException
|
||||
*/
|
||||
public function getPDOStatement(string $sql, array $bind = [], bool $master = false, bool $procedure = false): PDOStatement
|
||||
{
|
||||
@ -759,9 +778,17 @@ abstract class PDOConnection extends Connection
|
||||
|
||||
return $this->PDOStatement;
|
||||
} catch (\Throwable | \Exception $e) {
|
||||
if ($this->reConnectTimes < 4 && $this->isBreak($e)) {
|
||||
++$this->reConnectTimes;
|
||||
return $this->close()->getPDOStatement($sql, $bind, $master, $procedure);
|
||||
if ($this->transTimes > 0) {
|
||||
// 事务活动中时不应该进行重试,应直接中断执行,防止造成污染。
|
||||
if ($this->isBreak($e)) {
|
||||
// 尝试对事务计数进行重置
|
||||
$this->transTimes = 0;
|
||||
}
|
||||
} else {
|
||||
if ($this->reConnectTimes < 4 && $this->isBreak($e)) {
|
||||
++$this->reConnectTimes;
|
||||
return $this->close()->getPDOStatement($sql, $bind, $master, $procedure);
|
||||
}
|
||||
}
|
||||
|
||||
if ($e instanceof \PDOException) {
|
||||
@ -780,10 +807,7 @@ abstract class PDOConnection extends Connection
|
||||
* @param array $bind 参数绑定
|
||||
* @param bool $origin 是否原生查询
|
||||
* @return int
|
||||
* @throws BindParamException
|
||||
* @throws \PDOException
|
||||
* @throws \Exception
|
||||
* @throws \Throwable
|
||||
* @throws DbException
|
||||
*/
|
||||
protected function pdoExecute(BaseQuery $query, string $sql, array $bind = [], bool $origin = false): int
|
||||
{
|
||||
@ -815,6 +839,13 @@ abstract class PDOConnection extends Connection
|
||||
return $this->numRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BaseQuery $query
|
||||
* @param string $sql
|
||||
* @param array $bind
|
||||
* @return PDOStatement
|
||||
* @throws DbException
|
||||
*/
|
||||
protected function queryPDOStatement(BaseQuery $query, string $sql, array $bind = []): PDOStatement
|
||||
{
|
||||
$options = $query->getOptions();
|
||||
@ -1135,12 +1166,12 @@ abstract class PDOConnection extends Connection
|
||||
/**
|
||||
* 得到某个列的数组
|
||||
* @access public
|
||||
* @param BaseQuery $query 查询对象
|
||||
* @param string $column 字段名 多个字段用逗号分隔
|
||||
* @param string $key 索引
|
||||
* @param BaseQuery $query 查询对象
|
||||
* @param string|array $column 字段名 多个字段用逗号分隔
|
||||
* @param string $key 索引
|
||||
* @return array
|
||||
*/
|
||||
public function column(BaseQuery $query, string $column, string $key = ''): array
|
||||
public function column(BaseQuery $query, $column, string $key = ''): array
|
||||
{
|
||||
$options = $query->parseOptions();
|
||||
|
||||
@ -1148,13 +1179,27 @@ abstract class PDOConnection extends Connection
|
||||
$query->removeOption('field');
|
||||
}
|
||||
|
||||
if ($key && '*' != $column) {
|
||||
$field = $key . ',' . $column;
|
||||
} else {
|
||||
$field = $column;
|
||||
if (empty($key) || trim($key) === '') {
|
||||
$key = null;
|
||||
}
|
||||
|
||||
$field = array_map('trim', explode(',', $field));
|
||||
if (\is_string($column)) {
|
||||
$column = \trim($column);
|
||||
if ('*' !== $column) {
|
||||
$column = \array_map('\trim', \explode(',', $column));
|
||||
}
|
||||
} elseif (\is_array($column)) {
|
||||
if (\in_array('*', $column)) {
|
||||
$column = '*';
|
||||
}
|
||||
} else {
|
||||
throw new DbException('not support type');
|
||||
}
|
||||
|
||||
$field = $column;
|
||||
if ('*' !== $column && $key && !\in_array($key, $column)) {
|
||||
$field[] = $key;
|
||||
}
|
||||
|
||||
$query->setOption('field', $field);
|
||||
|
||||
@ -1178,32 +1223,30 @@ abstract class PDOConnection extends Connection
|
||||
}
|
||||
|
||||
// 执行查询操作
|
||||
$pdo = $this->getPDOStatement($sql, $query->getBind(), $options['master']);
|
||||
|
||||
$pdo = $this->getPDOStatement($sql, $query->getBind(), $options['master']);
|
||||
$resultSet = $pdo->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if (is_string($key) && strpos($key, '.')) {
|
||||
[$alias, $key] = explode('.', $key);
|
||||
}
|
||||
|
||||
if (empty($resultSet)) {
|
||||
$result = [];
|
||||
} elseif (('*' == $column || strpos($column, ',')) && $key) {
|
||||
$result = array_column($resultSet, null, $key);
|
||||
} elseif ('*' !== $column && \count($column) === 1) {
|
||||
$column = \array_shift($column);
|
||||
if (\strpos($column, ' ')) {
|
||||
$column = \substr(\strrchr(\trim($column), ' '), 1);
|
||||
}
|
||||
|
||||
if (\strpos($column, '.')) {
|
||||
[$alias, $column] = \explode('.', $column);
|
||||
}
|
||||
|
||||
$result = \array_column($resultSet, $column, $key);
|
||||
} elseif ($key) {
|
||||
$result = \array_column($resultSet, null, $key);
|
||||
} else {
|
||||
if (empty($key)) {
|
||||
$key = null;
|
||||
}
|
||||
|
||||
if ('*' == $column || strpos($column, ',')) {
|
||||
$column = null;
|
||||
} elseif (strpos($column, ' ')) {
|
||||
$column = substr(strrchr(trim($column), ' '), 1);
|
||||
} elseif (strpos($column, '.')) {
|
||||
[$alias, $column] = explode('.', $column);
|
||||
}
|
||||
|
||||
if (is_string($key) && strpos($key, '.')) {
|
||||
[$alias, $key] = explode('.', $key);
|
||||
}
|
||||
|
||||
$result = array_column($resultSet, $column, $key);
|
||||
$result = $resultSet;
|
||||
}
|
||||
|
||||
if (isset($cacheItem)) {
|
||||
@ -1225,19 +1268,19 @@ abstract class PDOConnection extends Connection
|
||||
public function getRealSql(string $sql, array $bind = []): string
|
||||
{
|
||||
foreach ($bind as $key => $val) {
|
||||
$value = is_array($val) ? $val[0] : $val;
|
||||
$value = strval(is_array($val) ? $val[0] : $val);
|
||||
$type = is_array($val) ? $val[1] : PDO::PARAM_STR;
|
||||
|
||||
if ((self::PARAM_FLOAT == $type || PDO::PARAM_STR == $type) && is_string($value)) {
|
||||
if (self::PARAM_FLOAT == $type || PDO::PARAM_STR == $type) {
|
||||
$value = '\'' . addslashes($value) . '\'';
|
||||
} elseif (PDO::PARAM_INT == $type && '' === $value) {
|
||||
$value = 0;
|
||||
$value = '0';
|
||||
}
|
||||
|
||||
// 判断占位符
|
||||
$sql = is_numeric($key) ?
|
||||
substr_replace($sql, (string) $value, strpos($sql, '?'), 1) :
|
||||
substr_replace($sql, (string) $value, strpos($sql, ':' . $key), strlen(':' . $key));
|
||||
substr_replace($sql, $value, strpos($sql, '?'), 1) :
|
||||
substr_replace($sql, $value, strpos($sql, ':' . $key), strlen(':' . $key));
|
||||
}
|
||||
|
||||
return rtrim($sql);
|
||||
@ -1404,12 +1447,16 @@ abstract class PDOConnection extends Connection
|
||||
);
|
||||
}
|
||||
$this->reConnectTimes = 0;
|
||||
} catch (\Exception $e) {
|
||||
if ($this->reConnectTimes < 4 && $this->isBreak($e)) {
|
||||
} catch (\Throwable | \Exception $e) {
|
||||
if ($this->transTimes === 1 && $this->reConnectTimes < 4 && $this->isBreak($e)) {
|
||||
--$this->transTimes;
|
||||
++$this->reConnectTimes;
|
||||
$this->close()->startTrans();
|
||||
} else {
|
||||
if ($this->isBreak($e)) {
|
||||
// 尝试对事务计数进行重置
|
||||
$this->transTimes = 0;
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@ -1419,7 +1466,7 @@ abstract class PDOConnection extends Connection
|
||||
* 用于非自动提交状态下面的查询提交
|
||||
* @access public
|
||||
* @return void
|
||||
* @throws PDOException
|
||||
* @throws \PDOException
|
||||
*/
|
||||
public function commit(): void
|
||||
{
|
||||
@ -1436,7 +1483,7 @@ abstract class PDOConnection extends Connection
|
||||
* 事务回滚
|
||||
* @access public
|
||||
* @return void
|
||||
* @throws PDOException
|
||||
* @throws \PDOException
|
||||
*/
|
||||
public function rollback(): void
|
||||
{
|
||||
@ -1523,6 +1570,7 @@ abstract class PDOConnection extends Connection
|
||||
$this->linkWrite = null;
|
||||
$this->linkRead = null;
|
||||
$this->links = [];
|
||||
$this->transTimes = 0;
|
||||
|
||||
$this->free();
|
||||
|
||||
|
@ -89,7 +89,7 @@ class Mysql extends Builder
|
||||
$this->parsePartition($query, $options['partition']),
|
||||
$this->parseDistinct($query, $options['distinct']),
|
||||
$this->parseExtra($query, $options['extra']),
|
||||
$this->parseField($query, $options['field']),
|
||||
$this->parseField($query, $options['field'] ?? '*'),
|
||||
$this->parseJoin($query, $options['join']),
|
||||
$this->parseWhere($query, $options['where']),
|
||||
$this->parseGroup($query, $options['group']),
|
||||
@ -155,7 +155,7 @@ class Mysql extends Builder
|
||||
$bind = $query->getFieldsBindType();
|
||||
|
||||
// 获取合法的字段
|
||||
if ('*' == $options['field']) {
|
||||
if (empty($options['field']) || '*' == $options['field']) {
|
||||
$allowFields = array_keys($bind);
|
||||
} else {
|
||||
$allowFields = $options['field'];
|
||||
|
@ -29,9 +29,14 @@ use think\db\builder\Mongo as Builder;
|
||||
use think\db\Connection;
|
||||
use think\db\exception\DbException as Exception;
|
||||
use think\db\Mongo as Query;
|
||||
use function implode;
|
||||
use function is_array;
|
||||
|
||||
/**
|
||||
* Mongo数据库驱动
|
||||
* @property Manager[] $links
|
||||
* @property Manager $linkRead
|
||||
* @property Manager $linkWrite
|
||||
*/
|
||||
class Mongo extends Connection
|
||||
{
|
||||
@ -969,11 +974,12 @@ class Mongo extends Connection
|
||||
/**
|
||||
* 得到某个列的数组
|
||||
* @access public
|
||||
* @param string $field 字段名 多个字段用逗号分隔
|
||||
* @param string $key 索引
|
||||
* @param BaseQuery $query
|
||||
* @param string|array $field 字段名 多个字段用逗号分隔
|
||||
* @param string $key 索引
|
||||
* @return array
|
||||
*/
|
||||
public function column(BaseQuery $query, string $field, string $key = ''): array
|
||||
public function column(BaseQuery $query, $field, string $key = ''): array
|
||||
{
|
||||
$options = $query->parseOptions();
|
||||
|
||||
@ -981,6 +987,9 @@ class Mongo extends Connection
|
||||
$query->removeOption('projection');
|
||||
}
|
||||
|
||||
if (is_array($field)) {
|
||||
$field = implode(',', $field);
|
||||
}
|
||||
if ($key && '*' != $field) {
|
||||
$projection = $key . ',' . $field;
|
||||
} else {
|
||||
|
@ -12,99 +12,33 @@ declare (strict_types = 1);
|
||||
|
||||
namespace think\db\exception;
|
||||
|
||||
use Exception;
|
||||
use think\Exception;
|
||||
|
||||
/**
|
||||
* Database相关异常处理类
|
||||
*/
|
||||
if (class_exists('think\Exception')) {
|
||||
class DbException extends \think\Exception
|
||||
class DbException extends Exception
|
||||
{
|
||||
/**
|
||||
* DbException constructor.
|
||||
* @access public
|
||||
* @param string $message
|
||||
* @param array $config
|
||||
* @param string $sql
|
||||
* @param int $code
|
||||
*/
|
||||
public function __construct(string $message, array $config = [], string $sql = '', int $code = 10500)
|
||||
{
|
||||
/**
|
||||
* DbException constructor.
|
||||
* @access public
|
||||
* @param string $message
|
||||
* @param array $config
|
||||
* @param string $sql
|
||||
* @param int $code
|
||||
*/
|
||||
public function __construct(string $message, array $config = [], string $sql = '', int $code = 10500)
|
||||
{
|
||||
$this->message = $message;
|
||||
$this->code = $code;
|
||||
$this->message = $message;
|
||||
$this->code = $code;
|
||||
|
||||
$this->setData('Database Status', [
|
||||
'Error Code' => $code,
|
||||
'Error Message' => $message,
|
||||
'Error SQL' => $sql,
|
||||
]);
|
||||
$this->setData('Database Status', [
|
||||
'Error Code' => $code,
|
||||
'Error Message' => $message,
|
||||
'Error SQL' => $sql,
|
||||
]);
|
||||
|
||||
unset($config['username'], $config['password']);
|
||||
$this->setData('Database Config', $config);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
class DbException extends Exception
|
||||
{
|
||||
/**
|
||||
* DbException constructor.
|
||||
* @access public
|
||||
* @param string $message
|
||||
* @param array $config
|
||||
* @param string $sql
|
||||
* @param int $code
|
||||
*/
|
||||
public function __construct(string $message, array $config = [], string $sql = '', int $code = 10500)
|
||||
{
|
||||
$this->message = $message;
|
||||
$this->code = $code;
|
||||
|
||||
$this->setData('Database Status', [
|
||||
'Error Code' => $code,
|
||||
'Error Message' => $message,
|
||||
'Error SQL' => $sql,
|
||||
]);
|
||||
|
||||
unset($config['username'], $config['password']);
|
||||
$this->setData('Database Config', $config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存异常页面显示的额外Debug数据
|
||||
* @var array
|
||||
*/
|
||||
protected $data = [];
|
||||
|
||||
/**
|
||||
* 设置异常额外的Debug数据
|
||||
* 数据将会显示为下面的格式
|
||||
*
|
||||
* Exception Data
|
||||
* --------------------------------------------------
|
||||
* Label 1
|
||||
* key1 value1
|
||||
* key2 value2
|
||||
* Label 2
|
||||
* key1 value1
|
||||
* key2 value2
|
||||
*
|
||||
* @param string $label 数据分类,用于异常页面显示
|
||||
* @param array $data 需要显示的数据,必须为关联数组
|
||||
*/
|
||||
final protected function setData($label, array $data)
|
||||
{
|
||||
$this->data[$label] = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取异常额外Debug数据
|
||||
* 主要用于输出到异常页面便于调试
|
||||
* @return array 由setData设置的Debug数据
|
||||
*/
|
||||
final public function getData()
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
unset($config['username'], $config['password']);
|
||||
$this->setData('Database Config', $config);
|
||||
}
|
||||
}
|
||||
|
57
vendor/topthink/think-orm/src/facade/Db.php
vendored
57
vendor/topthink/think-orm/src/facade/Db.php
vendored
@ -11,62 +11,7 @@
|
||||
|
||||
namespace think\facade;
|
||||
|
||||
if (class_exists('think\Facade')) {
|
||||
class Facade extends \think\Facade
|
||||
{}
|
||||
} else {
|
||||
class Facade
|
||||
{
|
||||
/**
|
||||
* 始终创建新的对象实例
|
||||
* @var bool
|
||||
*/
|
||||
protected static $alwaysNewInstance;
|
||||
|
||||
protected static $instance;
|
||||
|
||||
/**
|
||||
* 获取当前Facade对应类名
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeClass()
|
||||
{}
|
||||
|
||||
/**
|
||||
* 创建Facade实例
|
||||
* @static
|
||||
* @access protected
|
||||
* @param bool $newInstance 是否每次创建新的实例
|
||||
* @return object
|
||||
*/
|
||||
protected static function createFacade(bool $newInstance = false)
|
||||
{
|
||||
$class = static::getFacadeClass() ?: 'think\DbManager';
|
||||
|
||||
if (static::$alwaysNewInstance) {
|
||||
$newInstance = true;
|
||||
}
|
||||
|
||||
if ($newInstance) {
|
||||
return new $class();
|
||||
}
|
||||
|
||||
if (!self::$instance) {
|
||||
self::$instance = new $class();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
|
||||
}
|
||||
|
||||
// 调用实际类的方法
|
||||
public static function __callStatic($method, $params)
|
||||
{
|
||||
return call_user_func_array([static::createFacade(), $method], $params);
|
||||
}
|
||||
}
|
||||
}
|
||||
use think\Facade;
|
||||
|
||||
/**
|
||||
* @see \think\DbManager
|
||||
|
@ -117,6 +117,21 @@ class Collection extends BaseCollection
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置模型输出场景
|
||||
* @access public
|
||||
* @param string $scene 场景名称
|
||||
* @return $this
|
||||
*/
|
||||
public function scene(string $scene)
|
||||
{
|
||||
$this->each(function (Model $model) use ($scene) {
|
||||
$model->scene($scene);
|
||||
});
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置父模型
|
||||
* @access public
|
||||
|
@ -95,10 +95,10 @@ trait Attribute
|
||||
protected $strict = true;
|
||||
|
||||
/**
|
||||
* 修改器执行记录
|
||||
* 获取器数据
|
||||
* @var array
|
||||
*/
|
||||
private $set = [];
|
||||
private $get = [];
|
||||
|
||||
/**
|
||||
* 动态获取器
|
||||
@ -262,11 +262,13 @@ trait Attribute
|
||||
return $this->origin;
|
||||
}
|
||||
|
||||
return array_key_exists($name, $this->origin) ? $this->origin[$name] : null;
|
||||
$fieldName = $this->getRealFieldName($name);
|
||||
|
||||
return array_key_exists($fieldName, $this->origin) ? $this->origin[$fieldName] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对象原始数据 如果不存在指定字段返回false
|
||||
* 获取当前对象数据 如果不存在指定字段返回false
|
||||
* @access public
|
||||
* @param string $name 字段名 留空获取全部
|
||||
* @return mixed
|
||||
@ -326,6 +328,7 @@ trait Attribute
|
||||
$name = $this->getRealFieldName($name);
|
||||
|
||||
$this->data[$name] = $value;
|
||||
unset($this->get[$name]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -354,10 +357,6 @@ trait Attribute
|
||||
{
|
||||
$name = $this->getRealFieldName($name);
|
||||
|
||||
if (isset($this->set[$name])) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 检测修改器
|
||||
$method = 'set' . Str::studly($name) . 'Attr';
|
||||
|
||||
@ -366,14 +365,17 @@ trait Attribute
|
||||
|
||||
$value = $this->$method($value, array_merge($this->data, $data));
|
||||
|
||||
$this->set[$name] = true;
|
||||
if (is_null($value) && $array !== $this->data) {
|
||||
return;
|
||||
}
|
||||
} elseif (isset($this->type[$name])) {
|
||||
// 类型转换
|
||||
$value = $this->writeTransform($value, $this->type[$name]);
|
||||
}
|
||||
|
||||
// 设置数据对象属性
|
||||
$this->data[$name] = $value;
|
||||
unset($this->get[$name]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -479,8 +481,12 @@ trait Attribute
|
||||
{
|
||||
// 检测属性获取器
|
||||
$fieldName = $this->getRealFieldName($name);
|
||||
$method = 'get' . Str::studly($name) . 'Attr';
|
||||
|
||||
if (array_key_exists($fieldName, $this->get)) {
|
||||
return $this->get[$fieldName];
|
||||
}
|
||||
|
||||
$method = 'get' . Str::studly($name) . 'Attr';
|
||||
if (isset($this->withAttr[$fieldName])) {
|
||||
if ($relation) {
|
||||
$value = $this->getRelationValue($relation);
|
||||
@ -498,54 +504,22 @@ trait Attribute
|
||||
}
|
||||
|
||||
$value = $this->$method($value, $this->data);
|
||||
} elseif (isset($this->type[$fieldName])) {
|
||||
// 类型转换
|
||||
$value = $this->readTransform($value, $this->type[$fieldName]);
|
||||
} elseif ($this->autoWriteTimestamp && in_array($fieldName, [$this->createTime, $this->updateTime])) {
|
||||
$value = $this->getTimestampValue($value);
|
||||
} elseif ($relation) {
|
||||
$value = $this->getRelationValue($relation);
|
||||
// 保存关联对象值
|
||||
$this->relation[$name] = $value;
|
||||
}
|
||||
|
||||
$this->get[$fieldName] = $value;
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取数据类型处理
|
||||
* @access protected
|
||||
* @param array $data 数据
|
||||
* @return void
|
||||
*/
|
||||
protected function readDataType(array &$data): void
|
||||
{
|
||||
foreach ($data as $name => &$value) {
|
||||
if (isset($this->type[$name])) {
|
||||
// 类型转换
|
||||
$value = $this->readTransform($value, $this->type[$name]);
|
||||
} elseif ($this->autoWriteTimestamp && in_array($name, [$this->createTime, $this->updateTime])) {
|
||||
$value = $this->getTimestampValue($value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 写入数据类型处理
|
||||
* @access protected
|
||||
* @param array $data 数据
|
||||
* @return array
|
||||
*/
|
||||
protected function writeDataType(array $data): array
|
||||
{
|
||||
foreach ($data as $name => &$value) {
|
||||
if (isset($this->type[$name])) {
|
||||
// 类型转换
|
||||
$value = $this->writeTransform($value, $this->type[$name]);
|
||||
} elseif (is_null($value) && $this->autoWriteTimestamp && in_array($name, [$this->createTime, $this->updateTime])) {
|
||||
// 自动写入的时间戳字段
|
||||
$value = $this->autoWriteTimestamp();
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取JSON字段属性值
|
||||
* @access protected
|
||||
|
@ -42,6 +42,12 @@ trait Conversion
|
||||
*/
|
||||
protected $append = [];
|
||||
|
||||
/**
|
||||
* 场景
|
||||
* @var array
|
||||
*/
|
||||
protected $scene = [];
|
||||
|
||||
/**
|
||||
* 数据输出字段映射
|
||||
* @var array
|
||||
@ -85,6 +91,26 @@ trait Conversion
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置输出层场景
|
||||
* @access public
|
||||
* @param string $scene 场景名称
|
||||
* @return $this
|
||||
*/
|
||||
public function scene(string $scene)
|
||||
{
|
||||
if (isset($this->scene[$scene])) {
|
||||
$data = $this->scene[$scene];
|
||||
foreach (['append', 'hidden', 'visible'] as $name) {
|
||||
if (isset($data[$name])) {
|
||||
$this->$name($data[$name]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置附加关联对象的属性
|
||||
* @access public
|
||||
@ -255,11 +281,11 @@ trait Conversion
|
||||
$value = $this->getAttr($name);
|
||||
$item[$name] = $value;
|
||||
|
||||
$this->getBindAttr($name, $value, $item);
|
||||
$this->getBindAttrValue($name, $value, $item);
|
||||
}
|
||||
}
|
||||
|
||||
protected function getBindAttr(string $name, $value, array &$item = [])
|
||||
protected function getBindAttrValue(string $name, $value, array &$item = [])
|
||||
{
|
||||
$relation = $this->isRelationAttr($name);
|
||||
if (!$relation) {
|
||||
|
@ -136,7 +136,7 @@ trait RelationShip
|
||||
public function relationQuery(array $relations, array $withRelationAttr = []): void
|
||||
{
|
||||
foreach ($relations as $key => $relation) {
|
||||
$subRelation = '';
|
||||
$subRelation = [];
|
||||
$closure = null;
|
||||
|
||||
if ($relation instanceof Closure) {
|
||||
@ -161,7 +161,7 @@ trait RelationShip
|
||||
$relationResult->withAttr($withRelationAttr[$relationName]);
|
||||
}
|
||||
|
||||
$this->relation[$relation] = $relationResult->getRelation($subRelation, $closure);
|
||||
$this->relation[$relation] = $relationResult->getRelation((array) $subRelation, $closure);
|
||||
}
|
||||
}
|
||||
|
||||
@ -810,19 +810,20 @@ trait RelationShip
|
||||
/**
|
||||
* 自动关联数据删除(支持一对一及一对多关联)
|
||||
* @access protected
|
||||
* @param bool $force 强制删除
|
||||
* @return void
|
||||
*/
|
||||
protected function autoRelationDelete(): void
|
||||
protected function autoRelationDelete($force = false): void
|
||||
{
|
||||
foreach ($this->relationWrite as $key => $name) {
|
||||
$name = is_numeric($key) ? $name : $key;
|
||||
$result = $this->getRelation($name, true);
|
||||
|
||||
if ($result instanceof Model) {
|
||||
$result->delete();
|
||||
$result->force($force)->delete();
|
||||
} elseif ($result instanceof Collection) {
|
||||
foreach ($result as $model) {
|
||||
$model->delete();
|
||||
$model->force($force)->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -107,9 +107,10 @@ trait SoftDelete
|
||||
return false;
|
||||
}
|
||||
|
||||
$name = $this->getDeleteTimeField();
|
||||
$name = $this->getDeleteTimeField();
|
||||
$force = $this->isForce();
|
||||
|
||||
if ($name && !$this->isForce()) {
|
||||
if ($name && !$force) {
|
||||
// 软删除
|
||||
$this->set($name, $this->autoWriteTimestamp($name));
|
||||
|
||||
@ -131,7 +132,7 @@ trait SoftDelete
|
||||
|
||||
// 关联删除
|
||||
if (!empty($this->relationWrite)) {
|
||||
$this->autoRelationDelete();
|
||||
$this->autoRelationDelete($force);
|
||||
}
|
||||
|
||||
$this->trigger('AfterDelete');
|
||||
|
@ -41,6 +41,12 @@ class MorphOne extends Relation
|
||||
*/
|
||||
protected $type;
|
||||
|
||||
/**
|
||||
* 绑定的关联属性
|
||||
* @var array
|
||||
*/
|
||||
protected $bindAttr = [];
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
* @access public
|
||||
@ -78,6 +84,11 @@ class MorphOne extends Relation
|
||||
$relationModel = $this->query->relation($subRelation)->find();
|
||||
|
||||
if ($relationModel) {
|
||||
if (!empty($this->bindAttr)) {
|
||||
// 绑定关联属性
|
||||
$this->bindAttr($this->parent, $relationModel);
|
||||
}
|
||||
|
||||
$relationModel->setParent(clone $this->parent);
|
||||
}
|
||||
|
||||
@ -154,7 +165,13 @@ class MorphOne extends Relation
|
||||
$relationModel->exists(true);
|
||||
}
|
||||
|
||||
$result->setRelation($relation, $relationModel);
|
||||
if (!empty($this->bindAttr)) {
|
||||
// 绑定关联属性
|
||||
$this->bindAttr($result, $relationModel);
|
||||
} else {
|
||||
// 设置关联属性
|
||||
$result->setRelation($relation, $relationModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -188,7 +205,13 @@ class MorphOne extends Relation
|
||||
$relationModel = null;
|
||||
}
|
||||
|
||||
$result->setRelation($relation, $relationModel);
|
||||
if (!empty($this->bindAttr)) {
|
||||
// 绑定关联属性
|
||||
$this->bindAttr($result, $relationModel);
|
||||
} else {
|
||||
// 设置关联属性
|
||||
$result->setRelation($relation, $relationModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -277,4 +300,48 @@ class MorphOne extends Relation
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定关联表的属性到父模型属性
|
||||
* @access public
|
||||
* @param array $attr 要绑定的属性列表
|
||||
* @return $this
|
||||
*/
|
||||
public function bind(array $attr)
|
||||
{
|
||||
$this->bindAttr = $attr;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取绑定属性
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getBindAttr(): array
|
||||
{
|
||||
return $this->bindAttr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定关联属性到父模型
|
||||
* @access protected
|
||||
* @param Model $result 父模型对象
|
||||
* @param Model $model 关联模型对象
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function bindAttr(Model $result, Model $model = null): void
|
||||
{
|
||||
foreach ($this->bindAttr as $key => $attr) {
|
||||
$key = is_numeric($key) ? $attr : $key;
|
||||
$value = $result->getOrigin($key);
|
||||
|
||||
if (!is_null($value)) {
|
||||
throw new Exception('bind attr has exists:' . $key);
|
||||
}
|
||||
|
||||
$result->setAttr($key, $model ? $model->$attr : null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
59
vendor/topthink/think-orm/stubs/Exception.php
vendored
Normal file
59
vendor/topthink/think-orm/stubs/Exception.php
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace think;
|
||||
|
||||
/**
|
||||
* 异常基础类
|
||||
* @package think
|
||||
*/
|
||||
class Exception extends \Exception
|
||||
{
|
||||
/**
|
||||
* 保存异常页面显示的额外Debug数据
|
||||
* @var array
|
||||
*/
|
||||
protected $data = [];
|
||||
|
||||
/**
|
||||
* 设置异常额外的Debug数据
|
||||
* 数据将会显示为下面的格式
|
||||
*
|
||||
* Exception Data
|
||||
* --------------------------------------------------
|
||||
* Label 1
|
||||
* key1 value1
|
||||
* key2 value2
|
||||
* Label 2
|
||||
* key1 value1
|
||||
* key2 value2
|
||||
*
|
||||
* @access protected
|
||||
* @param string $label 数据分类,用于异常页面显示
|
||||
* @param array $data 需要显示的数据,必须为关联数组
|
||||
*/
|
||||
final protected function setData(string $label, array $data)
|
||||
{
|
||||
$this->data[$label] = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取异常额外Debug数据
|
||||
* 主要用于输出到异常页面便于调试
|
||||
* @access public
|
||||
* @return array 由setData设置的Debug数据
|
||||
*/
|
||||
final public function getData()
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
}
|
65
vendor/topthink/think-orm/stubs/Facade.php
vendored
Normal file
65
vendor/topthink/think-orm/stubs/Facade.php
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace think;
|
||||
|
||||
class Facade
|
||||
{
|
||||
/**
|
||||
* 始终创建新的对象实例
|
||||
* @var bool
|
||||
*/
|
||||
protected static $alwaysNewInstance;
|
||||
|
||||
protected static $instance;
|
||||
|
||||
/**
|
||||
* 获取当前Facade对应类名
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeClass()
|
||||
{}
|
||||
|
||||
/**
|
||||
* 创建Facade实例
|
||||
* @static
|
||||
* @access protected
|
||||
* @param bool $newInstance 是否每次创建新的实例
|
||||
* @return object
|
||||
*/
|
||||
protected static function createFacade(bool $newInstance = false)
|
||||
{
|
||||
$class = static::getFacadeClass() ?: 'think\DbManager';
|
||||
|
||||
if (static::$alwaysNewInstance) {
|
||||
$newInstance = true;
|
||||
}
|
||||
|
||||
if ($newInstance) {
|
||||
return new $class();
|
||||
}
|
||||
|
||||
if (!self::$instance) {
|
||||
self::$instance = new $class();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
|
||||
}
|
||||
|
||||
// 调用实际类的方法
|
||||
public static function __callStatic($method, $params)
|
||||
{
|
||||
return call_user_func_array([static::createFacade(), $method], $params);
|
||||
}
|
||||
}
|
9
vendor/topthink/think-orm/stubs/load_stubs.php
vendored
Normal file
9
vendor/topthink/think-orm/stubs/load_stubs.php
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
if (!\class_exists('think\Exception')) {
|
||||
require __DIR__ . '/Exception.php';
|
||||
}
|
||||
|
||||
if (!\class_exists('think\Facade')) {
|
||||
require __DIR__ . '/Facade.php';
|
||||
}
|
201
vendor/wamkj/thinkphp6.0-databackup/LICENSE
vendored
Normal file
201
vendor/wamkj/thinkphp6.0-databackup/LICENSE
vendored
Normal file
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
58
vendor/wamkj/thinkphp6.0-databackup/README.md
vendored
Normal file
58
vendor/wamkj/thinkphp6.0-databackup/README.md
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
### 使用composer进行安装
|
||||
~~~
|
||||
composer require wamkj/thinkphp6.0-databackup
|
||||
~~~
|
||||
|
||||
### 引入类文件
|
||||
~~~
|
||||
use wamkj\thinkphp\Backup;
|
||||
~~~
|
||||
|
||||
### 配置文件
|
||||
~~~
|
||||
$config=array(
|
||||
'path' => './Data/',//数据库备份路径
|
||||
'part' => 20971520,//数据库备份卷大小
|
||||
'compress' => 0,//数据库备份文件是否启用压缩 0不压缩 1 压缩
|
||||
'level' => 9 //数据库备份文件压缩级别 1普通 4 一般 9最高
|
||||
);
|
||||
~~~
|
||||
|
||||
### 实例化
|
||||
~~~
|
||||
$db= new Backup($config);
|
||||
~~~
|
||||
|
||||
### 数据类表列表
|
||||
~~~
|
||||
return $this->fetch('index',['list'=>$db->dataList()]);
|
||||
~~~
|
||||
### 备份文件列表
|
||||
~~~
|
||||
return $this->fetch('importlist',['list'=>$db->fileList()]);
|
||||
~~~
|
||||
|
||||
### 备份表
|
||||
~~~
|
||||
$start= $db->setFile($file)->backup($tables[$id], $start);
|
||||
~~~
|
||||
|
||||
### 导入表
|
||||
~~~
|
||||
$start= $db->setFile($file)->import($start);
|
||||
~~~
|
||||
|
||||
### 删除备份文件
|
||||
~~~
|
||||
$db->delFile($time);
|
||||
~~~
|
||||
|
||||
### 修复表
|
||||
~~~
|
||||
$db->repair($tables)
|
||||
~~~
|
||||
|
||||
### 优化表
|
||||
~~~
|
||||
$db->optimize($tables)
|
||||
~~~
|
21
vendor/wamkj/thinkphp6.0-databackup/composer.json
vendored
Normal file
21
vendor/wamkj/thinkphp6.0-databackup/composer.json
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "wamkj/thinkphp6.0-databackup",
|
||||
"description": "thinkphp6.0的数据库自动备份扩展",
|
||||
"keywords": ["think-databackup", "thinkphp"],
|
||||
"license": "Apache-2.0",
|
||||
"authors": [
|
||||
{
|
||||
"name": "wamkj",
|
||||
"email": "1149183529@qq.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.1.0",
|
||||
"topthink/framework": "^6.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"wamkj\\thinkphp\\": "src/"
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user