Varakh
f6db46234a
- Add a ENV_DIR for docker containers to allow changing the env file location changes where the rest of the configuration is bootstrapped from - Add log_dir and snapshot_dir in env file configuration to determine the log and snapshot directories - Massively cleaned up README and provide better examples
46 lines
800 B
PHP
46 lines
800 B
PHP
<?php
|
|
|
|
/**
|
|
* Class Constants
|
|
*/
|
|
class Constants
|
|
{
|
|
/**
|
|
* Years tag
|
|
*/
|
|
const YEARS = '2020-2023';
|
|
|
|
/**
|
|
* Version tag
|
|
*/
|
|
const VERSION = '2.2.6';
|
|
|
|
/**
|
|
* Return constant by its class name
|
|
*
|
|
* @param $value
|
|
* @return string|null
|
|
* @throws ReflectionException
|
|
*/
|
|
public static function get($value)
|
|
{
|
|
$constants = self::getConstants();
|
|
if (!array_key_exists($value, $constants)) {
|
|
return null;
|
|
}
|
|
|
|
return $constants[$value];
|
|
}
|
|
|
|
/**
|
|
* Gets all constants
|
|
*
|
|
* @return array
|
|
* @throws ReflectionException
|
|
*/
|
|
private static function getConstants()
|
|
{
|
|
$oClass = new ReflectionClass(__CLASS__);
|
|
return $oClass->getConstants();
|
|
}
|
|
}
|