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

v1.0.0 2025-09-28 15:18 UTC

This package is auto-updated.

Last update: 2025-12-28 21:14:50 UTC


README

PHP Version License Version

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 bootstrap
  • Container - Dependency injection container
  • ConfigManager - Configuration and environment handling

Database

  • DatabaseManager - Multi-connection database management
  • Support for MySQL, PostgreSQL, SQLite

HTTP & Routing

  • Request - HTTP request abstraction
  • Response - HTTP response with JSON support
  • Router - Modern routing with groups and middleware support
  • Route - 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 execution
  • CommandInterface - 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

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

👨‍💻 Author

Augusto Kussema

🌍 Made in Angola

Desenvolvido com ❤️ em Angola 🇦🇴

Semantica Framework - Modern PHP development made simple