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