Yêu cầu & cài đặt
Yêu cầu hệ thống
- PHP: 8.0+ (khuyến nghị dùng bản mới trong nhánh 8.x)
- Composer: để cài dependencies và autoload
- Web server: Apache/Nginx hoặc PHP built-in server
- Extensions:
openssl,pdo,mbstring,sockets(xemcomposer.json)
Cài đặt (từ source)
git clone https://github.com/datahihi1/DLight.git my-project
cd my-project
composer install
Lưu ý về file .env
DLight có script Composer tự copy .env.test thành .env nếu bạn chưa có (post-install).
Bạn chỉnh lại các biến như APP_NAME, APP_TIMEZONE, APP_DEBUG… theo môi trường.
Chạy ứng dụng
Cách 1: DLI (khuyến nghị theo README)
php dli -s
Sau đó mở trình duyệt tới http://localhost:8000 (theo output của lệnh).
Cách 2: Web server trỏ vào public/
- DocumentRoot: trỏ vào thư mục
public/ - Rewrite: dùng
public/.htaccess(Apache) để route mọi request vềpublic/index.php
Cấu hình cơ bản
- App:
config/app.php - Route:
config/route.php(đường dẫn thư mục route) - Database:
config/database.php - View:
config/view.php(engine:php/twig/bladeone…)