Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
/*
4
 * This file is part of Psy Shell.
5
 *
200 lars 6
 * (c) 2012-2023 Justin Hileman
148 lars 7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
 
12
namespace Psy;
13
 
14
/**
15
 * Environment variables implementation via $_SERVER superglobal.
16
 */
17
class SuperglobalsEnv implements EnvInterface
18
{
19
    /**
20
     * Get an environment variable by name.
21
     *
22
     * @return string|null
23
     */
24
    public function get(string $key)
25
    {
26
        if (isset($_SERVER[$key]) && $_SERVER[$key]) {
27
            return $_SERVER[$key];
28
        }
29
 
30
        return null;
31
    }
32
}