[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.145.77.67: ~ $
<?php
declare(strict_types=1);

namespace PhpList\Core\Core;

/**
 * This class provides methods and constants for the application environment/context.
 *
 * @author Oliver Klee <oliver@phplist.com>
 */
final class Environment
{
    /**
     * environment for running a live site
     *
     * @var string
     */
    const PRODUCTION = 'prod';

    /**
     * environment for developing locally
     *
     * @var string
     */
    const DEVELOPMENT = 'dev';

    /**
     * environment for running automated tests
     *
     * @var string
     */
    const TESTING = 'test';

    /**
     * @var string
     */
    const DEFAULT_ENVIRONMENT = self::PRODUCTION;

    /**
     * @var string[]
     */
    private static $validEnvironments = [self::PRODUCTION, self::DEVELOPMENT, self::TESTING];

    /**
     * Private constructor to avoid instantiation.
     */
    private function __construct()
    {
    }

    /**
     * Validates that $environment is a valid environment, and throws an exception otherwise.
     *
     * @param string $environment must be one of the environment constants
     *
     * @return void
     *
     * @throws \UnexpectedValueException
     */
    public static function validateEnvironment(string $environment)
    {
        if (!in_array($environment, self::$validEnvironments, true)) {
            $environmentsText = '"' . implode('", ', self::$validEnvironments) . '"';
            throw new \UnexpectedValueException(
                '$environment must be one of ' . $environmentsText . ', but actually was: "' . $environment . '"',
                1499112172
            );
        }
    }
}

Filemanager

Name Type Size Permission Actions
ApplicationKernel.php File 4.75 KB 0644
ApplicationStructure.php File 1.92 KB 0644
Bootstrap.php File 7.79 KB 0644
Environment.php File 1.6 KB 0644