<?php

namespace Opentalent\OtCore\Service;

/**
 * Manage the opentalent environment variables
 *
 * To override the default values for a specific environment, set the new values as
 * global variables as $GLOBALS['OT']['YOUR_VAR']
 *
 * A good place to do that is in the AdditionalConfiguration.php file of your typo3 installation,
 * by adding for example:
 *
 *     $GLOBALS['OT']['DB_HOST'] = 'db';
 *
 */
class OpentalentEnvService
{
    public static function get($varname) {
        if (!array_key_exists($varname, $GLOBALS['OT'])) {
            throw new \RuntimeException('Un-existing OT environment variable requested: ' . $varname);
        }
        return $GLOBALS['OT'][$varname];
    }
}
