PHP 8.3.31
Preview: Env.php Size: 2.96 KB
/home/getspomw/royalsquad.us/vendor/laravel/framework/src/Illuminate/Support/Env.php

<?php

namespace Illuminate\Support;

use Dotenv\Repository\Adapter\PutenvAdapter;
use Dotenv\Repository\RepositoryBuilder;
use PhpOption\Option;
use RuntimeException;

class Env
{
    /**
     * Indicates if the putenv adapter is enabled.
     *
     * @var bool
     */
    protected static $putenv = true;

    /**
     * The environment repository instance.
     *
     * @var \Dotenv\Repository\RepositoryInterface|null
     */
    protected static $repository;

    /**
     * Enable the putenv adapter.
     *
     * @return void
     */
    public static function enablePutenv()
    {
        static::$putenv = true;
        static::$repository = null;
    }

    /**
     * Disable the putenv adapter.
     *
     * @return void
     */
    public static function disablePutenv()
    {
        static::$putenv = false;
        static::$repository = null;
    }

    /**
     * Get the environment repository instance.
     *
     * @return \Dotenv\Repository\RepositoryInterface
     */
    public static function getRepository()
    {
        if (static::$repository === null) {
            $builder = RepositoryBuilder::createWithDefaultAdapters();

            if (static::$putenv) {
                $builder = $builder->addAdapter(PutenvAdapter::class);
            }

            static::$repository = $builder->immutable()->make();
        }

        return static::$repository;
    }

    /**
     * Get the value of an environment variable.
     *
     * @param  string  $key
     * @param  mixed  $default
     * @return mixed
     */
    public static function get($key, $default = null)
    {
        return self::getOption($key)->getOrCall(fn () => value($default));
    }

    /**
     * Get the value of a required environment variable.
     *
     * @param  string  $key
     * @return mixed
     *
     * @throws \RuntimeException
     */
    public static function getOrFail($key)
    {
        return self::getOption($key)->getOrThrow(new RuntimeException("Environment variable [$key] has no value."));
    }

    /**
     * Get the possible option for this environment variable.
     *
     * @param  string  $key
     * @return \PhpOption\Option|\PhpOption\Some
     */
    protected static function getOption($key)
    {
        return Option::fromValue(static::getRepository()->get($key))
            ->map(function ($value) {
                switch (strtolower($value)) {
                    case 'true':
                    case '(true)':
                        return true;
                    case 'false':
                    case '(false)':
                        return false;
                    case 'empty':
                    case '(empty)':
                        return '';
                    case 'null':
                    case '(null)':
                        return;
                }

                if (preg_match('/\A([\'"])(.*)\1\z/', $value, $matches)) {
                    return $matches[2];
                }

                return $value;
            });
    }
}

Directory Contents

Dirs: 6 × Files: 38

Name Size Perms Modified Actions
Defer DIR
- drwxrwxrwx 2025-09-17 06:53:02
Edit Download
- drwxrwxrwx 2025-09-17 06:53:02
Edit Download
Facades DIR
- drwxrwxrwx 2025-09-17 06:53:02
Edit Download
Process DIR
- drwxrwxrwx 2025-09-17 06:53:02
Edit Download
Testing DIR
- drwxrwxrwx 2025-09-17 06:53:01
Edit Download
Traits DIR
- drwxrwxrwx 2025-09-17 06:53:02
Edit Download
995 B lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.94 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
898 B lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.98 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
6.79 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
4.25 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
7.76 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
3.15 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
2.96 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
6.27 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.34 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
12.93 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
665 B lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.07 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
2.09 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
3.47 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.05 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
5.87 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
4.42 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
10.03 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
5.16 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
3.35 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
10.60 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.88 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
2.05 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
2.64 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
2.84 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
2.00 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
4.50 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
14.67 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
11.78 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
57.38 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
34.67 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.66 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
9.68 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.95 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
4.55 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
2.59 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).