Framework PHP moderne inspiré de Laravel. À installer via Composer – les sites utilisent les fonctions du framework sans jamais le modifier directement.
- Le framework (ce dépôt) : code dans
src/installé dansvendor/angetools/framework - L'application : config, routes, vues dans le projet (skeleton fourni dans
skeleton/)
- 🚀 Modern PHP 8.4+ - Built with the latest PHP features
- 🎯 MVC Architecture - Clean separation of concerns
- 🔒 Authentication & Authorization - Built-in auth system with role-based permissions
- 📦 File System Abstraction - Multiple disk types (encrypted, versioned, cached)
- 🛣️ Flexible Routing - RESTful routes with middleware support
- ✅ Validation - Powerful validation system
- 🎨 View System - Template engine with layouts
- 🧪 Testing - PHPUnit integration
- 🛠️ Artisan CLI - Command-line tools for development
- 🏗️ Service Container - Dependency injection container
- 🔌 Service Providers - Modular service registration
- 📢 Event System - Event dispatcher for decoupled architecture
- 📝 Logging - Advanced logging system with multiple levels
- 🗄️ Query Builder - Fluent database query builder
- 📊 Collections - Powerful array manipulation utilities
- 💾 Cache Manager - Advanced caching system
- 📄 Pagination - Built-in pagination support
composer require angetools/framework- Créer le projet : copiez le contenu de
skeleton/à la racine de votre projet, ou exécutez :
cd mon-projet
php vendor/angetools/framework/bin/install-skeleton.php-
Configurer : copiez
.env.examplevers.envet configurez votre application. -
Démarrer :
php artisan serve
mon-projet/
├── app/ # Votre code (controllers, models, etc.)
├── bootstrap/ # Bootstrap de l'application
├── config/ # Configuration
├── public/ # Point d'entrée HTTP
├── resources/ # Vues, assets
├── routes/ # Définition des routes
├── storage/ # Logs, cache, sessions
├── vendor/ # Composer (angetools/framework ici)
├── artisan
└── .env
Le framework dans vendor/ n'est jamais modifié. Toute personnalisation se fait via config, routes, vues de votre projet.
// bootstrap/app.php
$basePath = dirname(__DIR__);
require $basePath . '/vendor/autoload.php';
Application::setBasePath($basePath);
// ... providers, router, dispatch// routes/web.php
Route::setRouter(app('router'));
Route::get('/', fn($r) => response('Accueil'), [], 'home');<?php
namespace App\Controllers;
use framework\Core\Controller;
use framework\Http\Request;
use framework\Http\Response;
class HomeController extends Controller {
public function index(Request $request): Response {
return new Response('Hello, World!');
}
}The framework includes a powerful CLI tool called Artisan:
php artisan list # List all available commands
php artisan make:controller Name # Create a new controller
php artisan make:model Name # Create a new model
php artisan make:middleware Name # Create a new middleware
php artisan cache:clear # Clear the application cache
php artisan config:cache # Cache configuration files
php artisan phpunit # Run PHPUnit testsConfiguration files are stored in the config/ directory. Each file returns an array of settings:
// config/app.php
return [
'name' => 'My Application',
'env' => 'production',
'debug' => false,
];Access configuration values:
use framework\Core\Config;
$config = new Config(__DIR__ . '/config');
$appName = $config->get('app.name');The framework provides a flexible file system abstraction:
use framework\FileSystem\Storage;
// Public disk
$public = Storage::disk('public');
$public->put('file.txt', 'content');
// Encrypted disk
$private = Storage::disk('private');
$private->put('secret.txt', 'sensitive data');
// Cached disk
$cache = Storage::disk('cache');
$cache->put('key', 'value');use framework\Auth\Auth;
// Check if user is authenticated
if (Auth::check()) {
$user = Auth::user();
$userId = Auth::id();
}
// Login
Auth::login($email, $password);
// Logout
Auth::logout();use framework\Validation\Validator;
$validator = new Validator($data, [
'email' => 'required|email',
'age' => 'required|integer|min:18',
]);
if ($validator->passes()) {
// Process valid data
} else {
$errors = $validator->errors();
}use framework\Core\Application;
// Bind a service
Application::bind('service', fn() => new MyService());
// Bind as singleton
Application::singleton('service', fn() => new MyService());
// Resolve
$service = Application::make('service');use framework\Events\EventDispatcher;
$dispatcher = new EventDispatcher();
// Listen to event
$dispatcher->listen('user.created', function($event, $user) {
// Handle event
});
// Dispatch event
$dispatcher->dispatch('user.created', $user);use framework\Support\Collection;
$collection = Collection::make([1, 2, 3, 4, 5]);
$filtered = $collection
->filter(fn($item) => $item > 2)
->map(fn($item) => $item * 2)
->values();use framework\Database\DB;
$users = DB::table('users')
->where('active', '=', 1)
->where('age', '>', 18)
->orderBy('name', 'ASC')
->limit(10)
->get();use framework\Support\Paginator;
$paginator = Paginator::make($items, $total, $perPage, $currentPage);
$paginator->items(); // Get items
$paginator->currentPage(); // Current page
$paginator->hasMorePages(); // Check if has more
$paginator->nextPageUrl(); // Next page URL// Get
$value = cache('key');
// Put
cache('key', 'value', 3600); // TTL in seconds
// Remember
$value = cache()->remember('key', fn() => expensiveOperation(), 3600);logger()->info('User logged in', ['user_id' => 1]);
logger()->error('Something went wrong', ['error' => $exception]);Run tests with PHPUnit:
php artisan phpunit
# or
composer testMIT License - see LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
Dumont-Julien - dumontj357@icloud.com