<?php

use Roots\WPConfig\Config;
use function Env\env;

$env_keys = array();

# App Base environment keys
array_push($env_keys, 'BLOG_SLUG');
array_push($env_keys, 'GA_CODE');
array_push($env_keys, 'GTM_CODE');
array_push($env_keys, 'FORCE_SSL_ADMIN');
array_push($env_keys, 'FORCE_SSL_LOGIN');
array_push($env_keys, 'S3_UPLOADS_BUCKET');
array_push($env_keys, 'S3_UPLOADS_REGION');
array_push($env_keys, 'S3_UPLOADS_ENDPOINT');
array_push($env_keys, 'S3_UPLOADS_BUCKET_URL');
array_push($env_keys, 'S3_UPLOADS_DISABLE_REPLACE_UPLOAD_URL');
array_push($env_keys, 'S3_UPLOADS_HTTP_CACHE_CONTROL');
array_push($env_keys, 'S3_UPLOADS_USE_LOCAL');
array_push($env_keys, 'SMTP_ENABLED');
array_push($env_keys, 'SMTP_DEBUG');
array_push($env_keys, 'SMTP_DOMAIN');
array_push($env_keys, 'SMTP_PORT');
array_push($env_keys, 'SMTP_SERVER');
array_push($env_keys, 'SMTP_SECURE');
array_push($env_keys, 'SMTP_LOGIN');
array_push($env_keys, 'CLOUDFLARE_EMAIL');
array_push($env_keys, 'WP_CF_ACCESS_AUTH_DOMAIN');
array_push($env_keys, 'WP_CF_ACCESS_JWT_AUD');
array_push($env_keys, 'WP_CF_ACCESS_REDIRECT_LOGIN');
array_push($env_keys, 'LOGOUT_REDIRECT_URL');
###

# App Secret environment keys
array_push($env_keys, 'CLOUDFLARE_API_KEY');
array_push($env_keys, 'PUSH_ALERT_WEBSITE_ID');
array_push($env_keys, 'S3_UPLOADS_KEY');
array_push($env_keys, 'S3_UPLOADS_SECRET');
array_push($env_keys, 'SMTP_PASSWORD');
###

foreach ($env_keys as &$env_key) {
    if (env($env_key)) {
        Config::define($env_key, env($env_key));
    }
}

unset($env_key);
unset($env_keys);
