<?php
/**
 * ============================================================
 * Application Bootstrap / Configuration Loader
 * (SIMULATION - THIS IS FAKE DATA, NOT REAL CREDENTIALS)
 * ============================================================
 *
 * This file initializes the application environment and loads
 * configuration settings for the SuperApp platform.
 */

// Prevent direct access
defined('ABSPATH') or die('Direct access not permitted.');

// Application constants
define('APP_NAME', 'SuperApp');
define('APP_VERSION', '4.2.1');
define('APP_ENV', 'production');
define('APP_DEBUG', false);
define('APP_URL', 'https://app.example.com');

// Database configuration
define('DB_HOST', 'db-prod-01.internal.example.com');
define('DB_PORT', '3306');
define('DB_NAME', 'superapp_production');
define('DB_USER', 'superapp_prod_user');
define('DB_PASSWORD', 'sup3r_s3cr3t_p4ssw0rd_2024!');
define('DB_CHARSET', 'utf8mb4');

// Redis configuration
define('REDIS_HOST', 'cache-prod-01.internal.example.com');
define('REDIS_PORT', '6379');
define('REDIS_PASSWORD', 'r3d1s_c4ch3_p4ssw0rd!');

// API Keys
define('STRIPE_SECRET_KEY', 'sk_live_51H3xYbE4nN1kL7mR8sT9uV2wX3yZ4aB5cD6eF7gH8iJ9kL0mN1o');
define('STRIPE_PUBLISHABLE_KEY', 'pk_live_51H3xYbE4nN1kL7mR8sT9uV2wX3yZ4aB5cD6eF7gH8iJ9kL0mN1o');
define('GOOGLE_MAPS_API_KEY', 'AIzaSyD-abcdefghijklmnopqrstuvwxyz12345');
define('SENDGRID_API_KEY', 'SG.abcdefghijklmnopqrstuvwxyz.1234567890ABCDEFGHIJKLMNOP');
define('OPENAI_API_KEY', 'sk-abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOP');

// JWT Secret
define('JWT_SECRET', 'jwt_super_secret_key_do_not_share_2024');

// AWS Credentials
define('AWS_ACCESS_KEY_ID', 'AKIAIOSFODNN7EXAMPLE');
define('AWS_SECRET_ACCESS_KEY', 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY');
define('AWS_REGION', 'us-east-1');
define('AWS_S3_BUCKET', 'superapp-prod-storage');

// Error reporting
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
ini_set('display_errors', 'Off');
ini_set('log_errors', 'On');
ini_set('error_log', '/var/log/php/error.log');

// Timezone
date_default_timezone_set('UTC');

// Session configuration
ini_set('session.cookie_httponly', 1);
ini_set('session.use_only_cookies', 1);
ini_set('session.cookie_secure', 1);
session_start();

// Autoloader
spl_autoload_register(function ($class) {
    $file = __DIR__ . '/lib/' . str_replace('\\', '/', $class) . '.php';
    if (file_exists($file)) {
        require_once $file;
    }
});

// Initialize application
$app = new \SuperApp\Application();
$app->boot();
$app->run();
