mintyphp/core
最新稳定版本:v3.2.24
Composer 安装命令:
composer require mintyphp/core
包简介
README 文档
README
A lightweight, minimalist PHP framework providing essential components for modern web applications.
MintyPHP will run on any Linux web server running PHP + MariaDB + Memcache
Requirements
- PHP: >= 8.0
- Extensions:
ext-memcached: Required for caching functionalityext-mysqli: Required for database operations
Installation
Install MintyPHP Core via Composer:
composer require mintyphp/core
Development
Project Structure
The project follows a dual-layer architecture:
src/Core/: Contains the core implementation classes (e.g.,Core/Template.php,Core/Router.php)src/: Contains auto-generated static wrapper classes (e.g.,Template.php,Router.php)
Important: Do NOT Edit Generated Classes
The wrapper classes in src/ are auto-generated. Do not manually edit these files as your changes will be overwritten.
Making Changes
- Edit Core Classes: Make all changes to files in
src/Core/directory - Regenerate Wrappers: After modifying core classes, regenerate the wrapper classes:
php generate_wrappers.php
This script automatically generates static wrapper classes that provide a convenient facade pattern for the instance-based Core classes.
Development Workflow
# 1. Make changes to core classes nano src/Core/Template.php # 2. Regenerate wrapper classes php generate_wrappers.php # 3. Run tests to verify changes ./test.sh # 4. Run static analysis (optional) vendor/bin/phpstan analyse
Running Tests
Run All Tests
./test.sh
Or directly with PHPUnit:
vendor/bin/phpunit tests
Run Specific Test Class
vendor/bin/phpunit tests/Core/RouterTest.php
Run Specific Test Method
vendor/bin/phpunit --filter testAdmin tests/Core/RouterTest.php
Run with Coverage (if Xdebug is installed)
vendor/bin/phpunit --coverage-html coverage
Static Analysis
Run PHPStan for static code analysis:
vendor/bin/phpstan analyse
Components
MintyPHP Core provides the following components:
- Router: URL routing and request handling
- Template: Template rendering engine
- DB: Database abstraction layer
- Auth: Authentication management
- Session: Session handling
- Cache: Caching mechanisms
- Firewall: Security and access control
- Orm: Object-relational mapping
- Buffer: Output buffering
- Curl: HTTP client wrapper
- Token: Token generation and validation
- Totp: Time-based one-time password support
- I18n: Internationalization support
- NoPassAuth: Passwordless authentication
- Analyzer: Code analysis utilities
- Debugger: Debugging and profiling tools
统计信息
- 总下载量: 1.21k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 0
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-10-27