初始数据提交
This commit is contained in:
67
config/app.php
Normal file
67
config/app.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 应用设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
// 应用地址
|
||||
'app_host' => env('app.host', ''),
|
||||
|
||||
// 应用的命名空间
|
||||
'app_namespace' => '',
|
||||
|
||||
// 是否启用路由
|
||||
'with_route' => true,
|
||||
|
||||
// 默认应用
|
||||
'default_app' => 'index',
|
||||
|
||||
// 默认时区
|
||||
'default_timezone' => 'Asia/Shanghai',
|
||||
|
||||
// 应用映射(自动多应用模式有效)
|
||||
'app_map' => [],
|
||||
|
||||
// 域名绑定(自动多应用模式有效)
|
||||
'domain_bind' => [
|
||||
'api' => 'api',
|
||||
'doc' => 'doc',
|
||||
'ask' => 'ask',
|
||||
'*' => 'index',
|
||||
],
|
||||
|
||||
// 禁止URL访问的应用列表(自动多应用模式有效)
|
||||
'deny_app_list' => ['common'],
|
||||
|
||||
// 自定义页面abort抛出异常
|
||||
'http_exception_template' => [
|
||||
404 => public_path() . '404.html',
|
||||
401 => public_path() . '401.html',
|
||||
500 => public_path() . '500.html',
|
||||
],
|
||||
|
||||
// 默认跳转页面对应的模板文件
|
||||
'dispatch_error' => app_path() . 'admin/view/public/jumptpl.html',
|
||||
'dispatch_success' => app_path() . 'admin/view/public/jumptpl.html',
|
||||
|
||||
// 异常页面的模板文件
|
||||
'exception_tmpl' => root_path() . 'extend/system/exception.tpl',
|
||||
|
||||
// 错误显示信息,非调试模式有效
|
||||
'error_message' => '页面错误!请稍后再试~',
|
||||
|
||||
// 框架版本
|
||||
'version' => 'v20231118',
|
||||
|
||||
// 插件冲突缓存
|
||||
'plugin_mutex' => true,
|
||||
|
||||
// 跨域请求域名
|
||||
'cors_domain' => ['*', '127.0.0.1','localhost'],
|
||||
|
||||
//API接口地址
|
||||
'api_url' => 'https://api.swiftadmin.net/',
|
||||
|
||||
// 显示错误信息
|
||||
'show_error_msg' => false,
|
||||
];
|
||||
46
config/cache.php
Normal file
46
config/cache.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | 缓存设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
// 默认缓存驱动
|
||||
'default' => env('cache.driver', 'file'),
|
||||
|
||||
// 缓存连接方式配置
|
||||
'stores' => [
|
||||
'file' => [
|
||||
// 驱动方式
|
||||
'type' => 'File',
|
||||
// 缓存保存目录
|
||||
'path' => '',
|
||||
// 缓存前缀
|
||||
'prefix' => '',
|
||||
// 缓存有效期 0表示永久缓存
|
||||
'expire' => 0,
|
||||
// 缓存标签前缀
|
||||
'tag_prefix' => 'tag:',
|
||||
// 序列化机制 例如 ['serialize', 'unserialize']
|
||||
'serialize' => [],
|
||||
],
|
||||
// redis缓存
|
||||
'redis' => [
|
||||
'type' => 'redis',
|
||||
'select' => env('cache.select', '0'),
|
||||
'host' => env('cache.hostname', '127.0.0.1'),
|
||||
'port' => env('cache.hostport', '6379'),
|
||||
'username' => env('cache.username', ''),
|
||||
'password' => env('cache.password', ''),
|
||||
],
|
||||
// memcached缓存
|
||||
'memcached' => [
|
||||
'type' => 'memcached',
|
||||
'host' => env('cache.hostname', ''),
|
||||
'port' => env('cache.hostport', ''),
|
||||
'username' => env('cache.username', ''),
|
||||
'password' => env('cache.password', ''),
|
||||
],
|
||||
// 更多的缓存连接
|
||||
],
|
||||
];
|
||||
39
config/captcha.php
Normal file
39
config/captcha.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Captcha配置文件
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
//验证码位数
|
||||
'length' => 4,
|
||||
// 验证码字符集合
|
||||
'codeSet' => '2345678abcdefhijkmnpqrstuvwxyzABCDEFGHJKLMNPQRTUVWXY',
|
||||
// 验证码过期时间
|
||||
'expire' => 1800,
|
||||
// 是否使用中文验证码
|
||||
'useZh' => false,
|
||||
// 是否使用算术验证码
|
||||
'math' => false,
|
||||
// 是否使用背景图
|
||||
'useImgBg' => false,
|
||||
//验证码字符大小
|
||||
'fontSize' => 23,
|
||||
// 是否使用混淆曲线
|
||||
'useCurve' => false,
|
||||
//是否添加杂点
|
||||
'useNoise' => true,
|
||||
// 验证码字体 不设置则随机
|
||||
'fontttf' => '',
|
||||
//背景颜色
|
||||
'bg' => [243, 251, 254],
|
||||
// 验证码图片高度
|
||||
'imageH' => 0,
|
||||
// 验证码图片宽度
|
||||
'imageW' => 0,
|
||||
|
||||
// 添加额外的验证码设置
|
||||
// verify => [
|
||||
// 'length'=>4,
|
||||
// ...
|
||||
//],
|
||||
];
|
||||
9
config/console.php
Normal file
9
config/console.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 控制台配置
|
||||
// +----------------------------------------------------------------------
|
||||
return [
|
||||
// 指令定义
|
||||
'commands' => [
|
||||
],
|
||||
];
|
||||
20
config/cookie.php
Normal file
20
config/cookie.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Cookie设置
|
||||
// +----------------------------------------------------------------------
|
||||
return [
|
||||
// cookie 保存时间
|
||||
'expire' => 0,
|
||||
// cookie 保存路径
|
||||
'path' => '/',
|
||||
// cookie 有效域名
|
||||
'domain' => '',
|
||||
// cookie 启用安全传输
|
||||
'secure' => false,
|
||||
// httponly设置
|
||||
// 'httponly' => false,
|
||||
// 是否使用 setcookie
|
||||
// 'setcookie' => true,
|
||||
// samesite 设置,支持 'strict' 'lax'
|
||||
// 'samesite' => '',
|
||||
];
|
||||
60
config/database.php
Normal file
60
config/database.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
// 默认使用的数据库连接配置
|
||||
'default' => env('database.driver', 'mysql'),
|
||||
|
||||
// 自定义时间查询规则
|
||||
'time_query_rule' => [],
|
||||
|
||||
// 自动写入时间戳字段
|
||||
// true为自动识别类型 false关闭
|
||||
// 字符串则明确指定时间字段类型 支持 int timestamp datetime date
|
||||
'auto_timestamp' => true,
|
||||
|
||||
// 时间字段取出后的默认时间格式
|
||||
'datetime_format' => 'Y-m-d H:i:s',
|
||||
|
||||
// 数据库连接配置信息
|
||||
'connections' => [
|
||||
'mysql' => [
|
||||
// 数据库类型
|
||||
'type' => env('database.type', 'mysql'),
|
||||
// 服务器地址
|
||||
'hostname' => env('database.hostname', '127.0.0.1'),
|
||||
// 数据库名
|
||||
'database' => env('database.database', ''),
|
||||
// 用户名
|
||||
'username' => env('database.username', 'root'),
|
||||
// 密码
|
||||
'password' => env('database.password', '123456'),
|
||||
// 端口
|
||||
'hostport' => env('database.hostport', '3306'),
|
||||
// 数据库连接参数
|
||||
'params' => [],
|
||||
// 数据库编码默认采用utf8
|
||||
'charset' => env('database.charset', 'utf8mb4'),
|
||||
// 数据库表前缀
|
||||
'prefix' => env('database.prefix', 'sa_'),
|
||||
|
||||
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
|
||||
'deploy' => 0,
|
||||
// 数据库读写是否分离 主从式有效
|
||||
'rw_separate' => false,
|
||||
// 读写分离后 主服务器数量
|
||||
'master_num' => 1,
|
||||
// 指定从服务器序号
|
||||
'slave_no' => '',
|
||||
// 是否严格检查字段是否存在
|
||||
'fields_strict' => true,
|
||||
// 是否需要断线重连
|
||||
'break_reconnect' => false,
|
||||
// 监听SQL
|
||||
'trigger_sql' => env('app_debug', false),
|
||||
// 开启字段缓存
|
||||
'fields_cache' => true,
|
||||
],
|
||||
|
||||
// 更多的数据库配置信息
|
||||
],
|
||||
];
|
||||
24
config/filesystem.php
Normal file
24
config/filesystem.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
// 默认磁盘
|
||||
'default' => env('filesystem.driver', 'local'),
|
||||
// 磁盘列表
|
||||
'disks' => [
|
||||
'local' => [
|
||||
'type' => 'local',
|
||||
'root' => app()->getRuntimePath() . 'storage',
|
||||
],
|
||||
'public' => [
|
||||
// 磁盘类型
|
||||
'type' => 'local',
|
||||
// 磁盘路径
|
||||
'root' => app()->getRootPath() . 'public/storage',
|
||||
// 磁盘路径对应的外部URL路径
|
||||
'url' => '/storage',
|
||||
// 可见性
|
||||
'visibility' => 'public',
|
||||
],
|
||||
// 更多的磁盘配置信息
|
||||
],
|
||||
];
|
||||
45
config/gateway_worker.php
Normal file
45
config/gateway_worker.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2018 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
// +----------------------------------------------------------------------
|
||||
// | Workerman设置 仅对 php think worker:gateway 指令有效
|
||||
// +----------------------------------------------------------------------
|
||||
return [
|
||||
// 扩展自身需要的配置
|
||||
'protocol' => 'websocket', // 协议 支持 tcp udp unix http websocket text
|
||||
'host' => '0.0.0.0', // 监听地址
|
||||
'port' => 2345, // 监听端口
|
||||
'socket' => '', // 完整监听地址
|
||||
'context' => [], // socket 上下文选项
|
||||
'register_deploy' => true, // 是否需要部署register
|
||||
'businessWorker_deploy' => true, // 是否需要部署businessWorker
|
||||
'gateway_deploy' => true, // 是否需要部署gateway
|
||||
|
||||
// Register配置
|
||||
'registerAddress' => '127.0.0.1:1236',
|
||||
|
||||
// Gateway配置
|
||||
'name' => 'workerman',
|
||||
'count' => 4,
|
||||
'lanIp' => '127.0.0.1',
|
||||
'startPort' => 2000,
|
||||
'daemonize' => false,
|
||||
'pingInterval' => 55,
|
||||
'pingNotResponseLimit' => 1,
|
||||
'pingData' => '{"type":"ping"}',
|
||||
|
||||
// BusinsessWorker配置
|
||||
'businessWorker' => [
|
||||
'name' => 'BusinessWorker',
|
||||
'count' => 1,
|
||||
'eventHandler' => '\app\worker\Events',
|
||||
],
|
||||
|
||||
];
|
||||
32
config/lang.php
Normal file
32
config/lang.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 多语言设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
// 默认语言
|
||||
'default_lang' => env('lang.default_lang', 'zh-CN'),
|
||||
// 允许的语言列表
|
||||
'allow_lang_list' => ['zh-CN', 'en-US'],
|
||||
// 多语言自动侦测变量名
|
||||
'detect_var' => 'lang',
|
||||
// 是否使用Cookie记录
|
||||
'use_cookie' => true,
|
||||
// 多语言cookie变量
|
||||
'cookie_var' => 'lang',
|
||||
// 多语言header变量
|
||||
'header_var' => 'lang',
|
||||
|
||||
// 扩展语言包
|
||||
'extend_list' => [
|
||||
'zh-CN' => [],
|
||||
],
|
||||
|
||||
// Accept-Language转义为对应语言包名称
|
||||
'accept_language' => [
|
||||
'zh-hans-cn' => 'zh-CN',
|
||||
],
|
||||
|
||||
// 是否支持语言分组
|
||||
'allow_group' => false,
|
||||
];
|
||||
45
config/log.php
Normal file
45
config/log.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | 日志设置
|
||||
// +----------------------------------------------------------------------
|
||||
return [
|
||||
// 默认日志记录通道
|
||||
'default' => env('log.channel', 'file'),
|
||||
// 日志记录级别
|
||||
'level' => [],
|
||||
// 日志类型记录的通道 ['error'=>'email',...]
|
||||
'type_channel' => [],
|
||||
// 关闭全局日志写入
|
||||
'close' => true,
|
||||
// 全局日志处理 支持闭包
|
||||
'processor' => null,
|
||||
|
||||
// 日志通道列表
|
||||
'channels' => [
|
||||
'file' => [
|
||||
// 日志记录方式
|
||||
'type' => 'File',
|
||||
// 日志保存目录
|
||||
'path' => '',
|
||||
// 单文件日志写入
|
||||
'single' => false,
|
||||
// 独立日志级别
|
||||
'apart_level' => [],
|
||||
// 最大日志文件数量
|
||||
'max_files' => 0,
|
||||
// 使用JSON格式记录
|
||||
'json' => false,
|
||||
// 日志处理
|
||||
'processor' => null,
|
||||
// 关闭通道日志写入
|
||||
'close' => false,
|
||||
// 日志输出格式化
|
||||
'format' => '[%s][%s] %s',
|
||||
// 是否实时写入
|
||||
'realtime_write' => false,
|
||||
],
|
||||
// 其它日志通道配置
|
||||
],
|
||||
|
||||
];
|
||||
8
config/middleware.php
Normal file
8
config/middleware.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
// 中间件配置
|
||||
return [
|
||||
// 别名或分组
|
||||
'alias' => [],
|
||||
// 优先级设置,此数组中的中间件会按照数组中的顺序优先执行
|
||||
'priority' => [],
|
||||
];
|
||||
45
config/player.php
Normal file
45
config/player.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
return array (
|
||||
0 =>
|
||||
array (
|
||||
'name' => 'iframe',
|
||||
'title' => 'iframe',
|
||||
'desc' => 'iframe引用任何网页',
|
||||
'parsing' => '0',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
'name' => 'video',
|
||||
'title' => 'Video',
|
||||
'desc' => 'html5的video标签',
|
||||
'parsing' => '0',
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
'name' => 'dplayer',
|
||||
'title' => 'Dplayer',
|
||||
'desc' => 'Dplayer',
|
||||
'parsing' => '0',
|
||||
),
|
||||
3 =>
|
||||
array (
|
||||
'name' => 'ckplayer',
|
||||
'title' => 'CkPlayer',
|
||||
'desc' => 'CkPlayer',
|
||||
'parsing' => '0',
|
||||
),
|
||||
4 =>
|
||||
array (
|
||||
'name' => 'ckm3u8',
|
||||
'title' => 'Ckm3u8',
|
||||
'desc' => 'M3u8播放器',
|
||||
'parsing' => '0',
|
||||
),
|
||||
5 =>
|
||||
array (
|
||||
'name' => 'flv',
|
||||
'title' => 'Flv',
|
||||
'desc' => 'Flv播放器',
|
||||
'parsing' => '0',
|
||||
),
|
||||
);
|
||||
10
config/plugin.php
Normal file
10
config/plugin.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
return [
|
||||
'autoload' => false,
|
||||
'hooks' => [
|
||||
],
|
||||
'router' => [
|
||||
],
|
||||
'priority' => [
|
||||
],
|
||||
];
|
||||
39
config/queue.php
Normal file
39
config/queue.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: yunwuxin <448901948@qq.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
'default' => 'redis',
|
||||
'connections' => [
|
||||
'sync' => [
|
||||
'type' => 'sync',
|
||||
],
|
||||
'database' => [
|
||||
'type' => 'database',
|
||||
'queue' => 'default',
|
||||
'table' => 'jobs',
|
||||
'connection' => null,
|
||||
],
|
||||
'redis' => [
|
||||
'type' => 'redis',
|
||||
'queue' => 'default',
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 6379,
|
||||
'password' => '',
|
||||
'select' => 10,
|
||||
'timeout' => 0,
|
||||
'persistent' => false,
|
||||
],
|
||||
],
|
||||
'failed' => [
|
||||
'type' => 'none',
|
||||
'table' => 'failed_jobs',
|
||||
],
|
||||
];
|
||||
47
config/route.php
Normal file
47
config/route.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 路由设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
// pathinfo分隔符
|
||||
'pathinfo_depr' => '/',
|
||||
// URL伪静态后缀
|
||||
'url_html_suffix' => 'html',
|
||||
// URL普通方式参数 用于自动生成
|
||||
'url_common_param' => true,
|
||||
// 是否开启路由延迟解析
|
||||
'url_lazy_route' => false,
|
||||
// 开启路由缓存
|
||||
'route_check_cache' => true,
|
||||
// 是否强制使用路由
|
||||
'url_route_must' => false,
|
||||
// 合并路由规则
|
||||
'route_rule_merge' => false,
|
||||
// 路由是否完全匹配
|
||||
'route_complete_match' => false,
|
||||
// 访问控制器层名称
|
||||
'controller_layer' => 'controller',
|
||||
// 空控制器名
|
||||
'empty_controller' => 'Error',
|
||||
// 是否使用控制器后缀
|
||||
'controller_suffix' => false,
|
||||
// 默认的路由变量规则
|
||||
'default_route_pattern' => '[\w\.]+',
|
||||
// 是否开启请求缓存 true自动缓存 支持设置请求缓存规则
|
||||
'request_cache_key' => false,
|
||||
// 请求缓存有效期
|
||||
'request_cache_expire' => null,
|
||||
// 全局请求缓存排除规则
|
||||
'request_cache_except' => [],
|
||||
// 默认控制器名
|
||||
'default_controller' => 'Index',
|
||||
// 默认操作名
|
||||
'default_action' => 'index',
|
||||
// 操作方法后缀
|
||||
'action_suffix' => '',
|
||||
// 默认JSONP格式返回的处理方法
|
||||
'default_jsonp_handler' => 'jsonpReturn',
|
||||
// 默认JSONP处理方法
|
||||
'var_jsonp_handler' => 'callback',
|
||||
];
|
||||
23
config/server.php
Normal file
23
config/server.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
return array (
|
||||
'server1' =>
|
||||
array (
|
||||
'status' => '1',
|
||||
'name' => 'server1',
|
||||
'title' => '主服务器',
|
||||
'des' => '主服务器地址',
|
||||
'sort' => '1',
|
||||
'tip' => '主服务器提示信息',
|
||||
'id' => 'server1',
|
||||
),
|
||||
'server2' =>
|
||||
array (
|
||||
'status' => '1',
|
||||
'name' => 'server2',
|
||||
'title' => '备用服务器',
|
||||
'des' => '备用服务器地址',
|
||||
'sort' => '2',
|
||||
'tip' => '备用服务器提示信息',
|
||||
'id' => 'server2',
|
||||
)
|
||||
);
|
||||
19
config/session.php
Normal file
19
config/session.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 会话设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
// session name
|
||||
'name' => 'SESSION_ID',
|
||||
// SESSION_ID的提交变量,解决flash上传跨域
|
||||
'var_session_id' => '',
|
||||
// 驱动方式 支持file cache
|
||||
'type' => 'cache',
|
||||
// 存储连接标识 当type使用cache的时候有效
|
||||
'store' => null,
|
||||
// 过期时间
|
||||
'expire' => 604800,
|
||||
// 前缀
|
||||
'prefix' => '',
|
||||
];
|
||||
11
config/spider.php
Normal file
11
config/spider.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
return [
|
||||
'BaiduSpider' => '百度',
|
||||
'Sogou' => '搜狗',
|
||||
'ByteSpider' => '头条',
|
||||
'Googlebot' => '谷歌',
|
||||
'YisouSpider' => '神马',
|
||||
'BingBot' => '必应',
|
||||
'360Spider' => '360蜘蛛',
|
||||
'YandexBot' => 'Yandex',
|
||||
];
|
||||
10
config/trace.php
Normal file
10
config/trace.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Trace设置 开启调试模式后有效
|
||||
// +----------------------------------------------------------------------
|
||||
return [
|
||||
// 内置Html和Console两种方式 支持扩展
|
||||
'type' => 'Html',
|
||||
// 读取的日志通道名
|
||||
'channel' => '',
|
||||
];
|
||||
37
config/view.php
Normal file
37
config/view.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 模板设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
// 模板引擎类型使用Think
|
||||
'type' => 'Think',
|
||||
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
|
||||
'auto_rule' => 1,
|
||||
// 模板目录名
|
||||
'view_dir_name' => 'view',
|
||||
// 模板后缀
|
||||
'view_suffix' => 'html',
|
||||
// 模板文件名分隔符
|
||||
'view_depr' => DIRECTORY_SEPARATOR,
|
||||
// 模板引擎普通标签开始标记
|
||||
'tpl_begin' => '{',
|
||||
// 模板引擎普通标签结束标记
|
||||
'tpl_end' => '}',
|
||||
// 标签库标签开始标记
|
||||
'taglib_begin' => '<',
|
||||
// 标签库标签结束标记
|
||||
'taglib_end' => '>',
|
||||
// 预先加载的标签库
|
||||
'taglib_pre_load' => 'app\common\taglib\Salibs',
|
||||
'tpl_replace_string' => [
|
||||
'__STATIC__' => '/static/',
|
||||
'__STATICJS__' => '/static/js/',
|
||||
'__STATICCSS__' => '/static/css/',
|
||||
'__STATICIMAGES__' => '/static/images/',
|
||||
'__STATICADMIN__' => '/static/system/',
|
||||
'__ADMINIMAGES__' => '/static/system/images/',
|
||||
'__ADMINPLUGIN__' => '/static/system/plugin/',
|
||||
'__HOMEPLUGIN__' => '/static/plugin/',
|
||||
]
|
||||
];
|
||||
30
config/worker.php
Normal file
30
config/worker.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2018 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | Workerman设置 仅对 php think worker 指令有效
|
||||
// +----------------------------------------------------------------------
|
||||
return [
|
||||
// 扩展自身需要的配置
|
||||
'host' => '0.0.0.0', // 监听地址
|
||||
'port' => 2346, // 监听端口
|
||||
'root' => '', // WEB 根目录 默认会定位public目录
|
||||
'app_path' => '', // 应用目录 守护进程模式必须设置(绝对路径)
|
||||
'file_monitor' => false, // 是否开启PHP文件更改监控(调试模式下自动开启)
|
||||
'file_monitor_interval' => 2, // 文件监控检测时间间隔(秒)
|
||||
'file_monitor_path' => [], // 文件监控目录 默认监控application和config目录
|
||||
|
||||
// 支持workerman的所有配置参数
|
||||
'name' => 'thinkphp',
|
||||
'count' => 4,
|
||||
'daemonize' => false,
|
||||
'pidFile' => '',
|
||||
];
|
||||
55
config/worker_server.php
Normal file
55
config/worker_server.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2018 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | Workerman设置 仅对 php think worker:server 指令有效
|
||||
// +----------------------------------------------------------------------
|
||||
return [
|
||||
// 扩展自身需要的配置
|
||||
'protocol' => 'websocket', // 协议 支持 tcp udp unix http websocket text
|
||||
'host' => '127.0.0.1', // 监听地址
|
||||
'port' => 2345, // 监听端口
|
||||
'socket' => '', // 完整监听地址
|
||||
'context' => [], // socket 上下文选项
|
||||
'worker_class' => '', // 自定义Workerman服务类名 支持数组定义多个服务
|
||||
|
||||
// 支持workerman的所有配置参数
|
||||
'name' => 'thinkphp',
|
||||
'count' => 4,
|
||||
'daemonize' => false,
|
||||
'pidFile' => '',
|
||||
|
||||
// 支持事件回调
|
||||
// onWorkerStart
|
||||
'onWorkerStart' => function ($worker) {
|
||||
|
||||
},
|
||||
// onWorkerReload
|
||||
'onWorkerReload' => function ($worker) {
|
||||
|
||||
},
|
||||
// onConnect
|
||||
'onConnect' => function ($connection) {
|
||||
|
||||
},
|
||||
// onMessage
|
||||
'onMessage' => function ($connection, $data) {
|
||||
$connection->send('receive success');
|
||||
},
|
||||
// onClose
|
||||
'onClose' => function ($connection) {
|
||||
|
||||
},
|
||||
// onError
|
||||
'onError' => function ($connection, $code, $msg) {
|
||||
echo "error [ $code ] $msg\n";
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user