\WebApi::getInterfaces();

38 views
Skip to first unread message

Vincent Gabriel

unread,
Feb 18, 2015, 3:18:12 PM2/18/15
to steam-c...@googlegroups.com
running this returns an error

Undefined variable: http_response_header


the request method seems like something is missing

protected function request($url) {
        trigger_error("Querying Steam Web API: " . str_replace(self::$apiKey, 'SECRET', $url), E_USER_NOTICE);

        $data = @file_get_contents($url);

        if(empty($data)) {
            preg_match('/^.* (\d{3}) (.*)$/', $http_response_header[0], $http_status);

            if($http_status[1] == 401) {
                throw new WebApiException(WebApiException::UNAUTHORIZED);
            }

            throw new WebApiException(WebApiException::HTTP_ERROR, $http_status[1], $http_status[2]);
        }

        return $data;
    }


two variables are not declared, where are they coming from?

Sebastian Staudt

unread,
Feb 18, 2015, 5:34:33 PM2/18/15
to steam-c...@googlegroups.com
$http_response_header should be magically filled by `file_get_contents()`. What version of PHP are you using?

--
You received this message because you are subscribed to the Google Groups "Steam Condenser" group.
To unsubscribe from this group and stop receiving emails from it, send an email to steam-condens...@googlegroups.com.
To post to this group, send email to steam-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/steam-condenser/36e893ed-2941-432e-8866-140f74e848d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages