MOON
Server: Apache
System: Linux server.royaltuning.hu 4.18.0-425.13.1.el8_7.x86_64 #1 SMP Tue Feb 21 04:20:52 EST 2023 x86_64
User: royaltuning (1001)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/local/apache/htdocs/Modules/Support/Locale.php
<?php

namespace Modules\Support;

class Locale
{
    /**
     * Path of the resource.
     *
     * @var string
     */
    const RESOURCE_PATH = __DIR__ . '/Resources/locales.php';

    /**
     * Array of all locales.
     *
     * @var array
     */
    private static $locales;

    /**
     * Get all locales.
     *
     * @return array
     */
    public static function all()
    {
        if (is_null(self::$locales)) {
            self::$locales = require self::RESOURCE_PATH;
        }

        return self::$locales;
    }

    /**
     * Get all locale codes.
     *
     * @return void
     */
    public static function codes()
    {
        return array_keys(static::all());
    }

    /**
     * Get name of the given locale code.
     *
     * @param string $code
     * @return string
     */
    public static function name($code)
    {
        return array_get(static::all(), $code);
    }
}