ahmadmunib/framework1
最新稳定版本:v1.1.2
Composer 安装命令:
composer require ahmadmunib/framework1
包简介
A lightweight PHP framework with Laravel-like features including CLI tools
README 文档
README
A lightweight, Laravel-inspired PHP framework with zero external dependencies.
Features
- 🚀 Zero Dependencies - Pure PHP, no Composer packages required
- 📦 PSR-4 Autoloading - Automatic class loading
- 🛣️ Expressive Routing - Laravel-style routes with parameters
- 📝 Query Builder - Fluent database interface
- 🔒 Security - Prepared statements, error handling
- ⚡ Performance - Lightweight and fast
Quick Start
# Clone the repository git clone https://github.com/your-org/dis-framework.git my-project cd my-project # Create storage directories mkdir -p storage/logs storage/cache storage/uploads # Start development server php -S localhost:8000 -t public # List framework CLI commands php fx list
Visit http://localhost:8000 to see your application running.
Basic Usage
Define Routes
// routes/web.php Router::get('/hello/{name}', function (Request $request, string $name) { return "Hello, {$name}!"; }); Router::get('/users', 'UserController@index');
Database Queries
use Framework\Database\Connection as DB; // Query Builder $users = DB::table('users') ->where('active', 1) ->orderBy('name') ->get(); // Insert $id = DB::table('users')->insert([ 'name' => 'John', 'email' => 'john@example.com' ]);
Configuration
// Access config values $appName = config('app.name'); $dbHost = config('database.connections.mysql.host');
Generate Controllers (Artisan-style)
# Create app/Http/Controllers/UserController.php php fx make:controller UserController # Support nested namespaces (creates app/Http/Controllers/Admin/UserController.php) php fx make:controller Admin/UserController
Requirements
- PHP 8.1 or higher
- PDO extension
- Apache with mod_rewrite or Nginx
Documentation
Full documentation is available in the docs/official-documentation directory:
Directory Structure
├── app/ # Application code
│ ├── Http/Controllers/
│ └── Models/
├── config/ # Configuration files
├── framework/ # Framework core
├── public/ # Web root
├── routes/ # Route definitions
├── storage/ # Logs, cache, uploads
└── tests/ # Test files
License
MIT License - see LICENSE file for details.
Author
Ahmad Munib - Technical Team Lead
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-28