Files
CodePress/cms/core/index.php
T
E.Noorlander 06785e9922 CodePress CMS v1.9.0: visitor statistics with SVG world map and GeoIP
- Add GeoIP class with provider chain: local DB-IP Lite, MaxMind .mmdb, external API
- Add built-in pure-PHP MMDBReader so .mmdb works without Composer
- Add cli/geoip-update.php to download DB-IP Lite and build a compact binary index
- Add cli/generate-world-map.php to generate the world map SVG from Natural Earth TopoJSON
- Add Analytics class aggregating stats in admin/storage/stats.json with LOCK_EX
- Add admin statistics page with choropleth world map, country list, top pages,
  daily chart, referrers and a period filter
- Add GeoIP and privacy settings with database update and stats reset buttons
- Add optional IP anonymization and configurable retention period
- Add country field to requests.log (parser accepts 7, 8 or 9 fields)
- Add country column to request log and KPI cards to the dashboard
- Ignore GeoIP binaries and stats.json in Git
- Update TODO.md, guides and version to 1.9.0
2026-07-29 15:40:02 +02:00

58 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';
// 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();