ufukcanatann/prism
Composer 安装命令:
composer create-project ufukcanatann/prism
包简介
PRISM - Modern PHP Framework for Enterprise Applications
关键字:
README 文档
README
Modern PHP Framework for Enterprise Applications
PRISM Framework is a powerful, secure, and developer-friendly PHP framework designed for building modern web applications and APIs. Built with enterprise-grade features and best practices in mind.
Key Features
- ** MVC Architecture**: Clean, organized Model-View-Controller structure
- ** Blade Template Engine**: Powerful and intuitive templating system
- ** Built-in Security**: CSRF protection, XSS prevention, input validation
- ** High Performance**: Optimized routing, caching, and database operations
- ** Dependency Injection**: Modern service container and dependency injection
- ** Powerful CLI Tools**: Code generators and management commands
- ** Database Features**: Migrations, seeders, factories, and query builder
- ** RESTful APIs**: Built-in API support with JSON responses
- ** Middleware System**: Flexible request/response processing
- ** Modern UI**: Bootstrap 5 integration for responsive design
Requirements
- PHP 8.0 or higher
- MySQL 5.7+ / PostgreSQL 10+ / SQLite 3
- Composer
- Web server (Apache/Nginx)
Quick Start
Installation with Composer (Recommended)
# Create a new project composer create-project ufukcanatann/prism my-project # Installation with a specific version composer create-project ufukcanatann/prism my-project "1.0.*" # Choose the dist package composer create-project ufukcanatann/prism my-project --prefer-dist # Go to the project directory cd my-project # Start the server php prism system:serve
Manuel Installation
1. Download Project
git clone <repository-url> my-app cd my-app
2. Load Dependencies
composer install
3. Environment Setup
cp .env.example .env
4. Environment Configuration
Edit the .env file:
APP_NAME="My Application" APP_ENV=local APP_DEBUG=true APP_URL=http://127.0.0.1:8000 DB_CONNECTION=mysql DB_HOST=localhost DB_PORT=3306 DB_DATABASE=my_app DB_USERNAME=root DB_PASSWORD=
5. Framework Installation
php prism system:install
6. Start Development Server
php prism system:serve
Go to http://127.0.0.1:8000 to view your application
Usage Examples
Generate Your First Components
# Create a new controller php prism make controller UserController --resource # Create a model with migration php prism make model User --migration # Create a complete CRUD setup php prism make model Post --all
Define Routes
// routes/web.php $router->get('/users', [UserController::class, 'index']); $router->post('/users', [UserController::class, 'store']); $router->get('/users/{id}', [UserController::class, 'show']); // Route groups with middleware $router->group(['middleware' => 'auth'], function($router) { $router->get('/dashboard', [DashboardController::class, 'index']); });
Create Controllers
// app/Http/Controllers/UserController.php namespace App\Http\Controllers; class UserController extends Controller { public function index() { return view('users.index', [ 'users' => User::all() ]); } public function store(Request $request) { $validated = $request->validate([ 'name' => 'required|string|max:255', 'email' => 'required|email|unique:users' ]); User::create($validated); return redirect('/users')->with('success', 'User created!'); } }
Build Views with Blade
// resources/views/users/index.blade.php @extends('layouts.app') @section('title', 'Users') @section('content') <div class="container"> <h1>Users</h1> @foreach($users as $user) <div class="card mb-3"> <div class="card-body"> <h5>{{ $user->name }}</h5> <p>{{ $user->email }}</p> </div> </div> @endforeach </div> @endsection
Configuration
Environment Variables
Configure the following settings in .env file:
APP_NAME=PRISM Framework APP_ENV=local APP_DEBUG=true APP_URL=http://localhost:8000 APP_KEY=your-32-character-key DB_CONNECTION=mysql DB_HOST=localhost DB_PORT=3306 DB_DATABASE=prism DB_USERNAME=root DB_PASSWORD= CACHE_DRIVER=file SESSION_DRIVER=file MAIL_MAILER=smtp
Middleware Configuration
// config/app.php 'middleware' => [ 'before' => [ \Core\Middleware\CorsMiddleware::class, \Core\Middleware\SessionMiddleware::class, ], 'after' => [ \Core\Middleware\ResponseMiddleware::class, ] ]
Security
- CSRF Protection: CSRF token validation for all forms
- Encryption: Secure password hashing with bcrypt
- Session Security: Secure session management
- SQL Injection Protection: Prepared statements usage
- XSS Protection: Output escaping
- Audit Logging: Comprehensive user activity tracking
Database Schema
The system includes the following core tables:
users- User informationmigrations- Migration trackingpassword_resets- Password reset tokensfailed_jobs- Failed job queue
API Usage
RESTful Endpoints
// User operations GET /api/users # User list POST /api/users # Create new user GET /api/users/{id} # User details PUT /api/users/{id} # Update user DELETE /api/users/{id} # Delete user
Frontend
- Bootstrap 5: Modern and responsive design
- Font Awesome: Icon library
- Chart.js: Charts and statistics
- jQuery: JavaScript library
CLI Commands
PRISM Framework comes with powerful CLI tools to speed up development:
Code Generators
# Generate controllers php prism make controller UserController php prism make controller ApiController --api # Generate models with related files php prism make model User --migration --factory --seeder php prism make model Post --all # Generate database files php prism make migration create_users_table --create=users php prism make seeder UserSeeder php prism make factory UserFactory # Generate other components php prism make middleware AuthMiddleware php prism make request StoreUserRequest
Database Operations
# Run migrations php prism db migrate # Seed database php prism db seed # Migration + seeding php prism db migrate --seed
System Management
# Start development server php prism system serve --port=8080 # Application maintenance php prism system down php prism system up # Performance & security php prism system optimize php prism system security:scan php prism system clear:cache # Environment management php prism system env list php prism system env set APP_DEBUG false # Debugging & information php prism system route:list php prism system inspect database
Testing
# Run tests composer test # Run tests with coverage composer test-coverage
Contributing
- Fork the project
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Create Pull Request
License
This project is licensed under the MIT License.
Support
For any issues or suggestions:
- Open an issue
- Email: support@prism-framework.com
Updates
v3.0.0
- Initial release
- Basic MVC structure
- User management
- Database migrations
- API support
- Modern UI
PRISM Framework - Modern PHP Framework for Enterprise Applications
ufukcanatann/prism 适用场景与选型建议
ufukcanatann/prism 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 08 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「php」 「api」 「enterprise」 「modern」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ufukcanatann/prism 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ufukcanatann/prism 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ufukcanatann/prism 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
A PSR-7 compatible library for making CRUD API endpoints
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
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.
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-10