<?php

use function Cake\Core\env;

/*
 * Copy this file to config/app_local.php and fill in real values,
 * or rely on environment variables (DATABASE_URL, DB_*, TURNSTILE_*, etc.).
 *
 * app_local.php is gitignored — commit this example only.
 */

return [
    'debug' => filter_var(env('DEBUG', true), FILTER_VALIDATE_BOOLEAN),
    'Security' => [
        'salt' => env('SECURITY_SALT', 'change-this-salt-for-your-local-copy'),
    ],
    'Datasources' => [
        'default' => [
            'className' => \Cake\Database\Connection::class,
            'driver' => \Cake\Database\Driver\Mysql::class,
            'persistent' => false,
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'username' => env('DB_USERNAME', 'candlecraft'),
            'password' => env('DB_PASSWORD', ''),
            'database' => env('DB_DATABASE', 'candlecraft'),
            'encoding' => 'utf8mb4',
            'timezone' => 'UTC',
            'flags' => [],
            'cacheMetadata' => true,
            'quoteIdentifiers' => false,
            'url' => env('DATABASE_URL', null),
        ],
        'test' => [
            'className' => \Cake\Database\Connection::class,
            'driver' => \Cake\Database\Driver\Mysql::class,
            'persistent' => false,
            'host' => env('DB_TEST_HOST', '127.0.0.1'),
            'port' => env('DB_TEST_PORT', '3306'),
            'username' => env('DB_TEST_USERNAME', 'candlecraft'),
            'password' => env('DB_TEST_PASSWORD', ''),
            'database' => env('DB_TEST_DATABASE', 'candlecraft_test'),
            'encoding' => 'utf8mb4',
            'timezone' => 'UTC',
            'cacheMetadata' => true,
            'quoteIdentifiers' => false,
            'url' => env('DATABASE_TEST_URL', null),
        ],
    ],
    'EmailTransport' => [
        'default' => [
            'host' => 'localhost',
            'port' => 25,
            'username' => null,
            'password' => null,
            'client' => null,
            'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
        ],
    ],
    'Turnstile' => [
        'siteKey' => env('TURNSTILE_SITE_KEY', ''),
        'secretKey' => env('TURNSTILE_SECRET_KEY', ''),
        'verifyUrl' => env('TURNSTILE_VERIFY_URL', 'https://challenges.cloudflare.com/turnstile/v0/siteverify'),
    ],
];
