Download the PHP package phastasf/framework without Composer
On this page you can find all versions of the php package phastasf/framework. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package framework
Phast Framework
A lightweight, modern PHP framework for building CLI, web, and API applications. Built on PSR standards with a clean, intuitive API.
Features
- PSR Standards: PSR-7, PSR-11, PSR-15, PSR-3, PSR-6, PSR-16, PSR-20
- Dependency Injection: Automatic dependency resolution
- Routing & Middleware: Fast routing with PSR-15 middleware pipeline
- Database & ORM: Multi-database support (MySQL, PostgreSQL, SQLite, SQL Server) with Datum ORM
- Migrations: Schema versioning with Kram
- Views: Template engine with layout inheritance
- Authentication: JWT-based authentication
- Queue System: Job queues with Redis and ElasticMQ/SQS
- Caching: Multiple backends (File, Memory, Redis, Predis, Memcache)
- Logging: Flexible logging with multiple backends
- Email: SMTP, Mailgun, and Resend transports
- Validation: Powerful input validation
- Console Commands: Built-in CLI commands and generators
Requirements
- PHP 8.2+
- Composer
Installation
Quick Start
Web Application
Create public/index.php:
Console Application
Create console:
Configuration
Configuration files are in config/. The framework loads defaults from the package and merges your project's config/ overrides.
Application
Database
Session
Configure session cookie settings:
Trusted Proxies
When running behind a reverse proxy or load balancer, configure trusted proxies for accurate client IP detection:
Routing
Middleware
Middleware is configured in config/middleware.php:
Generate a new middleware:
Client IP Detection
When running behind a reverse proxy or load balancer, add ClientIpMiddleware to your middleware stack to correctly detect client IP addresses. The middleware reads trusted proxy configuration from config/proxies.php and extracts the real client IP from proxy headers.
CORS (Cross-Origin Resource Sharing)
Add CorsMiddleware to your middleware stack to handle cross-origin requests. The middleware automatically handles preflight OPTIONS requests and adds appropriate CORS headers to responses.
The middleware is configured via config/cors.php:
Configuration Examples
Allow all origins (development):
Allow specific origins (production):
Apply CORS only to API routes:
Exclude certain paths from CORS:
Important Notes
- When
allow_credentialsistrue,allowed_originscannot be'*'(must specify exact origins) - The middleware automatically handles preflight OPTIONS requests
- Path matching uses prefix-based matching (paths starting with the pattern)
- CORS headers are only added when the request includes an
Originheader
Service Providers
Service providers are configured in config/providers.php:
Generate a new service provider:
Service providers implement Phast\Providers\ProviderInterface with two methods:
provide(Container $container): Register services in the containerinit(Container $container): Initialize services after all providers are registered
Controllers
Models
Migrations
Seeders
Seeders add fake or test data to the database. You can insert data via the connection (raw) or using models. Dependencies (e.g. ConnectionInterface) are injected via the seeder constructor and resolved by the container. Only the seeders listed in config database.seed are run when you execute the seed command.
Configure which seeders run in config/database.php:
Queue Jobs
Console Commands
Generators
g:command- Generate console commandg:controller- Generate controllerg:event- Generate event classg:job- Generate jobg:middleware- Generate middleware classg:migration- Generate migrationg:model- Generate modelg:provider- Generate service providerg:seeder- Generate seeder class
Database
m:up- Run pending migrationsm:down [count]- Rollback migrations (default: 1)seed- Run database seeders (only those in configdatabase.seed)
Development
serve- Start development serverworker- Run queue workershell- Start interactive PHP shell (REPL) with container accessuncache- Clear cached config, routes, and application cache
Usage Examples
Caching
Logging
HTTP Client
The framework includes a PSR-18 compliant HTTP client:
Validation
JWT Authentication
Error Handling
The framework includes centralized error handling that:
- Catches all exceptions
- Returns JSON for API requests (
Accept: application/json) - Renders HTML error pages for web requests
- Logs 5xx errors automatically
- Shows debug info when
app.debugis enabled
License
MIT License - see LICENSE file.
Credits
Built on excellent PSR-compliant libraries:
- Katora - DI Container
- Kunfig - Configuration Management
- Databoss - Database Connections
- Datum - ORM
- Kram - Migrations
- Tez - Routing
- Vidyut - Middleware Pipeline
- Sandesh - HTTP Messages
- Phew - Templates
- Filtr - Validation
- Drishti - Logging
- Godam - Caching
- Qatar - Queues
- Jweety - JWT
- Envelope - Email
- Phlash - Flash Messages
- Ank - Captcha
- Soochak - Events
- Samay - Clock
- Dakiya - HTTP Client (PSR-18)
- Clip - CLI Commands
- Prayog - REPL/Shell (dev)
All versions of framework with dependencies
middlewares/client-ip Version ^2.1
vaibhavpandeyvpz/kunfig Version ^2.0
vaibhavpandeyvpz/databoss Version ^2.1
vaibhavpandeyvpz/datum Version ^1.1
vaibhavpandeyvpz/kram Version ^1.0
vaibhavpandeyvpz/clip Version ^1.0
vaibhavpandeyvpz/filtr Version ^2.0
vaibhavpandeyvpz/ank Version ^2.0
vaibhavpandeyvpz/jweety Version ^2.0
vaibhavpandeyvpz/phlash Version ^3.0
vaibhavpandeyvpz/tez Version ^3.0
vaibhavpandeyvpz/phew Version ^2.0
vaibhavpandeyvpz/drishti Version ^1.1
vaibhavpandeyvpz/samay Version ^1.0
vaibhavpandeyvpz/dakiya Version ^3.0
vaibhavpandeyvpz/vidyut Version ^3.0
vaibhavpandeyvpz/sandesh Version ^3.0
vaibhavpandeyvpz/godam Version ^2.0
vaibhavpandeyvpz/soochak Version ^2.0
vaibhavpandeyvpz/katora Version ^2.0
vaibhavpandeyvpz/qatar Version ^1.0
vaibhavpandeyvpz/envelope Version ^1.0