| Conditions | 2 |
| Paths | 2 |
| Total Lines | 24 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | protected function getImageToSend(Image $image) |
||
| 19 | { |
||
| 20 | $url = $image->getMediumImageUri(); |
||
| 21 | if ($url === null) { |
||
|
|
|||
| 22 | throw new Exception("Couldn't get image URL in image tagger."); |
||
| 23 | } |
||
| 24 | |||
| 25 | $opts=array( |
||
| 26 | // Our staging server doesn't trust itself! TODO: We're not using |
||
| 27 | // Vagrant for staging any more. Maybe we don't need this. Plus we |
||
| 28 | // should just make the server certificates work. |
||
| 29 | "ssl" => array( |
||
| 30 | "verify_peer"=>false, |
||
| 31 | "verify_peer_name"=>false, |
||
| 32 | ), |
||
| 33 | // And on dev, we want to use the Symfony local server proxy |
||
| 34 | // (our Mac is set up to see the proxy config on http://127.0.0.1:7080/proxy.pac |
||
| 35 | // but we'll just hardcode it here. Hopefully it doesn't change!) |
||
| 36 | "http" => [ |
||
| 37 | 'proxy' => 'tcp://localhost:7080' |
||
| 38 | ] |
||
| 39 | ); |
||
| 40 | |||
| 41 | return fopen($url, 'rb', false, stream_context_create($opts)); |
||
| 42 | } |
||
| 44 |