Mercurial > hg > cmmr2012-drupal-site
comparison vendor/psy/psysh/src/VersionUpdater/GitHubChecker.php @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children |
comparison
equal
deleted
inserted
replaced
3:307d7a7fd348 | 4:a9cd425dd02b |
---|---|
22 /** | 22 /** |
23 * @return bool | 23 * @return bool |
24 */ | 24 */ |
25 public function isLatest() | 25 public function isLatest() |
26 { | 26 { |
27 return version_compare(Shell::VERSION, $this->getLatest(), '>='); | 27 return \version_compare(Shell::VERSION, $this->getLatest(), '>='); |
28 } | 28 } |
29 | 29 |
30 /** | 30 /** |
31 * @return string | 31 * @return string |
32 */ | 32 */ |
66 * | 66 * |
67 * @return mixed | 67 * @return mixed |
68 */ | 68 */ |
69 public function fetchLatestRelease() | 69 public function fetchLatestRelease() |
70 { | 70 { |
71 $context = stream_context_create([ | 71 $context = \stream_context_create([ |
72 'http' => [ | 72 'http' => [ |
73 'user_agent' => 'PsySH/' . Shell::VERSION, | 73 'user_agent' => 'PsySH/' . Shell::VERSION, |
74 'timeout' => 3, | 74 'timeout' => 3, |
75 ], | 75 ], |
76 ]); | 76 ]); |
77 | 77 |
78 set_error_handler(function () { | 78 \set_error_handler(function () { |
79 // Just ignore all errors with this. The checker will throw an exception | 79 // Just ignore all errors with this. The checker will throw an exception |
80 // if it doesn't work :) | 80 // if it doesn't work :) |
81 }); | 81 }); |
82 | 82 |
83 $result = @file_get_contents(self::URL, false, $context); | 83 $result = @\file_get_contents(self::URL, false, $context); |
84 | 84 |
85 restore_error_handler(); | 85 \restore_error_handler(); |
86 | 86 |
87 return json_decode($result); | 87 return \json_decode($result); |
88 } | 88 } |
89 } | 89 } |