public function getCurrencyCode() { if (isset(self::$curCode)) { return self::$curCode; } if (file_exists('currency')) { $code = strtoupper(trim(file_get_contents('currency'))); if (Currency::validateCode($code)) { self::$curCode = $code; return self::$curCode; } throw new UnexpectedValueException(); } self::$curCode = 'USD'; return self::$curCode; }