private function settingEnv(array $data): void
    {
        $loadedVars = \array_flip(\explode(',', \getenv(self::FULL_KEY)));
        unset($loadedVars['']);

        foreach ($data as $name => $value) {
            if (\is_int($name) || !\is_string($value)) {
                continue;
            }

            $name = \strtoupper($name);
            $notHttpName = 0 !== \strpos($name, 'HTTP_');

            // don't check existence with getenv() because of thread safety issues
            if ((isset($_ENV[$name]) || (isset($_SERVER[$name]) && $notHttpName)) && !isset($loadedVars[$name])) {
                continue;
            }

            // is a constant var
            if ($value && \defined($value)) {
                $value = \constant($value);
            }

            // eg: "FOO=BAR"
            \putenv("$name=$value");
            $_ENV[$name] = $value;

            if ($notHttpName) {
                $_SERVER[$name] = $value;
            }

            $loadedVars[$name] = true;
        }

        if ($loadedVars) {
            $loadedVars = \implode(',', \array_keys($loadedVars));
            \putenv(self::FULL_KEY . "=$loadedVars");
            $_ENV[self::FULL_KEY] = $loadedVars;
            $_SERVER[self::FULL_KEY] = $loadedVars;
        }
    }
private function settingEnv(array $data): void
    {
        $loadedVars = \array_flip(\explode(',', \getenv(self::FULL_KEY)));
        unset($loadedVars['']);

        foreach ($data as $name => $value) {
            if (\is_int($name) || !\is_string($value)) {
                continue;
            }

            $name = \strtoupper($name);
            $notHttpName = 0 !== \strpos($name, 'HTTP_');

            // don't check existence with getenv() because of thread safety issues
            if ((isset($_ENV[$name]) || (isset($_SERVER[$name]) && $notHttpName)) && !isset($loadedVars[$name])) {
                continue;
            }

            // is a constant var
            if ($value && \defined($value)) {
                $value = \constant($value);
            }

            // eg: "FOO=BAR"
            \putenv("$name=$value");
            $_ENV[$name] = $value;

            if ($notHttpName) {
                $_SERVER[$name] = $value;
            }

            $loadedVars[$name] = true;
        }

        if ($loadedVars) {
            $loadedVars = \implode(',', \array_keys($loadedVars));
            \putenv(self::FULL_KEY . "=$loadedVars");
            $_ENV[self::FULL_KEY] = $loadedVars;
            $_SERVER[self::FULL_KEY] = $loadedVars;
        }
    }
private function settingEnv ( array $ data ) : void { $ loadedVars = \ array_flip ( \ explode ( ',' , \ getenv ( self :: FULL_KEY ) ) ) ; unset ( $ loadedVars [ '' ] ) ; foreach ( $ data as $ name => $ value ) { if ( \ is_int ( $ name ) || ! \ is_string ( $ value ) ) { continue ; } $ name = \ strtoupper ( $ name ) ; $ notHttpName = 0 !== \ strpos ( $ name , 'HTTP_' ) ; // don't check existence with getenv() because of thread safety issues if ( ( isset ( $ _ENV [ $ name ] ) || ( isset ( $ _SERVER [ $ name ] ) && $ notHttpName ) ) && ! isset ( $ loadedVars [ $ name ] ) ) { continue ; } // is a constant var if ( $ value && \ defined ( $ value ) ) { $ value = \ constant ( $ value ) ; } // eg: "FOO=BAR" \ putenv ( "$name=$value" ) ; $ _ENV [ $ name ] = $ value ; if ( $ notHttpName ) { $ _SERVER [ $ name ] = $ value ; } $ loadedVars [ $ name ] = true ; } if ( $ loadedVars ) { $ loadedVars = \ implode ( ',' , \ array_keys ( $ loadedVars ) ) ; \ putenv ( self :: FULL_KEY . "=$loadedVars" ) ; $ _ENV [ self :: FULL_KEY ] = $ loadedVars ; $ _SERVER [ self :: FULL_KEY ] = $ loadedVars ; } }
setting env data
@param array $data
setting env data