PHP utility collection with hybrid and fluent APIs.

⌈⌋ branch:  hybrid7 libraries


Check-in [355bb2a455]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Close all curl_multi{} handles implicitly in ->exec() calls.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:355bb2a455d168e7641d70e997a14d2c664f8016
User & Date: mario 2014-03-17 14:47:08
Context
2014-03-21
21:45
Introduce ellipse … syntax for merging literal params into filter method names. check-in: 3a4f2387a0 user: mario tags: trunk
2014-03-17
14:47
Close all curl_multi{} handles implicitly in ->exec() calls. check-in: 355bb2a455 user: mario tags: trunk
14:46
Allows tree($array)->{'2,0,3'} traversal access. check-in: 2025631d71 user: mario tags: trunk
Changes

Changes to php7/curl.php.

196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222


223
224
225
226
227
228
229
        // process within timeframe
        while (($timeout > $t += $timeout/50) and $running) {

            curl_multi_exec($this->mh, $running);
            curl_multi_select($this->mh, $timeout/50);
        }

        // fetch results
        return $this->getcontent();
    }

    
    /**
     * Retrieve results, associative array.
     *
     */
    function getcontent() {
        return array_map("curl_multi_getcontent", array_map("current",/*retrieve first property (->handle) each*/ $this->list));
    }
    

    /**
     * Close all curl() handles in $list, and the multi-curl wrapper.
     *
     */
    function close() {
        return $this->__call("close", array()) | curl_multi_close($this->mh);


    }


    /**
     * Applies options on each curl handle.
     *
     */







|
|













|


|
|
>
>







196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
        // process within timeframe
        while (($timeout > $t += $timeout/50) and $running) {

            curl_multi_exec($this->mh, $running);
            curl_multi_select($this->mh, $timeout/50);
        }

        // fetch results, then close handles
        return $this->close( $this->getcontent() );
    }

    
    /**
     * Retrieve results, associative array.
     *
     */
    function getcontent() {
        return array_map("curl_multi_getcontent", array_map("current",/*retrieve first property (->handle) each*/ $this->list));
    }
    

    /**
     * Close all curl() handles in $list, and the curl-multi wrapper.
     *
     */
    function close($r=NULL) {
        $this->__call("close", array());
        curl_multi_close($this->mh);
        return $r;
    }


    /**
     * Applies options on each curl handle.
     *
     */