This commit is contained in:
2019-06-19 22:41:40 +08:00
parent 5c31e8e612
commit d3eef9c5fd
34 changed files with 1464 additions and 107 deletions

View File

@@ -1 +1 @@
APP_DEBUG = true
APP_DEBUG = true

1
.gitignore vendored
View File

@@ -2,5 +2,4 @@
/.vscode
/vendor
*.log
thinkphp
.env

View File

@@ -3,6 +3,20 @@ ThinkPHP 6.0
> 运行环境要求PHP7.1+。
## 主要新特性
* 采用`PHP7`强类型(严格模式)
* 支持更多的`PSR`规范
* 原生多应用支持
* 更强大和易用的查询
* 全新的事件系统
* 模型事件和数据库事件统一纳入事件系统
* 模板引擎分离出核心
* 内部功能中间件化
* SESSION/Cookie机制改进
* 对Swoole以及协程支持改进
* 对IDE更加友好
* 统一和精简大量用法
## 安装
@@ -15,6 +29,10 @@ composer create-project topthink/think tp 6.0.*-dev
composer update topthink/framework
~~~
## 文档
[完全开发手册](https://www.kancloud.cn/manual/thinkphp6_0/content)
## 参与开发
请参阅 [ThinkPHP 核心框架包](https://github.com/top-think/framework)。

1
app/.htaccess Normal file
View File

@@ -0,0 +1 @@
deny from all

103
app/BaseController.php Normal file
View File

@@ -0,0 +1,103 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2019 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 app;
use think\App;
use think\exception\ValidateException;
use think\Validate;
/**
* 控制器基础类
*/
abstract class BaseController
{
/**
* Request实例
* @var \think\Request
*/
protected $request;
/**
* 应用实例
* @var \think\App
*/
protected $app;
/**
* 是否批量验证
* @var bool
*/
protected $batchValidate = false;
/**
* 控制器中间件
* @var array
*/
protected $middleware = [];
/**
* 构造方法
* @access public
* @param App $app 应用对象
*/
public function __construct(App $app)
{
$this->app = $app;
$this->request = $this->app->request;
// 控制器初始化
$this->initialize();
}
// 初始化
protected function initialize()
{}
/**
* 验证数据
* @access protected
* @param array $data 数据
* @param string|array $validate 验证器名或者验证规则数组
* @param array $message 提示信息
* @param bool $batch 是否批量验证
* @return array|string|true
* @throws ValidateException
*/
protected function validate(array $data, $validate, array $message = [], bool $batch = false)
{
if (is_array($validate)) {
$v = new Validate();
$v->rule($validate);
} else {
if (strpos($validate, '.')) {
// 支持场景
list($validate, $scene) = explode('.', $validate);
}
$class = false !== strpos($validate, '\\') ? $validate : $this->app->parseClass('validate', $validate);
$v = new $class();
if (!empty($scene)) {
$v->scene($scene);
}
}
$v->message($message);
// 是否批量验证
if ($batch || $this->batchValidate) {
$v->batch(true);
}
return $v->failException(true)->check($data);
}
}

68
app/ExceptionHandle.php Normal file
View File

@@ -0,0 +1,68 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2019 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
namespace app;
use think\db\exception\DataNotFoundException;
use think\db\exception\ModelNotFoundException;
use think\exception\Handle;
use think\exception\HttpException;
use think\exception\HttpResponseException;
use think\exception\ValidateException;
use think\Response;
use Throwable;
/**
* 应用异常处理类
*/
class ExceptionHandle extends Handle
{
/**
* 不需要记录信息(日志)的异常类列表
* @var array
*/
protected $ignoreReport = [
HttpException::class,
HttpResponseException::class,
ModelNotFoundException::class,
DataNotFoundException::class,
ValidateException::class,
];
/**
* 记录异常信息(包括日志或者其它方式记录)
*
* @access public
* @param Throwable $exception
* @return void
*/
public function report(Throwable $exception): void
{
// 使用内置的方式记录异常日志
parent::report($exception);
}
/**
* Render an exception into an HTTP response.
*
* @access public
* @param \think\Request $request
* @param Throwable $e
* @return Response
*/
public function render($request, Throwable $e): Response
{
// 添加自定义异常处理机制
// 其他错误交给系统处理
return parent::render($request, $e);
}
}

17
app/Request.php Normal file
View File

@@ -0,0 +1,17 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2019 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
namespace app;
class Request extends \think\Request
{
}

View File

@@ -0,0 +1,38 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\BaseController;
use think\facade\View;
/**
* @title 后台基类
*/
class Base extends BaseController {
public $data = array();
public $meta = array();
/**
* @title 显示类
*/
public function fetch($template){
// 使用内置PHP模板引擎渲染模板输出
$config = array(
'tpl_replace_string' => array(
'__static__' => '/static',
'__img__' => '/static/admin/images',
'__css__' => '/static/admin/css',
'__js__' => '/static/admin/js',
'__public__' => '/static/admin',
)
);
return View::config($config)->assign($this->data)->fetch($template);
}
}

View File

@@ -0,0 +1,25 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace app\admin\controller;
/**
* @title 后端公共模块
*/
class Index extends Base {
/**
* @title 系统首页
*/
public function index(){
$this->data['data'] = array(
'info' => 'ddd'
);
return $this->fetch('', $this->data, $this->meta);
}
}

View File

@@ -0,0 +1,18 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace app\admin\middleware;
/**
* @title 后台中间件
*/
class Admin {
public function handle($request, \Closure $next) {
}
}

View File

@@ -0,0 +1,871 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/>
<meta charset="utf-8">
<title>SentCMS后台管理系统</title>
<link href="__static__/libs/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
<link href="__static__/libs/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="__static__/libs/nanoscroller/nanoscroller.css" />
<link href="__css__/theme_styles.css" rel="stylesheet"/>
</meta>
</head>
<body>
<div id="theme-wrapper">
<header class="navbar" id="header-navbar">
<div class="container">
<a class="navbar-brand" href="index.html" id="logo">
<img alt="" class="normal-logo logo-white" src="__static__/images/logo.png"/>
<img alt="" class="normal-logo logo-black" src="__static__/images/logo.png"/>
<img alt="" class="small-logo hidden-xs hidden-sm hidden" src="__static__/images/logo.png"/>
</a>
<div class="clearfix">
<button class="navbar-toggle" data-target=".navbar-ex1-collapse" data-toggle="collapse" type="button">
<span class="sr-only">菜单</span>
<span class="fa fa-bars">
</span>
</button>
<div class="nav-no-collapse navbar-left pull-left hidden-sm hidden-xs">
<ul class="nav navbar-nav pull-left">
<li>
<a class="btn" id="make-small-nav">
<i class="fa fa-bars">
</i>
</a>
</li>
<li class="dropdown hidden-xs">
<a class="btn dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-bell">
</i>
<span class="count">
8
</span>
</a>
<ul class="dropdown-menu notifications-list">
<li class="pointer">
<div class="pointer-inner">
<div class="arrow">
</div>
</div>
</li>
<li class="item-header">
You have 6 new notifications
</li>
<li class="item">
<a href="#">
<i class="fa fa-comment">
</i>
<span class="content">
New comment on Awesome P...
</span>
<span class="time">
<i class="fa fa-clock-o">
</i>
13 min.
</span>
</a>
</li>
<li class="item">
<a href="#">
<i class="fa fa-plus">
</i>
<span class="content">
New user registration
</span>
<span class="time">
<i class="fa fa-clock-o">
</i>
13 min.
</span>
</a>
</li>
<li class="item">
<a href="#">
<i class="fa fa-envelope">
</i>
<span class="content">
New Message from George
</span>
<span class="time">
<i class="fa fa-clock-o">
</i>
13 min.
</span>
</a>
</li>
<li class="item">
<a href="#">
<i class="fa fa-shopping-cart">
</i>
<span class="content">
New purchase
</span>
<span class="time">
<i class="fa fa-clock-o">
</i>
13 min.
</span>
</a>
</li>
<li class="item">
<a href="#">
<i class="fa fa-eye">
</i>
<span class="content">
New order
</span>
<span class="time">
<i class="fa fa-clock-o">
</i>
13 min.
</span>
</a>
</li>
<li class="item-footer">
<a href="#">
View all notifications
</a>
</li>
</ul>
</li>
<li class="dropdown hidden-xs">
<a class="btn dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-envelope-o">
</i>
<span class="count">
16
</span>
</a>
<ul class="dropdown-menu notifications-list messages-list">
<li class="pointer">
<div class="pointer-inner">
<div class="arrow">
</div>
</div>
</li>
<li class="item first-item">
<a href="#">
<img alt="" src="__img__/samples/messages-photo-1.png"/>
<span class="content">
<span class="content-headline">
George Clooney
</span>
<span class="content-text">
Look, just because I don't be givin' no man a foot massage don't make it
right for Marsellus to throw...
</span>
</span>
<span class="time">
<i class="fa fa-clock-o">
</i>
13 min.
</span>
</a>
</li>
<li class="item">
<a href="#">
<img alt="" src="__img__/samples/messages-photo-2.png"/>
<span class="content">
<span class="content-headline">
Emma Watson
</span>
<span class="content-text">
Look, just because I don't be givin' no man a foot massage don't make it
right for Marsellus to throw...
</span>
</span>
<span class="time">
<i class="fa fa-clock-o">
</i>
13 min.
</span>
</a>
</li>
<li class="item">
<a href="#">
<img alt="" src="__img__/samples/messages-photo-3.png"/>
<span class="content">
<span class="content-headline">
Robert Downey Jr.
</span>
<span class="content-text">
Look, just because I don't be givin' no man a foot massage don't make it
right for Marsellus to throw...
</span>
</span>
<span class="time">
<i class="fa fa-clock-o">
</i>
13 min.
</span>
</a>
</li>
<li class="item-footer">
<a href="#">
View all messages
</a>
</li>
</ul>
</li>
<li class="dropdown hidden-xs">
<a class="btn dropdown-toggle" data-toggle="dropdown">
New Item
<i class="fa fa-caret-down">
</i>
</a>
<ul class="dropdown-menu">
<li class="item">
<a href="#">
<i class="fa fa-archive">
</i>
New Product
</a>
</li>
<li class="item">
<a href="#">
<i class="fa fa-shopping-cart">
</i>
New Order
</a>
</li>
<li class="item">
<a href="#">
<i class="fa fa-sitemap">
</i>
New Category
</a>
</li>
<li class="item">
<a href="#">
<i class="fa fa-file-text">
</i>
New Page
</a>
</li>
</ul>
</li>
<li class="dropdown hidden-xs">
<a class="btn dropdown-toggle" data-toggle="dropdown">
English
<i class="fa fa-caret-down">
</i>
</a>
<ul class="dropdown-menu">
<li class="item">
<a href="#">
Spanish
</a>
</li>
<li class="item">
<a href="#">
German
</a>
</li>
<li class="item">
<a href="#">
Italian
</a>
</li>
</ul>
</li>
</ul>
</div>
<div class="nav-no-collapse pull-right" id="header-nav">
<ul class="nav navbar-nav pull-right">
<li class="mobile-search">
<a class="btn">
<i class="fa fa-search">
</i>
</a>
<div class="drowdown-search">
<form role="search">
<div class="form-group">
<input class="form-control" placeholder="Search..." type="text">
<i class="fa fa-search nav-search-icon">
</i>
</input>
</div>
</form>
</div>
</li>
<li class="dropdown profile-dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<img alt="" src="__img__/samples/scarlet-159.png"/>
<span class="hidden-xs">
Scarlett Johansson
</span>
<b class="caret">
</b>
</a>
<ul class="dropdown-menu dropdown-menu-right">
<li>
<a href="user-profile.html">
<i class="fa fa-user">
</i>
Profile
</a>
</li>
<li>
<a href="#">
<i class="fa fa-cog">
</i>
Settings
</a>
</li>
<li>
<a href="#">
<i class="fa fa-envelope-o">
</i>
Messages
</a>
</li>
<li>
<a href="#">
<i class="fa fa-power-off">
</i>
Logout
</a>
</li>
</ul>
</li>
<li class="hidden-xxs">
<a class="btn">
<i class="fa fa-power-off">
</i>
</a>
</li>
</ul>
</div>
</div>
</div>
</header>
<div class="container" id="page-wrapper">
<div class="row">
<div id="nav-col">
<section class="col-left-nano" id="col-left">
<div class="col-left-nano-content" id="col-left-inner">
<div class="clearfix hidden-sm hidden-xs dropdown profile2-dropdown" id="user-left-box">
<img alt="" src="__img__/samples/scarlet-159.png"/>
<div class="user-box">
<span class="name">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
Scarlett J.
<i class="fa fa-angle-down">
</i>
</a>
<ul class="dropdown-menu">
<li>
<a href="user-profile.html">
<i class="fa fa-user">
</i>
Profile
</a>
</li>
<li>
<a href="#">
<i class="fa fa-cog">
</i>
Settings
</a>
</li>
<li>
<a href="#">
<i class="fa fa-envelope-o">
</i>
Messages
</a>
</li>
<li>
<a href="#">
<i class="fa fa-power-off">
</i>
Logout
</a>
</li>
</ul>
</span>
<span class="status">
<i class="fa fa-circle">
</i>
Online
</span>
</div>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse" id="sidebar-nav">
<ul class="nav nav-pills nav-stacked">
<li class="nav-header nav-header-first hidden-sm hidden-xs">
Navigation
</li>
<li class="active">
<a href="index.html">
<i class="fa fa-dashboard">
</i>
<span>
Dashboard
</span>
<span class="label label-primary label-circle pull-right">
28
</span>
</a>
</li>
<li>
<a class="dropdown-toggle" href="#">
<i class="fa fa-table">
</i>
<span>
Tables
</span>
<i class="fa fa-angle-right drop-icon">
</i>
</a>
<ul class="submenu">
<li>
<a href="tables.html">
Simple
</a>
</li>
<li>
<a href="tables-advanced.html">
Advanced
</a>
</li>
<li>
<a href="users.html">
Users
</a>
</li>
<li>
<a href="tables-footables.html">
FooTables
</a>
</li>
</ul>
</li>
<li>
<a class="dropdown-toggle" href="#">
<i class="fa fa-envelope">
</i>
<span>
Email
</span>
<i class="fa fa-angle-right drop-icon">
</i>
</a>
<ul class="submenu">
<li>
<a href="email-inbox.html">
Inbox
</a>
</li>
<li>
<a href="email-detail.html">
Detail
</a>
</li>
<li>
<a href="email-compose.html">
Compose
</a>
</li>
</ul>
</li>
<li>
<a class="dropdown-toggle" href="#">
<i class="fa fa-bar-chart-o">
</i>
<span>
Graphs
</span>
<i class="fa fa-angle-right drop-icon">
</i>
</a>
<ul class="submenu">
<li>
<a href="graphs-morris.html">
Morris & Mixed
</a>
</li>
<li>
<a href="graphs-flot.html">
Flot
</a>
</li>
<li>
<a href="graphs-dygraphs.html">
Dygraphs
</a>
</li>
<li>
<a href="graphs-xcharts.html">
xCharts
</a>
</li>
</ul>
</li>
<li>
<a href="widgets.html">
<i class="fa fa-th-large">
</i>
<span>
Widgets
</span>
<span class="label label-success pull-right">
New
</span>
</a>
</li>
<li>
<a class="dropdown-toggle" href="#">
<i class="fa fa-copy">
</i>
<span>
Pages
</span>
<i class="fa fa-angle-right drop-icon">
</i>
</a>
<ul class="submenu">
<li>
<a href="calendar.html">
Calendar
</a>
</li>
<li>
<a href="gallery.html">
Gallery
</a>
</li>
<li>
<a href="gallery-v2.html">
Gallery v2
</a>
</li>
<li>
<a href="pricing.html">
Pricing
</a>
</li>
<li>
<a href="projects.html">
Projects
</a>
</li>
<li>
<a href="team-members.html">
Team Members
</a>
</li>
<li>
<a href="timeline.html">
Timeline
</a>
</li>
<li>
<a href="timeline-grid.html">
Timeline Grid
</a>
</li>
<li>
<a href="user-profile.html">
User Profile
</a>
</li>
<li>
<a href="search.html">
Search Results
</a>
</li>
<li>
<a href="invoice.html">
Invoice
</a>
</li>
<li>
<a href="intro.html">
Tour Layout
</a>
</li>
</ul>
</li>
<li class="nav-header hidden-sm hidden-xs">
Components
</li>
<li>
<a class="dropdown-toggle" href="#">
<i class="fa fa-edit">
</i>
<span>
Forms
</span>
<i class="fa fa-angle-right drop-icon">
</i>
</a>
<ul class="submenu">
<li>
<a href="form-elements.html">
Elements
</a>
</li>
<li>
<a href="x-editable.html">
X-Editable
</a>
</li>
<li>
<a href="form-wizard.html">
Wizard
</a>
</li>
<li>
<a href="form-wizard-popup.html">
Wizard popup
</a>
</li>
<li>
<a href="form-wysiwyg.html">
WYSIWYG
</a>
</li>
<li>
<a href="form-summernote.html">
WYSIWYG Summernote
</a>
</li>
<li>
<a href="form-ckeditor.html">
WYSIWYG CKEditor
</a>
</li>
<li>
<a href="form-dropzone.html">
Multiple File Upload
</a>
</li>
</ul>
</li>
<li>
<a class="dropdown-toggle" href="#">
<i class="fa fa-desktop">
</i>
<span>
UI Kit
</span>
<i class="fa fa-angle-right drop-icon">
</i>
</a>
<ul class="submenu">
<li>
<a href="ui-elements.html">
Elements
</a>
</li>
<li>
<a href="notifications.html">
Notifications & Alerts
</a>
</li>
<li>
<a href="modals.html">
Modals
</a>
</li>
<li>
<a href="video.html">
Video
</a>
</li>
<li>
<a class="dropdown-toggle" href="#">
Icons
<i class="fa fa-angle-right drop-icon">
</i>
</a>
<ul class="submenu">
<li>
<a href="icons-awesome.html">
Awesome Icons
</a>
</li>
<li>
<a href="icons-halflings.html">
Halflings Icons
</a>
</li>
</ul>
</li>
<li>
<a href="ui-nestable.html">
Nestable List
</a>
</li>
<li>
<a href="typography.html">
Typography
</a>
</li>
<li>
<a class="dropdown-toggle" href="#">
3 Level Menu
<i class="fa fa-angle-right drop-icon">
</i>
</a>
<ul class="submenu">
<li>
<a href="#">
3rd Level
</a>
</li>
<li>
<a href="#">
3rd Level
</a>
</li>
<li>
<a href="#">
3rd Level
</a>
</li>
</ul>
</li>
</ul>
</li>
<li>
<a href="maps.html">
<i class="fa fa-map-marker">
</i>
<span>
Google Maps
</span>
<span class="label label-danger pull-right">
Updated
</span>
</a>
</li>
<li>
<a class="dropdown-toggle" href="#">
<i class="fa fa-file-text-o">
</i>
<span>
Extra pages
</span>
<i class="fa fa-angle-right drop-icon">
</i>
</a>
<ul class="submenu">
<li>
<a href="faq.html">
FAQ
</a>
</li>
<li>
<a href="emails.html">
Email Templates
</a>
</li>
<li>
<a href="login.html">
Login
</a>
</li>
<li>
<a href="login-full.html">
Login Full
</a>
</li>
<li>
<a href="registration.html">
Registration
</a>
</li>
<li>
<a href="registration-full.html">
Registration Full
</a>
</li>
<li>
<a href="forgot-password.html">
Forgot Password
</a>
</li>
<li>
<a href="forgot-password-full.html">
Forgot Password Full
</a>
</li>
<li>
<a href="lock-screen.html">
Lock Screen
</a>
</li>
<li>
<a href="lock-screen-full.html">
Lock Screen Full
</a>
</li>
<li>
<a href="error-404.html">
Error 404
</a>
</li>
<li>
<a href="error-404-v2.html">
Error 404 Nested
</a>
</li>
<li>
<a href="error-500.html">
Error 500
</a>
</li>
<li>
<a href="extra-grid.html">
Grid
</a>
</li>
</ul>
</li>
<li>
<a href="/angularjs">
<i class="fa fa-google">
</i>
<span>
AngularJS Demo
</span>
</a>
</li>
</ul>
</div>
</div>
</section>
<div id="nav-col-submenu">
</div>
</div>
<div id="content-wrapper">
<div class="row">
<div class="col-lg-12">
</div>
</div>
<footer class="row" id="footer-bar">
<p class="col-xs-12" id="footer-copyright">
Powered by Cube Theme.
</p>
</footer>
</div>
</div>
</div>
</div>
{include file="setting"}
<script src="__js__/skin-changer.js"></script>
<script src="__static__/libs/jquery/jquery.min.js"></script>
<script src="__static__/libs/bootstrap/js/bootstrap.min.js"></script>
<script src="__static__/libs/nanoscroller/jquery.nanoscroller.min.js"></script>
<script type="text/javascript" src="__js__/app.js"></script>
<script>
$(document).ready(function() {
})
</script>
</body>
</html>

View File

@@ -0,0 +1,74 @@
<div class="closed" id="config-tool">
<a id="config-tool-cog"><i class="fa fa-cog"></i></a>
<div id="config-tool-options">
<h4>布局选项</h4>
<ul>
<li>
<div class="checkbox-nice">
<input id="config-fixed-header" type="checkbox"/>
<label for="config-fixed-header">固定头部</label>
</div>
</li>
<li>
<div class="checkbox-nice">
<input id="config-fixed-sidebar" type="checkbox"/>
<label for="config-fixed-sidebar">固定左侧菜单</label>
</div>
</li>
<li>
<div class="checkbox-nice">
<input id="config-fixed-footer" type="checkbox"/>
<label for="config-fixed-footer">固定底部</label>
</div>
</li>
<li>
<div class="checkbox-nice">
<input id="config-boxed-layout" type="checkbox"/>
<label for="config-boxed-layout">盒式布局</label>
</div>
</li>
<!-- <li>
<div class="checkbox-nice">
<input id="config-rtl-layout" type="checkbox"/>
<label for="config-rtl-layout">左右翻转</label>
</div>
</li> -->
</ul>
<br/>
<h4>主题颜色</h4>
<ul class="clearfix" id="skin-colors">
<li>
<a class="skin-changer" data-skin="" data-toggle="tooltip" style="background-color: #34495e;" title="Default">
</a>
</li>
<li>
<a class="skin-changer" data-skin="theme-white" data-toggle="tooltip" style="background-color: #2ecc71;" title="White/Green">
</a>
</li>
<li>
<a class="skin-changer blue-gradient" data-skin="theme-blue-gradient" data-toggle="tooltip" title="Gradient">
</a>
</li>
<li>
<a class="skin-changer" data-skin="theme-turquoise" data-toggle="tooltip" style="background-color: #1abc9c;" title="Green Sea">
</a>
</li>
<li>
<a class="skin-changer" data-skin="theme-amethyst" data-toggle="tooltip" style="background-color: #9b59b6;" title="Amethyst">
</a>
</li>
<li>
<a class="skin-changer" data-skin="theme-blue" data-toggle="tooltip" style="background-color: #2980b9;" title="Blue">
</a>
</li>
<li>
<a class="skin-changer" data-skin="theme-red" data-toggle="tooltip" style="background-color: #e74c3c;" title="Red">
</a>
</li>
<li>
<a class="skin-changer" data-skin="theme-whbl" data-toggle="tooltip" style="background-color: #3498db;" title="White/Blue">
</a>
</li>
</ul>
</div>
</div>

12
app/common.php Normal file
View File

@@ -0,0 +1,12 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------
// 应用公共文件

27
app/event.php Normal file
View File

@@ -0,0 +1,27 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// 事件定义文件
return [
'bind' => [
],
'listen' => [
'AppInit' => [],
'HttpRun' => [],
'HttpEnd' => [],
'LogLevel' => [],
'LogWrite' => [],
],
'subscribe' => [
],
];

View File

@@ -0,0 +1,17 @@
<?php
namespace app\index\controller;
use app\BaseController;
class Index extends BaseController
{
public function index()
{
return '<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} a{color:#2E5CD5;cursor: pointer;text-decoration: none} a:hover{text-decoration:underline; } body{ background: #fff; font-family: "Century Gothic","Microsoft yahei"; color: #333;font-size:18px;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.6em; font-size: 42px }</style><div style="padding: 24px 48px;"> <h1>:) </h1><p> ThinkPHP V6<br/><span style="font-size:30px">13载初心不改 - 你值得信赖的PHP框架</span></p></div><script type="text/javascript" src="https://tajs.qq.com/stats?sId=64890268" charset="UTF-8"></script><script type="text/javascript" src="https://e.topthink.com/Public/static/client.js"></script><think id="eab4b9f840753f8e7"></think>';
}
public function hello($name = 'ThinkPHP6')
{
return 'hello,' . $name;
}
}

12
app/middleware.php Normal file
View File

@@ -0,0 +1,12 @@
<?php
return [
// 全局请求缓存
// \think\middleware\CheckRequestCache::class,
// 多语言加载
// \think\middleware\LoadLangPack::class,
// Session初始化
// \think\middleware\SessionInit::class,
// 页面Trace调试
// \think\middleware\TraceDebug::class,
];

19
app/provider.php Normal file
View File

@@ -0,0 +1,19 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2019 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use app\ExceptionHandle;
use app\Request;
// 容器Provider定义文件
return [
'think\Request' => Request::class,
'think\exception\Handle' => ExceptionHandle::class,
];

26
build.example.php Normal file
View File

@@ -0,0 +1,26 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
/**
* php think build 自动生成应用的目录结构的定义示例
*/
return [
// 需要自动创建的文件
'__file__' => [],
// 需要自动创建的目录
'__dir__' => ['controller', 'model', 'view'],
// 需要自动创建的控制器
'controller' => ['Index'],
// 需要自动创建的模型
'model' => ['User'],
// 需要自动创建的模板
'view' => ['index/index'],
];

View File

@@ -18,7 +18,8 @@
"require": {
"php": ">=7.1.0",
"topthink/framework": "6.0.*-dev",
"topthink/think-view": "^1.0"
"topthink/think-view": "^1.0",
"symfony/var-dumper":"^4.2"
},
"autoload": {
"psr-4": {

View File

@@ -17,39 +17,31 @@ use think\facade\Env;
return [
// 应用地址
'app_host' => Env::get('app.host', ''),
// 应用Trace环境变量优先读取
'app_trace' => true,
'app_host' => Env::get('app.host', ''),
// 应用的命名空间
'app_namespace' => '',
'app_namespace' => '',
// 是否启用路由
'with_route' => true,
'with_route' => true,
// 是否启用事件
'with_event' => true,
'with_event' => true,
// 自动多应用模式
'auto_multi_app' => true,
'auto_multi_app' => true,
// 应用映射(自动多应用模式有效)
'app_map' => [],
'app_map' => [],
// 域名绑定(自动多应用模式有效)
'domain_bind' => [],
'domain_bind' => [],
// 禁止URL访问的应用列表自动多应用模式有效
'deny_app_list' => [],
'deny_app_list' => [],
// 默认应用
'default_app' => 'index',
'default_app' => 'index',
// 默认时区
'default_timezone' => 'Asia/Shanghai',
// 默认验证器
'default_validate' => '',
// 默认跳转页面对应的模板文件
'dispatch_success_tmpl' => app()->getThinkPath() . 'tpl/dispatch_jump.tpl',
'dispatch_error_tmpl' => app()->getThinkPath() . 'tpl/dispatch_jump.tpl',
'default_timezone' => 'Asia/Shanghai',
// 异常页面的模板文件
'exception_tmpl' => app()->getThinkPath() . 'tpl/think_exception.tpl',
'exception_tmpl' => app()->getThinkPath() . 'tpl/think_exception.tpl',
// 错误显示信息,非调试模式有效
'error_message' => '页面错误!请稍后再试~',
'error_message' => '页面错误!请稍后再试~',
// 显示错误信息
'show_error_msg' => false,
'show_error_msg' => false,
];

View File

@@ -8,18 +8,32 @@
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Env;
// +----------------------------------------------------------------------
// | 缓存设置
// +----------------------------------------------------------------------
return [
// 驱动方式
'type' => 'File',
// 缓存保存目录
'path' => '',
// 缓存前缀
'prefix' => '',
// 缓存有效期 0表示永久缓存
'expire' => 0,
// 默认缓存驱动
'default' => Env::get('cache.driver', 'file'),
// 缓存连接方式配置
'stores' => [
'file' => [
// 驱动方式
'type' => 'File',
// 缓存保存目录
'path' => '',
// 缓存前缀
'prefix' => '',
// 缓存有效期 0表示永久缓存
'expire' => 0,
// 缓存标签前缀
'tag_prefix' => 'tag:',
// 序列化机制 例如 ['serialize', 'unserialize']
'serialize' => [],
],
// 更多的缓存连接
],
];

View File

@@ -12,52 +12,58 @@
use think\facade\Env;
return [
// 数据库类型
'type' => Env::get('database.type', 'mysql'),
// 服务器地址
'hostname' => Env::get('database.hostname', '127.0.0.1'),
// 数据库名
'database' => Env::get('database.database', ''),
// 用户名
'username' => Env::get('database.username', 'root'),
// 密码
'password' => Env::get('database.password', ''),
// 端口
'hostport' => Env::get('database.hostport', '3306'),
// 连接dsn
'dsn' => '',
// 数据库连接参数
'params' => [],
// 数据库编码默认采用utf8
'charset' => Env::get('database.charset', 'utf8'),
// 数据库表前缀
'prefix' => Env::get('database.prefix', ''),
// 数据库调试模式
'debug' => Env::get('database.debug', true),
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
'deploy' => 0,
// 数据库读写是否分离 主从式有效
'rw_separate' => false,
// 读写分离后 主服务器数量
'master_num' => 1,
// 指定从服务器序号
'slave_no' => '',
// 是否严格检查字段是否存在
'fields_strict' => true,
// 数据集返回类型
'resultset_type' => 'array',
// 默认使用的数据库连接配置
'default' => Env::get('database.driver', 'mysql'),
// 数据库连接配置信息
'connections' => [
'mysql' => [
// 数据库类型
'type' => Env::get('database.type', 'mysql'),
// 服务器地址
'hostname' => Env::get('database.hostname', '127.0.0.1'),
// 数据库名
'database' => Env::get('database.database', ''),
// 用户名
'username' => Env::get('database.username', 'root'),
// 密码
'password' => Env::get('database.password', ''),
// 端口
'hostport' => Env::get('database.hostport', '3306'),
// 连接dsn
'dsn' => '',
// 数据库连接参数
'params' => [],
// 数据库编码默认采用utf8
'charset' => Env::get('database.charset', 'utf8'),
// 数据库表前缀
'prefix' => Env::get('database.prefix', ''),
// 数据库调试模式
'debug' => Env::get('database.debug', true),
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
'deploy' => 0,
// 数据库读写是否分离 主从式有效
'rw_separate' => false,
// 读写分离后 主服务器数量
'master_num' => 1,
// 指定从服务器序号
'slave_no' => '',
// 是否严格检查字段是否存在
'fields_strict' => true,
// 是否需要进行SQL性能分析
'sql_explain' => false,
// Builder类
'builder' => '',
// Query类
'query' => '',
// 是否需要断线重连
'break_reconnect' => false,
],
// 更多的数据库配置信息
],
// 自动写入时间戳字段
'auto_timestamp' => false,
'auto_timestamp' => 'timestamp',
// 时间字段取出后的默认时间格式
'datetime_format' => 'Y-m-d H:i:s',
// 是否需要进行SQL性能分析
'sql_explain' => false,
// Builder类
'builder' => '',
// Query类
'query' => '\\think\\db\\Query',
// 是否需要断线重连
'break_reconnect' => false,
// 断线标识字符串
'break_match_str' => [],
];

20
config/filesystem.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
use think\facade\Env;
return [
'default' => Env::get('filesystem.driver', 'local'),
'disks' => [
'local' => [
'driver' => 'local',
'root' => app()->getRuntimePath() . 'storage',
],
'public' => [
'driver' => 'local',
'root' => app()->getRootPath() . 'public/storage',
'url' => '/storage',
'visibility' => 'public',
],
// 更多的磁盘配置信息
],
];

View File

@@ -20,8 +20,6 @@ return [
'default_lang' => Env::get('lang.default_lang', 'zh-cn'),
// 允许的语言列表
'allow_lang_list' => [],
// 是否开启自动侦测
'auto_detect' => false,
// 多语言自动侦测变量名
'detect_var' => 'lang',
// 是否使用Cookie记录
@@ -34,4 +32,6 @@ return [
'accept_language' => [
'zh-hans-cn' => 'zh-cn',
],
// 是否支持语言分组
'allow_group' => false,
];

View File

@@ -14,14 +14,8 @@
// +----------------------------------------------------------------------
return [
// PATHINFO变量名 用于兼容模式
'var_pathinfo' => 's',
// 兼容PATH_INFO获取
'pathinfo_fetch' => ['ORIG_PATH_INFO', 'REDIRECT_PATH_INFO', 'REDIRECT_URL'],
// pathinfo分隔符
'pathinfo_depr' => '/',
// HTTPS代理标识
'https_agent_name' => '',
// URL伪静态后缀
'url_html_suffix' => 'html',
// URL普通方式参数 用于自动生成
@@ -50,16 +44,8 @@ return [
'controller_suffix' => false,
// 默认的路由变量规则
'default_route_pattern' => '[\w\.]+',
// 域名根如thinkphp.cn
'url_domain_root' => '',
// 是否自动转换URL中的控制器和操作名
'url_convert' => true,
// 表单请求类型伪装变量
'var_method' => '_method',
// 表单ajax伪装变量
'var_ajax' => '_ajax',
// 表单pjax伪装变量
'var_pjax' => '_pjax',
// 是否开启请求缓存 true自动缓存 支持设置请求缓存规则
'request_cache' => false,
// 请求缓存有效期

View File

@@ -19,9 +19,9 @@ return [
// SESSION_ID的提交变量,解决flash上传跨域
'var_session_id' => '',
// 驱动方式 支持file redis memcache memcached
'type' => '',
// 是否自动开启 SESSION
'auto_start' => true,
'type' => 'file',
// 过期时间
'expire' => 0,
// 前缀
'prefix' => '',
];

View File

@@ -10,9 +10,9 @@
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | Trace设置 开启 app_trace 后 有效
// | Trace设置 开启调试模式后有效
// +----------------------------------------------------------------------
return [
// 内置Html Console 支持扩展
// 内置Html 支持扩展
'type' => 'Html',
];

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -12,15 +12,6 @@
// [ 应用入口文件 ]
namespace think;
// 定义应用目录
define('BASE_PATH', substr($_SERVER['SCRIPT_NAME'], 0, -10));
/**
* 缓存目录设置
* 此目录必须可写建议移动到非WEB目录
*/
define ( 'RUNTIME_PATH', __DIR__ . '/../data/' );
require __DIR__ . '/../vendor/autoload.php';
// 执行HTTP应用并响应

2
runtime/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore