Index: branches/wmf/1.17wmf1/includes/objectcache/EhcacheBagOStuff.php |
— | — | @@ -11,9 +11,6 @@ |
12 | 12 | var $curls = array(); |
13 | 13 | |
14 | 14 | function __construct( $params ) { |
15 | | - if ( !defined( 'CURLOPT_TIMEOUT_MS' ) ) { |
16 | | - throw new MWException( __CLASS__.' requires curl version 7.16.2 or later.' ); |
17 | | - } |
18 | 15 | if ( !extension_loaded( 'zlib' ) ) { |
19 | 16 | throw new MWException( __CLASS__.' requires the zlib extension' ); |
20 | 17 | } |
— | — | @@ -34,6 +31,11 @@ |
35 | 32 | CURLOPT_POSTFIELDS => '', |
36 | 33 | CURLOPT_HTTPHEADER => array(), |
37 | 34 | ); |
| 35 | + if ( defined( 'CURLOPT_TIMEOUT_MS' ) ) { |
| 36 | + $this->curlOptions[CURLOPT_TIMEOUT_MS] = intval( $this->timeout * 1000 ); |
| 37 | + } else { |
| 38 | + $this->curlOptions[CURLOPT_TIMEOUT] = ceil( $this->timeout ); |
| 39 | + } |
38 | 40 | } |
39 | 41 | |
40 | 42 | public function get( $key ) { |