Files
CodePress/cms/core/index.php
T
E.Noorlander 6333bc410f CMS 2.0 - Theme engine, logging, admin improvements
Major changes:
- New ThemeManager with Twig templating and SCSS compilation
- Dynamic themes system (themes/default, themes/demo)
- LogManager with SQLite storage and syslog forwarding
- RequestLogger with static helper methods
- Admin UI overhaul (Bootstrap 5, dark mode)
- Admin config page with logging and theme settings
- Admin logs page with filters and search
- Removed legacy Mustache templates
- Removed test plugin and theme
- Composer dependencies: Twig, scssphp, CommonMark, MaxMind GeoIP
2026-08-08 18:02:14 +02:00

60 lines
2.0 KiB
PHP

<?php
/**
* CodePress CMS Core Loader
*
* This file serves as the central entry point for the CodePress CMS core system.
* It loads all essential classes and configuration needed for the CMS to function.
*
* Architecture:
* - config.php: Configuration loader that merges default settings with config.json
* - SimpleTemplate.php: Lightweight template engine for rendering HTML with placeholders
* - CodePressCMS.php: Main CMS class handling content, navigation, search, and rendering
*
* Usage:
* This file is included by public/index.php, which then:
* 1. Loads configuration from config.php
* 2. Creates a new CodePressCMS instance with the config
* 3. Calls render() to output the complete page
*
* The separation allows for:
* - Clean public entry point (public/index.php)
* - Reusable core components
* - Proper class organization with PHPDoc documentation
*/
// Load configuration system - handles default settings and config.json merging
require_once 'config.php';
// Load Composer autoloader
$autoloader = dirname(__DIR__, 2) . '/vendor/autoload.php';
if (file_exists($autoloader)) {
require_once $autoloader;
}
// Load template engine - renders HTML with {{variable}} placeholders and conditionals
require_once 'class/Cache.php';
require_once 'class/RateLimiter.php';
require_once 'class/BotGuard.php';
require_once 'class/RequestLogger.php';
require_once 'class/GeoIP.php';
require_once 'class/Analytics.php';
require_once 'class/SimpleTemplate.php';
require_once 'class/ThemeManager.php';
// Load Logger class - structured logging with log levels
require_once 'class/Logger.php';
require_once 'class/LogManager.php';
// Load Plugin system
require_once 'plugin/CMSAPI.php';
require_once 'plugin/PluginManager.php';
// Load ContentAPI class - provides CMS data access for PHP content files
require_once 'class/ContentAPI.php';
// Load main CMS class - handles content parsing, navigation, search, and page rendering
require_once 'class/CodePressCMS.php';
// Initialize logger (debug mode can be enabled in config)
Logger::init();