dotsystems/dotapp
最新稳定版本:1.7.2
Composer 安装命令:
composer create-project dotsystems/dotapp
包简介
DotApp PHP framework - a complete, scalable and efficient tool for web applications.
README 文档
README
Full documentation is available at:
dotApp is an ultra-fast, powerful, and scalable PHP framework for modern web applications. It stays lean yet handles very large apps, with clean structure that's easy for humans, vibe coders, and AI assistants to read, learn, and build on. Starting with version 1.8, dotApp includes comprehensive AI instructions making it perfectly compatible with advanced AI models like Claude Opus 4.5 and GPT-4.5 Sonnet for flawless code generation. It ships with a built-in Bridge for seamless PHP↔JS calls and an ultra-light reactive frontend library, alongside fast routing and templating.
Proudly made in Slovakia 🇸🇰
🔹 Minimal and efficient
🔹 PSR-4 autoloading support
🔹 Modular architecture
🔹 Flexible templating system
🔹 AI-optimized codebase - Perfect for Claude Opus 4.5 and GPT-4.5 Sonnet
Currently Working On 🛠️
We’re actively developing Connector, a powerful JS and PHP library integrated into the DotApp framework! Watch our testing demo to see how nodes are beautifully connected with mouse-driven logic, showcasing a stunning backend and frontend experience. The JS part is ready, and the PHP part is in progress. Check it out! 🚀
Support DotApp’s development! Be among the first 100 sponsors to earn permanent recognition on dotapp.dev. Sponsor Now
Getting Started
The dotApp instance is globally accessible, and you can work with it through facades for brevity. A few quick routing examples (single path, array of paths, controller strings, static routes):
// Single route Router::get('/', fn($request) => 'Hello World'); // Multiple paths share the same handler Router::get(['/', '/home'], fn($request) => 'Welcome!'); // Controller syntax (module:Controller@method) Router::get('/users/{id}', 'Users:Profile@show'); // Static route (no pattern matching) example Router::post('/login', 'Users:Login@loginPost', Router::STATIC_ROUTE);
This keeps routes concise while still letting you access other services via facades or DotApp::DotApp() when needed.
What's New ✨
Version 1.8 Released (NEW – 2026-01-04)
- Separated Database Drivers: MySQLi and PDO drivers are now in separate files (
DatabaserMysqliDriver.php,DatabaserPdoDriver.php) for better maintainability - Custom Database Driver Support: Register your own database drivers using
Databaser::customDriver('name', 'DriverClass')for MongoDB, Redis, or any custom database - ORM & QueryBuilder Improvements: Fixed bugs, improved stability, and enhanced performance in Object-Relational Mapping and SQL Query Builder
- Complete ORM & QueryBuilder Testing: Comprehensive test suite covering all Entity, Collection, and QueryBuilder functionality
- Database Configuration Fixes: Corrected driver naming conventions and configuration examples throughout documentation
- AI-Friendly Framework: Added comprehensive AI instructions and guides (.cursorrules, ai_database_guide.md) making the framework highly compatible with advanced AI models like Claude Opus 4.5 and GPT-4.5 Sonnet for perfect code generation
Version 1.7.2 Released (2025-12-25)
- Middleware chaining: Define multiple middlewares at once (arrays), run them as a group(), and react conditionally with when(), true(), false() callbacks.
- Router + facades polish: Static route flag, array routes, and controller strings (
Module:Controller@method) with DI-backed resolution. - OTP & QR utilities:
TOTPgenerates Base32 secrets, TOTP codes, and otpauth URIs;QRbuilds PNG/base64 QR codes with styling options. - Email/SMS stack:
Emailer(SMTP + IMAP/POP3) withEmailfacade helpers;Smsfacade +SmsProviderinterface for send/validate/status. - MCP server support: Model Context Protocol server layer with tool/resource/prompt registration and JSON-RPC
initialize,tools/list,resources/list,prompts/list, and execution handling. - Bug fixes & stability: routing/middleware pipeline tweaks, limiter handling, and DI/resolver robustness.
AI-Friendly Features (1.8+)
- Comprehensive AI Instructions: Complete .cursorrules file and ai_database_guide.md for perfect AI model compatibility
- Claude Opus 4.5 & GPT-4.5 Sonnet Ready: Framework designed to work flawlessly with advanced AI models
- Structured Code Generation: AI can perfectly generate controllers, models, routes, and database operations
- Self-Documenting Architecture: Clean, readable code structure that AI understands intuitively
Highlights from 1.7
- Testing with Tester Class: Lightweight unit and integration testing for modules and core.
- FastSearch Library: Unified search interface for Elasticsearch, OpenSearch, Meilisearch, Algolia, and Typesense.
- Cache Library: Driver-agnostic caching with file-based and Redis support.
- Centralized Configuration with Config Facade: Unified configuration management.
- Session Drivers: Five built-in drivers (Default, File, File2, DB, Redis) for flexible session management.
- Router Facade: Alias for $dotApp->router.
- DB Facade: Alias for $dotApp->db.
- Request Facade: Alias for $dotApp->request.
👥 Installation
There are three ways to install dotApp:
-
Using Composer (New!):
Install dotApp directly into your current directory using Composer:
composer create-project dotsystems/dotapp ./
This will download the latest version of dotApp and set up the project structure in your current directory.
-
Using DotApper CLI (Recommended):
Obtain the
dotapper.phpfile and run it to install dotApp. You can either:-
Download it manually: Visit https://install.dotapp.dev/dotapper.php, download the file, and place it in your project directory.
-
Use
wget: Run the following command to downloaddotapper.phpdirectly:wget https://install.dotapp.dev/dotapper.php
Then, execute the installer:
php dotapper.php --install
-
-
Using Git Clone:
Clone the repository to your project directory:
git clone https://github.com/dotsystems-sk/dotapp.git ./
✅ After installation, you can freely use composer require to install additional libraries as needed.
🚀 Usage
Simple "Hello World" example using dotApp:
// index.php define('__ROOTDIR__', "/path/to/your/dotapp"); require_once __ROOTDIR__ . '/app/config.php'; Router::get('/', fn($request) => 'Hello World'); DotApp::DotApp()->run();
Route callbacks receive a locked Request object; you can return a string (it becomes the response body) or work with
$request->responseif you need full control.
⚙️ Configuration
Main settings are located in app/config.php. Example:
use \Dotsystems\App\DotApp; use \Dotsystems\App\SessionDriverRedis; use \Dotsystems\App\Config; $dotApp = new \Dotsystems\App\DotApp(); // Set encryption key Config::set("app", "c_enc_key", md5('SECURE_KEY')); // Configure databases Config::addDatabase("main", "127.0.0.1", "dotsystems", "dotsystems", "dotsystems", "UTF8", "MYSQL", "mysqli"); // Configure session driver Config::session("lifetime", 30 * 24 * 3600); Config::session("redis_host", "127.0.0.1"); Config::session("redis_port", 6379); Config::session("redis_prefix", "session:"); Config::sessionDriver("redis", SessionDriverRedis::driver()); $dotApp->load_modules();
🛠️ DotApper CLI Tool
DotApper is a command-line utility for managing your dotApp application. Basic usage:
# Install dotApp php dotapper.php --install # Update dotApp core php dotapper.php --update # Install a module from Git or registry php dotapper.php --install-module=https://github.com/vendor/module.git # Create a new module php dotapper.php --create-module=Blog # List all routes php dotapper.php --list-routes # Regenerate .htaccess php dotapper.php --create-htaccess # Run tests php dotapper.php --test # All tests (core) php dotapper.php --test-modules # Module tests only php dotapper.php --module=Blog --test # Tests for Blog module
All Available Options
Usage: php dotapper.php [options]
Options:
--install Install a fresh copy of the dotApp PHP framework
--update Update dotApp core to the latest version
--create-module=<name> Create a new module
--modules List all modules
--install-module=<url|name[:ver]> Install a module (Git URL or name, optional version)
--prepare-database[=<prefix>] Prepare database structure (optional table prefix)
--module=<module_name> --create-controller=<ControllerName> Create a new controller
--module=<module_name> --create-middleware=<MiddlewareName> Create a new middleware
--module=<module_name> --create-model=<ModelName> Create a new model
--list-routes List all defined routes
--list-route=<route> List callbacks for a specific route (e.g., /)
--create-htaccess Create or recreate a new .htaccess file
--optimize-modules Optimize module loading
--test Run all core tests
--test-modules Run all module tests (no core tests)
--module=<module_name> --test Run tests for a specific module
🧪 Version Note
This is the version 1.8 release of dotApp, featuring enhanced AI compatibility with comprehensive instructions for advanced AI models like Claude Opus 4.5 and GPT-4.5 Sonnet.
Older versions may have duplicate function names (lowercase and PascalCase) due to the transition to PascalCase for naming, maintaining backward compatibility. This has minimal impact on performance.
📚 Documentation
Full documentation is available at:
💎 Contact
📧 Email: dotapp@dotapp.dev
🌐 Web: https://dotapp.dev
🌐 Company Web: https://dotsystems.sk
📝 License
dotApp is licensed under the MIT License. You must retain the author's name in all library headers.
Additional Permission: The Software may be used for training AI models, provided the copyright notice is retained.
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-06-18