<?php

use function Cake\Core\env;

return [

    'debug' => filter_var(env('DEBUG', true), FILTER_VALIDATE_BOOLEAN),

    'Security' => [
        'salt' => env('SECURITY_SALT', '4c8e538bb6c258121a4f4d19fa5bfee013a4a66df83100327a919aac1a213139'),
    ],

    'Datasources' => [
        'default' => [
            'host' => 'localhost',
            'username' => 'fit_user',
            'password' => 'fit123',
            'database' => 'fit3047',
            'driver' => Cake\Database\Driver\Mysql::class,

            'url' => env('DATABASE_URL', null),
        ],

        'test' => [
            'host' => 'localhost',

            // If using MAMP, uncomment this:
            // 'port' => '8889',

            'username' => 'root',
            'password' => '', // change to 'root' if using MAMP

            'database' => 'test_myapp',

            'url' => env('DATABASE_TEST_URL', 'sqlite://127.0.0.1/tmp/tests.sqlite'),
        ],
    ],

    'EmailTransport' => [
        'default' => [
            'host' => 'localhost',
            'port' => 25,
            'username' => null,
            'password' => null,
            'client' => null,
            'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
        ],
    ],

    /*
     * OpenAI (optional): for the home-page teacher availability assistant.
     * Create a key at https://platform.openai.com/api-keys then either:
     *   - set environment variable OPENAI_API_KEY (recommended), or
     *   - put the key only in a local .env file (see config/.env.example).
     * Do not commit real keys to git.
     */
    'OpenAI' => [
        'apiKey' => env('OPENAI_API_KEY', ''),
        'model' => env('OPENAI_MODEL', 'gpt-4o-mini'),
    ],

    /*
     * Cloudflare Turnstile (contact form). Copy keys from the Cloudflare dashboard.
     */
    'Captcha' => [
        'turnstile' => [
            'siteKey' => env('TURNSTILE_SITE_KEY', '0x4AAAAAAC0Vt6zhruah80w3'),
            'secretKey' => env('TURNSTILE_SECRET_KEY', ''),
        ],
    ],
];
