mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
- Created /templates for main site (header.php, footer.php)
- Created /templates/admin for admin section (head.php, footer.php)
- Removed /public/includes and /public/admin/inc
- Updated all references in code and docs
- Tests passing ✅
Cleaner separation: /public only contains web-accessible files (PHP entry points + assets)
43 lines
1.2 KiB
PHP
43 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Simple configuration for website
|
|
*/
|
|
|
|
// Define application root
|
|
define('APP_ROOT', dirname(__DIR__));
|
|
|
|
// Storage directory for uploaded files — intentionally outside the webroot
|
|
// so no uploaded content is ever directly web-accessible (items #3 & #4).
|
|
// Files are served through public/media.php which validates paths and MIME types.
|
|
define('STORAGE_ROOT', '/var/www/posterg/storage');
|
|
|
|
// Error reporting
|
|
if (php_sapi_name() === 'cli-server') {
|
|
// Development mode
|
|
error_reporting(E_ALL);
|
|
ini_set('display_errors', '1');
|
|
} else {
|
|
// Production mode
|
|
error_reporting(E_ALL);
|
|
ini_set('display_errors', '0');
|
|
ini_set('log_errors', '1');
|
|
}
|
|
|
|
// Simple helper function for including templates
|
|
function include_template($name) {
|
|
$path = APP_ROOT . '/templates/' . $name;
|
|
if (file_exists($path)) {
|
|
include $path;
|
|
}
|
|
}
|
|
|
|
// Load admin credentials if available (defines ADMIN_PASSWORD_HASH for AdminAuth)
|
|
if (file_exists(APP_ROOT . '/config/admin_credentials.php')) {
|
|
require_once APP_ROOT . '/config/admin_credentials.php';
|
|
}
|
|
|
|
// Autoload Composer dependencies if available
|
|
if (file_exists(APP_ROOT . '/vendor/autoload.php')) {
|
|
require_once APP_ROOT . '/vendor/autoload.php';
|
|
}
|