- Implement BotGuard security engine (Bot, AI, Scraper & Empty UA blocking) - Add Admin Security page (/admin/security) with toggles, rate limiter & block/allowlists - Add per-IP RateLimiter handoff in index.php with HTTP 429 response - Add dynamic /robots.txt generation and noai/noimageai meta tags - Add RequestLogger status column and blocked badges in admin request logs - Fix ARIAComponents.php syntax errors on lines 67, 137, 262 - Add HAProxy / PFSense bot blocking & IP forwarding guide (docs/haproxy-bot-blocking.md) - Update version to 1.8.0 with release notes in version.php and guides
55 lines
1.8 KiB
PHP
55 lines
1.8 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/SimpleTemplate.php';
|
|
|
|
// Load Logger class - structured logging with log levels
|
|
require_once 'class/Logger.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(); |