Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## 安装方式
Docker 安装 或 源码安装

## 问题描述
请描述遇到的问题..

## 运行环境
请复制 `php doctor.php` 运行结果

## 报错日志
日志目录:`storage/logs`
1 change: 0 additions & 1 deletion app/Http/Controllers/ConfigNotifyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use App\Models\ConfigNotify;
use App\Services\NotifyService;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;
use Illuminate\Validation\Rule;

class ConfigNotifyController extends Controller
Expand Down
87 changes: 87 additions & 0 deletions doctor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?php

error_reporting(0);
define('ROOT', dirname(__FILE__));
define('DIVIDER', str_repeat('-', 80)."\n");
$env = parse_ini_file(ROOT.'/.env', false, INI_SCANNER_RAW);

function console($item, $result, $err = '')
{
$bg = $err ? '41' : '42';
$result = "\e[{$bg}m\e[37m $result \e[0m\e[0m";
echo sprintf("%s:%s %s\n", $item, $result, $err);
}

echo "\n".DIVIDER."[ 环境检查 ]\n";

// PHP 版本
$err = version_compare(PHP_VERSION, '7.3.0', '>=') ? '' : 'PHP 版本需 >= 7.3.0';
console('PHP 版本', PHP_VERSION, $err);

// PDO 扩展
$pdo = class_exists('pdo');
$err = $pdo ? '' : '请先安装 PHP PDO 扩展';
console('PDO 扩展', $pdo ? '已安装' : '未安装', $err);

// Laravel 密钥
$err = $env['APP_KEY'] ? '' : '请执行命令 php artisan key:generate 生成密钥';
console('Laravel 密钥', $env['APP_KEY'] ? '已生成' : '未生成', $err);

// Storage 目录
$writable = is_writable(ROOT.'/storage');
$err = $writable ? '' : '请设置 storage 目录为可读写';
console('Storage 目录', $writable ? '可读写' : '不可读写', $err);

// Composer Package
$import = file_exists(ROOT.'/vendor/autoload.php');
$err = $import ? '' : '请安装 Composer 并执行 composer install 安装包';
console('Composer Package', $import ? '已导入' : '未导入', $err);

// MySQL 连接
try {
$err = '';
$dsn = "mysql:host={$env['DB_HOST']}:{$env['DB_PORT']};dbname={$env['DB_DATABASE']}";
$db = new PDO($dsn, $env['DB_USERNAME'], $env['DB_PASSWORD'], [PDO::ATTR_TIMEOUT => 3]);
} catch (Exception $e) {
$err = $e->getMessage();
}
console('MySQL 连接', $err ? '失败' : '成功', $err);

// MySQL 数据表
try {
if ($err) {
throw new Exception($err);
}
$err = '';
$tables = $db->query("show tables like 'code_leak'")->fetchAll(PDO::FETCH_ASSOC)[0];
if (!count($tables)) {
throw new Exception('请执行 php artisan migrate 导入数据表');
}
} catch (Exception $e) {
$err = $e->getMessage();
}
console('MySQL 数据表', $err ? '未导入' : '已导入', $err);

echo DIVIDER."[ 其他信息 ]\n";

// 码小六版本
$version = trim(file_get_contents(ROOT.'/version'));
echo "码小六版本:$version\n";

// 框架运行环境
$appEnv = $env['APP_ENV'] ?? '无';
echo "框架运行环境:$appEnv\n";

// 框架调试开关
$appDebug = $env['APP_DEBUG'] ?? '无';
echo "框架调试开关:$appDebug\n";

// PHP 禁用函数
$disFuns = get_cfg_var('disable_functions') ?: '无';
echo "PHP 禁用函数:$disFuns\n";

// PHP 已编译模块
$exts = implode(',', get_loaded_extensions());
echo "PHP 已编译模块:$exts\n";

echo DIVIDER."\n有任何问题和建议请联系-> https://github.com/4x99/code6/issues\n\n";
4 changes: 2 additions & 2 deletions resources/views/codeLeak/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
},
{
xtype: 'buttongroup',
baseCls: 'border:0',
baseCls: '',
width: 150,
items: [
{
Expand Down Expand Up @@ -300,7 +300,7 @@
xtype: 'widgetcolumn',
widget: {
xtype: 'buttongroup',
baseCls: 'border:0',
baseCls: '',
layout: {
type: 'hbox',
pack: 'center',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/configJob/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
xtype: 'widgetcolumn',
widget: {
xtype: 'buttongroup',
baseCls: 'border:0',
baseCls: '',
layout: {
type: 'hbox',
pack: 'center',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/configNotify/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
function createBtn(type) {
return {
xtype: 'buttongroup',
baseCls: 'border:0',
baseCls: '',
layout: {
type: 'hbox',
pack: 'end',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/configToken/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
xtype: 'widgetcolumn',
widget: {
xtype: 'buttongroup',
baseCls: 'border:0',
baseCls: '',
layout: {
type: 'hbox',
pack: 'center',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/configWhitelist/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
xtype: 'widgetcolumn',
widget: {
xtype: 'buttongroup',
baseCls: 'border:0',
baseCls: '',
layout: {
type: 'hbox',
pack: 'center',
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.6
1.5.7