devkussema / semantica-core
Semantica Framework Core - Modern OOP PHP framework engine
Installs: 2
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/devkussema/semantica-core
Requires
- php: >=8.0
Requires (Dev)
- phpstan/phpstan: ^1.0
- phpunit/phpunit: ^9.0
README
The powerful core engine of Semantica Framework - A modern, object-oriented PHP framework inspired by Laravel's elegance and simplicity.
🎯 About
Semantica Core is the heart of the Semantica Framework, providing:
- Modern OOP Architecture with dependency injection container
- Flexible Database Management supporting multiple simultaneous connections (MySQL, PostgreSQL, SQLite)
- Dynamic Template System with theme switching capabilities
- HTTP Layer with modern Request/Response handling
- Routing System with fluent API and named routes
- CLI Infrastructure for command-line tools
- Configuration Management with environment variable support
🏗️ Components
Core Classes
Application- Main application container and bootstrapContainer- Dependency injection containerConfigManager- Configuration and environment handling
Database
DatabaseManager- Multi-connection database management- Support for MySQL, PostgreSQL, SQLite
HTTP & Routing
Request- HTTP request abstractionResponse- HTTP response with JSON supportRouter- Modern routing with groups and middleware supportRoute- Individual route with constraints and naming
Templates
TemplateManager- Dynamic theme system- Support for multiple themes and layouts
- Variable injection and partial rendering
Console
CommandManager- CLI command registration and executionCommandInterface- Interface for custom commands
🚀 Features
Multi-Database Support
$db = new DatabaseManager($config); // Default connection $users = $db->fetch("SELECT * FROM users"); // Specific connection $products = $db->fetch("SELECT * FROM products", [], 'shop_db'); // Transactions $db->beginTransaction(); $db->execute("INSERT INTO users (name) VALUES (?)", ['João']); $db->commit();
Dynamic Templates
$template = new TemplateManager($basePath, $config); // Switch themes dynamically $template->setTheme('admin_v1'); // Render with layout $html = $template->renderWithLayout('users.index', $data);
Modern Routing
$router = new Router(); // Named routes with constraints $router->get('/users/{id}', 'UserController@show') ->name('users.show') ->where('id', '\d+'); // Route groups $router->group(['prefix' => 'api'], function($router) { $router->get('/status', 'ApiController@status'); });
📦 Installation
This is the core package and should not be installed directly. Use the application skeleton instead:
composer create-project semantica/app my-project
For manual installation in existing projects:
composer require semantica/core
🔧 Requirements
- PHP 8.0 or higher
- PDO extension for database support
- JSON extension
📖 Documentation
Full documentation is available in the main application skeleton repository.
🤝 Contributing
- 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
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
👨💻 Author
Augusto Kussema
- Email: augusto@semantica.dev
- GitHub: @augustokussema
🌍 Made in Angola
Desenvolvido com ❤️ em Angola 🇦🇴
Semantica Framework - Modern PHP development made simple