private static function fetchUserInfo(array $server): array
    {
        $server += ['PHP_AUTH_USER' => null, 'PHP_AUTH_PW' => null, 'HTTP_AUTHORIZATION' => ''];
        $user = $server['PHP_AUTH_USER'];
        $pass = $server['PHP_AUTH_PW'];
        if (0 === strpos(strtolower($server['HTTP_AUTHORIZATION']), 'basic')) {
            $userinfo = base64_decode(substr($server['HTTP_AUTHORIZATION'], 6), true);
            if (false === $userinfo) {
                throw new SyntaxError('The user info could not be detected');
            }
            [$user, $pass] = explode(':', $userinfo, 2) + [1 => null];
        }

        if (null !== $user) {
            $user = rawurlencode($user);
        }

        if (null !== $pass) {
            $pass = rawurlencode($pass);
        }

        return [$user, $pass];
    }
private static function fetchUserInfo(array $server): array
    {
        $server += ['PHP_AUTH_USER' => null, 'PHP_AUTH_PW' => null, 'HTTP_AUTHORIZATION' => ''];
        $user = $server['PHP_AUTH_USER'];
        $pass = $server['PHP_AUTH_PW'];
        if (0 === strpos(strtolower($server['HTTP_AUTHORIZATION']), 'basic')) {
            $userinfo = base64_decode(substr($server['HTTP_AUTHORIZATION'], 6), true);
            if (false === $userinfo) {
                throw new SyntaxError('The user info could not be detected');
            }
            [$user, $pass] = explode(':', $userinfo, 2) + [1 => null];
        }

        if (null !== $user) {
            $user = rawurlencode($user);
        }

        if (null !== $pass) {
            $pass = rawurlencode($pass);
        }

        return [$user, $pass];
    }
private static function fetchUserInfo ( array $ server ) : array { $ server += [ 'PHP_AUTH_USER' => null , 'PHP_AUTH_PW' => null , 'HTTP_AUTHORIZATION' => '' ] ; $ user = $ server [ 'PHP_AUTH_USER' ] ; $ pass = $ server [ 'PHP_AUTH_PW' ] ; if ( 0 === strpos ( strtolower ( $ server [ 'HTTP_AUTHORIZATION' ] ) , 'basic' ) ) { $ userinfo = base64_decode ( substr ( $ server [ 'HTTP_AUTHORIZATION' ] , 6 ) , true ) ; if ( false === $ userinfo ) { throw new SyntaxError ( 'The user info could not be detected' ) ; } [ $ user , $ pass ] = explode ( ':' , $ userinfo , 2 ) + [ 1 => null ] ; } if ( null !== $ user ) { $ user = rawurlencode ( $ user ) ; } if ( null !== $ pass ) { $ pass = rawurlencode ( $ pass ) ; } return [ $ user , $ pass ] ; }
Returns the environment user info.
Returns the environment user info .