Download the PHP package julienlinard/php-skeleton without Composer
On this page you can find all versions of the php package julienlinard/php-skeleton. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download julienlinard/php-skeleton
More information about julienlinard/php-skeleton
Files in julienlinard/php-skeleton
Package php-skeleton
Short Description Skeleton minimal utilisant mes libraries PHP (router, core, auth, doctrine).
License MIT
Homepage https://github.com/julien-lin/php-skeleton
Informations about the package php-skeleton
PHP Skeleton v1.5.8
🇬🇧 Read in English
💝 Support the project
If this skeleton is useful to you, consider becoming a sponsor to support the development and maintenance of this open source project.
A minimal PHP project skeleton using my PHP libraries (router, core, auth, doctrine). Perfect starting point for building modern PHP applications with clean architecture and production-ready structure.
✨ Features
- 🚀 Production-Ready - Fully configured and optimized out of the box
- 🏗️ Clean Architecture - Well-organized structure with service layer
- 🔒 Security First - Mass assignment protection, open redirect prevention, secure sessions, CSRF protection
- 📦 Auto-Generated Services - EnvValidator, BootstrapService, EventListenerService
- 🌐 Multilingual Support - Validation messages in French, English, Spanish
- 🐳 Docker Ready - Complete Docker setup with Apache and MariaDB
- ⚡ Zero Configuration - Works immediately after installation
- ⚡ Performance Optimized - View caching, container scoped cache, rate limiting
🚀 Installation
Create a new project using Composer:
This will create a new directory my-app with the skeleton structure and launch an interactive installer.
📦 What's Included
- Core PHP Framework - MVC structure with dependency injection container
- Router - Modern routing with PHP 8 attributes
- Form Validation - Advanced validation powered by php-validator with multilingual support
- Logging - Integrated SimpleLogger with structured logging
- Error Handling - Comprehensive error handling with debug/production modes
- Session Management - Secure session handling with flash messages
- Optional: Doctrine PHP - ORM for database management
- Optional: Auth PHP - Authentication and authorization system
🎯 Interactive Installation
After running composer create-project, an interactive installer will guide you through the setup:
Step 1: Choose Environment
- Use Docker? - Choose
yfor Docker setup orNfor local development
Step 2: Docker Configuration (if Docker selected)
The installer will ask you to configure:
- Apache container name and port
- MariaDB container name and port
- Database credentials (root password, database name, user, password)
- PHP error reporting settings
Two .env files will be automatically generated:
- Root
.env- For Docker Compose configuration www/.env- For application configuration
Step 3: Optional Packages
- Install Doctrine? - Adds database ORM capabilities
- Install Auth? - Adds authentication system
Simply answer y for yes or N for no (default).
The autoloader is automatically regenerated after installation, so your application is ready to run immediately!
⚡ Quick Start
Option A: Docker Setup
If you chose Docker during installation:
Useful Docker aliases (after sourcing aliases.sh):
ccomposer- Run Composer commands in containercapache- Enter Apache container shellcmariadb- Enter MariaDB container shelldb-export- Export database backupdb-import- Import database backup
Option B: Local Setup
If you chose local development:
📁 Project Structure
Docker Setup Structure
Local Setup Structure
🛠️ Auto-Generated Services
The skeleton automatically generates three essential services:
1. EnvValidator
Validates environment variables on application startup:
APP_SECRETvalidation (minimum 32 characters)APP_LOCALEvalidation (supported: fr, en, es)
2. BootstrapService
Centralizes bootstrap configuration:
- Debug mode configuration
- Error handler setup with logging
- Session security configuration
3. EventListenerService
Registers application event listeners:
- Request logging
- Response logging
- Exception logging
📚 Available Packages
This skeleton uses the following packages:
- julienlinard/php-router - Modern router with PHP 8 attributes
- julienlinard/core-php - MVC framework with DI container
- julienlinard/php-validator - Advanced validation with multilingual support
- julienlinard/doctrine-php - ORM (optional)
- julienlinard/auth-php - Authentication (optional)
🛠️ Development
Adding Controllers
Create controllers in the src/Controller/ directory. Controllers should extend the base Controller class:
Register routes in public/index.php (or www/public/index.php for Docker):
Form Validation
The skeleton includes php-validator with multilingual support:
Using Dependency Injection
Services are automatically registered in the DI container. Access them in controllers:
Flash Messages
Flash messages are automatically displayed in the header template:
Logging
Use SimpleLogger for structured logging:
Configuration
Environment variables are automatically loaded from .env:
🔒 Security Features
- Mass Assignment Protection - Models protected with
$fillable/$guardedproperties - Open Redirect Prevention - URL validation to prevent redirect attacks
- CSRF Protection - Automatic CSRF token generation and validation
- Session Security - HttpOnly, Secure, SameSite cookies with automatic ID regeneration (every 15 min)
- Rate Limiting - Built-in middleware to prevent brute force attacks
- Security Headers - CSP, HSTS, X-Frame-Options, and more
- Sensitive Data Redaction - Automatic masking of passwords/tokens in logs
- Environment Validation - Automatic validation of required environment variables
- Secure Database Config - No hardcoded credentials, strict validation
- Error Handling - Production-safe error handling with logging
⚡ Performance Features
- View Caching - File-based cache for rendered templates with automatic invalidation
- Container Scoped Cache - 50-70% faster dependency resolution
- Rate Limit Memory Cache - 5-10x faster than file-only storage
- Log Rotation - Automatic compression and cleanup to save disk space
- Response Compression - Gzip middleware for bandwidth optimization
📝 Requirements
- PHP 8.1 or higher
- Composer
- Docker (optional, for Docker setup)
🆕 What's New in v1.5.8
- ✅ Updated to core-php ^1.4 - Includes all security and performance improvements
- ✅ Mass assignment protection in models
- ✅ Open redirect prevention in controllers
- ✅ Enhanced session security with automatic ID regeneration
- ✅ Performance optimizations (view cache, container cache, rate limiting)
- ✅ Sensitive data redaction in logs
- ✅ Improved log rotation with compression
Previous Updates (v1.5.3)
- ✅ Automatic autoloader regeneration after installation
- ✅ Clean architecture with service layer
- ✅ Auto-generated services (EnvValidator, BootstrapService, EventListenerService)
- ✅ Multilingual validation support (fr, en, es)
- ✅ Secure configuration out of the box
- ✅ Flash messages with auto-hide
- ✅ Production-ready structure
📄 License
MIT License - See the LICENSE file for more details.
🤝 Contributing
Contributions are welcome! Feel free to open an issue or a pull request.
📧 Support
For any questions or issues, please open an issue on GitHub.
💝 Support the project
If this skeleton is useful to you, consider becoming a sponsor to support the development and maintenance of this open source project.
Developed with ❤️ by Julien Linard