<?php

declare(strict_types=1);

$baseUrl = 'http://localhost:8080';

$databases = [
    'default' => [
        'host'     => 'localhost',
        'dbname'   => '',
        'user'     => '',
        'password' => '',
        'port'     => 3306,
        'driver'   => 'pdo_mysql',
        'charset'  => 'utf8mb4',
        'collate'  => 'utf8mb4_general_ci',
    ],
    // you can add more database connections into this array
];

return [
    'application'           => [
        'name'       => 'DotKernel API',
        'url'        => $baseUrl,
        'versioning' => [
            'documentation_url' => 'https://docs.dotkernel.org/api-documentation/v5/core-features/versioning',
        ],
    ],
    'authentication'        => [
        'private_key'          => [
            'key_or_path'           => getcwd() . '/data/oauth/private.key',
            'key_permissions_check' => false,
        ],
        'public_key'           => [
            'key_or_path'           => getcwd() . '/data/oauth/public.key',
            'key_permissions_check' => false,
        ],
        'encryption_key'       => require getcwd() . '/data/oauth/encryption.key',
        'access_token_expire'  => 'P1D',
        'refresh_token_expire' => 'P1M',
        'auth_code_expire'     => 'PT10M',
        'invalid_credentials'  => [
            'error'             => 'Invalid credentials.',
            'error_description' => 'Invalid credentials.',
            'message'           => 'Invalid credentials.',
        ],
    ],
    'databases'             => $databases,
    'doctrine'              => [
        'connection'    => [
            'orm_default' => [
                'params' => $databases['default'],
            ],
        ],
    ],
    'uploads'               => [
        'user' => [
            'url'  => $baseUrl . '/uploads/user',
            'path' => realpath(__DIR__ . '/../../public/uploads/user'),
        ],
    ],
];
