X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=vendor%2Fpsy%2Fpsysh%2Fsrc%2FPsy%2FVersionUpdater%2FGitHubChecker.php;h=5ac6969dda8b62d05407364a772b1f920ac19dda;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=520d7c5be037d1a9d9540aede6c151d9807a10f7;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/vendor/psy/psysh/src/Psy/VersionUpdater/GitHubChecker.php b/vendor/psy/psysh/src/Psy/VersionUpdater/GitHubChecker.php index 520d7c5be..5ac6969dd 100644 --- a/vendor/psy/psysh/src/Psy/VersionUpdater/GitHubChecker.php +++ b/vendor/psy/psysh/src/Psy/VersionUpdater/GitHubChecker.php @@ -68,8 +68,22 @@ class GitHubChecker implements Checker */ public function fetchLatestRelease() { - $context = stream_context_create(array('http' => array('user_agent' => 'PsySH/' . Shell::VERSION))); + $context = stream_context_create(array( + 'http' => array( + 'user_agent' => 'PsySH/' . Shell::VERSION, + 'timeout' => 3, + ), + )); - return json_decode(@file_get_contents(self::URL, false, $context)); + set_error_handler(function () { + // Just ignore all errors with this. The checker will throw an exception + // if it doesn't work :) + }); + + $result = @file_get_contents(self::URL, false, $context); + + restore_error_handler(); + + return json_decode($result); } }