@@ 318-330 (lines=13) @@ | ||
315 | // Attempt to connect to the server |
|
316 | $connection = @fsockopen($host, $port, $errno, $err, $timeout); |
|
317 | ||
318 | if (!$connection) |
|
319 | { |
|
320 | if (!$php_errormsg) |
|
321 | { |
|
322 | // Error but nothing from php? Create our own |
|
323 | $php_errormsg = sprintf('Could not connect to resource: %s', $uri, $err, $errno); |
|
324 | } |
|
325 | ||
326 | // Restore error tracking to give control to the exception handler |
|
327 | ini_set('track_errors', $trackErrors); |
|
328 | ||
329 | throw new \RuntimeException($php_errormsg); |
|
330 | } |
|
331 | ||
332 | // Restore error tracking to what it was before. |
|
333 | ini_set('track_errors', $trackErrors); |
@@ 221-234 (lines=14) @@ | ||
218 | // Open the stream for reading. |
|
219 | $stream = @fopen((string) $uri, 'r', false, $context); |
|
220 | ||
221 | if (!$stream) |
|
222 | { |
|
223 | if (!$php_errormsg) |
|
224 | { |
|
225 | // Error but nothing from php? Create our own |
|
226 | // @todo $err and $errno are undefined variables. |
|
227 | $php_errormsg = sprintf('Could not connect to resource: %s', $uri, $err, $errno); |
|
228 | } |
|
229 | ||
230 | // Restore error tracking to give control to the exception handler |
|
231 | ini_set('track_errors', $trackErrors); |
|
232 | ||
233 | throw new \RuntimeException($php_errormsg); |
|
234 | } |
|
235 | ||
236 | // Restore error tracking to what it was before. |
|
237 | ini_set('track_errors', $trackErrors); |