ebcore/framework
Composer 安装命令:
composer require ebcore/framework
包简介
A Modern Entity Based PHP Framework
README 文档
README
Ebcore is a modern and powerful PHP framework inspired by Entity-Based architecture. It helps you build complex web applications with ease and elegance.
Key Features
- 🏗️ Entity-Based Architecture
- 🛣️ Modern Routing System
- 🧩 object-relational mapper (ORM)
- 🔒 Powerful Middleware System
- ⚡ Advanced Caching
- 🎯 Event System
- 📝 Logging System
- 🔐 Security Features
- ⚙️ Flexible Configuration
Installation
Create a new project with Ebcore:
composer create-project ebcore/skeleton my-project
cd my-project
Project Structure
my-project/
├── app/
│ └── entities/
│ └── User/
│ ├── Controllers/
│ │ └── UserController.php
│ ├── Events/
│ │ └── UserRegisterEvent.php
│ └── Middlewares/
│ └── CheckUserPermissionMiddleware.php
├── config/
│ ├── app.json
│ ├── database.json
│ └── middleware.json
├── public/
│ ├── .htaccess
│ └── index.php
├── routes/
│ └── web.php
└── vendor/
└── ebcore/
├── Core/
├── Middlewares/
└── Packages/
Usage Examples
1. Defining Routes
// routes/web.php use ebcore\Core\Router; $router->map('GET', '/', 'User','UserController', 'index'); $router->map('GET', '/users', 'User','UserController', 'index', 'UserRegisterEvent', 'after'); $router->run();
2. Creating Controllers
// app/entities/User/Controllers/UserController.php namespace App\entities\User\Controllers; use ebcore\Core\Controller; use ebcore\DB\DbContext; use ebcore\Module\Response; use ebcore\Packages\Dump\Dump; class UserController { public function index() { $users = DbContext::User()->all(); // Dump::dd($users); if (empty($users)) { return Response::json(null, "No users found", 404, false); } return Response::json($users); } }
3. Creating Middleware
// app/entities/User/Middlewares/CheckUserPermissionMiddleware.php namespace app\entities\User\Middlewares; use ebcore\Core\Middleware; class CheckUserPermissionMiddleware extends BaseMiddleware { public function handle($request, $next) { if (!$this->checkPermission()) { Logger::warning("Permission denied for user", [ 'permission' => $this->requiredPermission, 'user_id' => $_SESSION['user_id'] ?? null ]); return Response::json(null, "You do not have the required permission", 403, false); } return parent::next(); } }
4. Creating Events
// app/entities/User/Events/UserRegisterEvent.php namespace App\entities\User\Events; use ebcore\Core\Events; use ebcore\DB\DbContext; use ebcore\Module\Response; class UserRegisterEvent extends Events { public function execute(): void { if ($this->isExecuted('UserRegisterEvent')) { return; } try { $user = array(); $user["name"] = "test"; $user["family"] = "test"; $user["created_at"] = date("Y/m/d h:i:sa"); DbContext::User()->create($user); $this->markAsExecuted('UserRegisterEvent'); } catch (\Exception $e) { $this->resetExecution('UserRegisterEvent'); throw $e; } } }
5. Using Cache System
use ebcore\Core\Cache; // Store in cache Cache::put('key', 'value', 3600); // Retrieve from cache $value = Cache::get('key'); // Remove from cache Cache::forget('key');
Configuration
Application Settings
// config/app.json { "name": "Ebcore Framework", "version": "1.0.0", "debug": true, "timezone": "Asia/Tehran", "locale": "fa", "url": "http://localhost" }
Middleware Settings
// config/middleware.json { "throttle": { "max_requests": 60, "decay_minutes": 1, "enabled": true }, "global_middlewares": [ "ThrottleMiddleware" ] }
Security Features
- Throttle System
- Duplicate Request control system
- Rate limiting
- Input validation
- Output sanitization
Contributing
Please read our Contributing Guide before submitting a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
Acknowledgments
Thank you to all contributors and developers who have helped build this framework.
ebcore/framework 适用场景与选型建议
ebcore/framework 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 30 次下载、GitHub Stars 达 3, 最近一次更新时间为 2025 年 03 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php framework」 「ebcore」 「ebcore framework」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ebcore/framework 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ebcore/framework 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ebcore/framework 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
Alfabank REST API integration
High-performance, opinionated PHP 8 web framework with O(1) routing, parallel async MySQL, type-safe asset bridge, and React-island frontend
Ebcore PHP Framework Skeleton Project
Zero-dependency raw PHP DNS resolver, domain-ownership verification, and intoDNS/MxToolbox-style diagnostics. Queries authoritative nameservers directly over sockets — never trusts the recursive cache for ownership checks.
The skeleton application for the Geoffrey agent framework.
统计信息
- 总下载量: 30
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 9
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-18