php mysql练手_ThinkPHP5练手Demo实战
最近有個朋友有個小需求,剛好有時間,也剛好準備研究一下tp5,聽說tp5規范了,而且更傻瓜化了。
便做了這個論壇的小Demo,開源出來玩玩,改天做兩個模版。說句實話,TP5模型層,數據庫層真的很好用
Env Docker
docker大家肯定已經熟悉不過了
環境: Redis3.1+PHP5.6-fpm+Nginx+Mysql5.7
項目地址
演示站點
Usage
2.docker-compose up --build -d
第一次需要手動導入測試數據
導入默認的測試數據
$ docker network ls
$ docker run -it --link mysql-db:mysql --network client101vbbs_default -v `pwd`/data/backup:/data/backup:ro --rm mysql:5.7 sh -c 'exec mysql -h"mysql" -P"3306" -uroot -p"zhaojun" oeynet_client_bbs<.>
Docker Containers
composer 臨時容器,安裝composer包
bower 臨時容器,安裝前端包、
下面就是nmp環境而已了
nginx
php-fpm
mysql-db
redis
項目依賴
Bower
{
"name": "101-bbs-front",
"version": "1.0.0",
"keywords": [
"101v BBs"
],
"main": "app.js",
"dependencies": {
"jquery": "^3.2.1",
"vue": "^2.3.4",
"bootstrap": "^3.3.7",
"requirejs": "^2.3.3",
"require-css": "^0.1.10",
"axios": "^0.16.2",
"layer": "^3.0.3",
"wangEditor": "^3.0.3",
"animate.css": "^3.5.2"
}
}
Composer
{
"name": "oeynet/simple-bbs",
"description": "new simple bbs",
"type": "project",
"keywords": [
"bbs",
"forum",
"project"
],
"homepage": "http://bbs.oeynet.com/",
"license": "Apache-2.0",
"authors": [
{
"name": "zhaojunlike",
"email": "zhaojunlike@gmail.com"
}
],
"require": {
"php": ">=5.4.0",
"topthink/framework": "^5.0.6",
"topthink/think-captcha": "^1.0",
"topthink/think-testing": "^1.0",
"bluem/tree": "^1.5",
"oeynet/helper": "^0.1",
"oeynet/add-captcha": "^0.2.0",
"voku/anti-xss": "^2.1"
},
"autoload": {
"psr-4": {
"tests\\": "tests"
},
"files": [
]
},
"extra": {
"think-path": "thinkphp"
},
"config": {
"preferred-install": "dist"
},
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.phpcomposer.com"
}
}
}
Tp5踩過的坑
1.模型關聯
2.模型驗證,控制器驗證
3.動態屬性
4.view層大小寫(以為控制器對應視圖層大小寫都規范,最后view全部都換小寫了,不然會在linux部署報錯)
Demo演示
Screenshots
首頁
首頁我的附件
內容管理
用戶管理和小黑屋
系統統計和配置
RBAC權限用戶組
總結
以上是生活随笔為你收集整理的php mysql练手_ThinkPHP5练手Demo实战的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java 大流量高并发_【BAT面试题】
- 下一篇: gridview不显示bit_色彩要求高