function toml($keyChain = null) { $helper = TomlHelper::getInstance(); if (getenv('TOML_NOT_USE_MEM')) { $helper->setUseMem(false); } $tomlMemHost = getenv('TOML_MEM_HOST'); if ($tomlMemHost !== false) { $helper->setHost($tomlMemHost); } $tomlMemPort = getenv('TOML_MEM_PORT'); if ($tomlMemPort !== false) { $helper->setPort($tomlMemPort); } $tomlDir = getenv('TOML_DIR'); if ($tomlDir !== false) { $helper->setTomlDir($tomlDir); } return $helper->get($keyChain); }
private function execPrivateMethod($name, ...$args) { $helper = TomlHelper::getInstance(); $class = new ReflectionClass($helper); $method = $class->getMethod($name); $method->setAccessible(true); $ret = null; if (empty($args)) { $ret = $method->invoke($helper); } else { $ret = $method->invokeArgs($helper, $args); } return $ret; }