Download the PHP package samphp/framework without Composer
On this page you can find all versions of the php package samphp/framework. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download samphp/framework
More information about samphp/framework
Files in samphp/framework
Package framework
Short Description SamPHP — A lightweight, secure, MVC-based PHP framework for building CRMs, websites, and APIs with zero bloat.
License MIT
Homepage https://github.com/samaponghosh/samphp-framework
Informations about the package framework
SamPHP Framework
A lightweight, secure, MVC-based PHP framework for building CRMs, websites, and APIs.
✨ Features
- MVC Architecture — Clean separation of Models, Views, and Controllers
- Built-in Security — CSRF protection, XSS sanitization, bcrypt password hashing
- Session Management — Secure session handling with regeneration & flash messages
- Middleware System — Auth, Guest, and Role-based access control out of the box
- Input Validation — Server-side validation (required, email, min, max, numeric, url, regex)
- PDO Database Layer — Secure MySQL connection with singleton pattern & prepared statements
- Modern Frontend — Outfit font, Lucide icons, toast notifications, modal system
- AJAX Utilities — Built-in JavaScript helpers for API calls and form handling
- Clean URLs — Apache mod_rewrite routing with directory protection
- Zero Dependencies — Pure PHP, no external packages required
📦 Installation
Via Composer (Recommended)
This will:
- Download the framework template
- Auto-create
config/config.phpfrom the sample - Display next-step instructions
Manual Installation
⚙️ Configuration
Edit config/config.php with your settings:
📂 Project Structure
🚀 Quick Start
1. Create a Controller
2. Create a Model
3. Create a View
4. Using Middleware
5. Flash Messages
🔒 Security Features
| Feature | Usage |
|---|---|
| CSRF Protection | Security::csrfToken() / Security::verifyCsrf($token) |
| XSS Sanitization | Security::sanitize($input) |
| Password Hashing | Security::hashPassword($pw) / Security::verifyPassword($pw, $hash) |
| Session Security | Session::regenerate() after login |
| Directory Protection | .htaccess blocks access to sensitive files |
| Prepared Statements | PDO with emulated prepares disabled |
🌐 URL Routing
URLs map automatically to controllers and methods:
| URL | Controller | Method | Parameters |
|---|---|---|---|
/ |
HomeController |
index() |
— |
/product |
ProductController |
index() |
— |
/product/show/5 |
ProductController |
show(5) |
[5] |
/user/edit/3 |
UserController |
edit(3) |
[3] |
🖥️ Server Requirements
- PHP >= 7.4
- MySQL 5.7+ / MariaDB 10.3+
- Apache with
mod_rewriteenabled - PDO PHP extension
- mbstring PHP extension
🤝 Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
🔐 Security
If you discover a security vulnerability, please see SECURITY.md for responsible disclosure guidelines.
📄 License
This project is licensed under the MIT License — see the LICENSE file for details.
👤 Author
Samapon Ghosh — @samaponghosh
Built with ❤️ by Samapon Ghosh
All versions of framework with dependencies
ext-pdo Version *
ext-mbstring Version *