Back | Home
الـ Path الحالي: /home/picotech/domains/instantly.picotech.app/public_html/vendor/voku/.././async-aws/core/src
الملفات الموجودة في هذا الـ Path:
.
..
AbstractApi.php
AwsClientFactory.php
AwsError
Configuration.php
Credentials
EndpointDiscovery
EnvVar.php
Exception
HttpClient
Input.php
Request.php
RequestContext.php
Response.php
Result.php
Signer
Stream
Sts
Test
Waiter.php

مشاهدة ملف: EnvVar.php

<?php

declare(strict_types=1);

namespace AsyncAws\Core;

/**
 * Helper to safely read environment variables.
 *
 * @author Jérémy Derussé <jeremy@derusse.com>
 *
 * @internal
 */
final class EnvVar
{
    public static function get(string $name): ?string
    {
        if (isset($_ENV[$name])) {
            // variable_order = *E*GPCS
            return (string) $_ENV[$name];
        } elseif (isset($_SERVER[$name]) && !\is_array($_SERVER[$name]) && 0 !== strpos($name, 'HTTP_')) {
            // fastcgi_param, env var, ...
            return (string) $_SERVER[$name];
        } elseif (false === $env = getenv($name)) {
            // getenv not thread safe
            return null;
        }

        return $env;
    }
}